[patch 2/4] Provide __libdwfl_module_getsym to get dwfl_file *

Mark Wielaard mjw at redhat.com
Wed Nov 13 11:48:29 UTC 2013


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 at 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



More information about the elfutils-devel mailing list