Branch: refs/heads/thaines/symtab_remove_findModuleByName
  Home:   https://github.com/dyninst/dyninst
  Commit: 2b8973b9385b559eb70b16187a62cc634bd9d2a9
      
https://github.com/dyninst/dyninst/commit/2b8973b9385b559eb70b16187a62cc634bd9d2a9
  Author: Tim Haines <thaines.as...@gmail.com>
  Date:   2023-10-07 (Sat, 07 Oct 2023)

  Changed paths:
    M symtabAPI/doc/3-Examples.tex
    M symtabAPI/doc/API/LineInfo/Iterating.tex
    M symtabAPI/doc/API/Symtab/Symtab.tex
    M symtabAPI/h/Symtab.h
    M symtabAPI/src/Symtab-lookup.C
    M symtabAPI/src/Symtab.C

  Log Message:
  -----------
  Remove Symtab::findModuleByName(Module *&, std::string)

We consider the name of a module to be the DW_AT_name of the containing
DIE. This is either the full path name of the source file used to create
the CU or the relative path of the same with respect to the
DW_AT_comp_dir. We ensure that the module's name is always an absolute
path.

Modules have never been required to have unique names. That is, many
modules can share the same name. The following demonstrates this case:

test.c
------
  void func1(){}
  void func2(){}

$ gcc -g -c -DFUNC1 -o func1.o test.c
$ gcc -g -c -DFUNC2 -o func2.o test.c
$ gcc -g -fPIC -shared func1.o func2.o -o libfunc.so
$ readelf --debug-dump=info libfunc.so | grep -A 5 DW_TAG_compile_unit
 <0><c>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indirect string, offset: 0x0): <redacted>
    <11>   DW_AT_language    : 29       (C11)
    <12>   DW_AT_name        : (indirect line string, offset: 0x19): test.c
    <16>   DW_AT_comp_dir    : (indirect line string, offset: 0x0): 
/path/to/test
    <1a>   DW_AT_low_pc      : 0x10f9

 <0><55>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <56>   DW_AT_producer    : (indirect string, offset: 0x0): <redacted>
    <5a>   DW_AT_language    : 29       (C11)
    <5b>   DW_AT_name        : (indirect line string, offset: 0x19): test.c
    <5f>   DW_AT_comp_dir    : (indirect line string, offset: 0x0): 
/path/to/test
    <63>   DW_AT_low_pc      : 0x1104


_______________________________________________
Dyninst-api mailing list
Dyninst-api@cs.wisc.edu
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api

Reply via email to