diff options
| author | Mark Wielaard <[email protected]> | 2013-09-20 09:50:42 -0400 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2013-09-24 10:28:14 +0200 |
| commit | 1b734df17fca9f89a887b85ffe74616a87388f51 (patch) | |
| tree | 2dc0ba75b4c517261ad60a17f96b6f766722f9b5 /libdw/ChangeLog | |
| parent | 21fc33fe191603b71e9e14d2d1a79a8aa48ad6e6 (diff) | |
libdw: Make dwarf_getfuncs find all (defining) DW_TAG_subprogram DIEs.
dwarf_getfuncs used to return only the DW_TAG_subprogram DIEs that were
direct children of the given CU. This is normally how GCC outputs the
subprogram DIEs. But not always. For nested functions the subprogram DIE
is placed under the code construct DIE where it is nested. Other compilers
might output the defining subprogram DIE of a C++ class function under
the DW_TAG_namespace DIE where it was defined. Both such constructs seem
allowed by the DWARF specification. So just searching the CU DIE children
was wrong.
To find all (defining) subprogram DIEs in a CU dwarf_getfuncs should
use __libdw_visit_scopes to walk the tree for all DIEs that can contain
subprograms as children. The only tricky part is making sure the offset
returned and used when the callback returns DWARF_CB_ABORT is correct
and the search continues at the right spot in the CU DIE tree. This
operation now needs to rewalk the whole tree.
Two new testcases were added that fail without this patch. And the
allfcts test was tweaked so that it always returns DWARF_CB_ABORT
from its callback to make sure the offset handling is correct.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/ChangeLog')
| -rw-r--r-- | libdw/ChangeLog | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 1a851948..8e1dd92c 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,10 @@ +2013-09-20 Mark Wielaard <[email protected]> + + * dwarf_getfuncs.c (visitor_info): New struct. + (tree_visitor): New function. + (dwarf_getfuncs): Use __libdw_visit_scopes with tree_visitor. + * libdw.h (dwarf_getfuncs): Expand function documentation. + 2013-09-12 Mark Wielaard <[email protected]> * fde.c (intern_fde): Free fde and set libdw errno when start |
