This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [patch 2/4] Provide __libdwfl_module_getsym to get dwfl_file *
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 13 Nov 2013 12:48:29 +0100
- Subject: Re: [patch 2/4] Provide __libdwfl_module_getsym to get dwfl_file *
On Wed, 2013-11-06 at 22:10 +0100, Jan Kratochvil wrote:
> Provide __libdwfl_module_getsym to get dwfl_file *
>
> libdwfl/
> 2013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Provide __libdwfl_module_getsym to get dwfl_file *.
> * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
> (dwfl_module_addrsym) (search_table): New variable file. Use
> __libdwfl_module_getsym. Use file.
> * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
> (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
> (dwfl_module_getsym): New wrapper.
> * libdwflP.h (__libdwfl_module_getsym): New declaration.
This is nice, it makes sure dwfl_module_getsym and dwfl_module_addrsym
are automatically in sync regarding the file the symbol comes from.
Looks good, please apply.
So, I think the user might also want to get hold of the file. Do you
think it makes sense to provide the user with extended versions of
getsym and addrsym based on this?
const char *dwfl_module_getsym_elf (Dwfl_Module *mod, int ndx,
GElf_Sym *sym, GElf_Word *shndxp,
Elf *elf)
char *dwfl_module_addrsym_elf (Dwfl_Module *mod, GElf_Addr address,
GElf_Sym *sym, GElf_Word *shndxp,
Elf *elf)
Where elf will be the main or debug file.
Thanks,
Mark