The function which contains an inline might not be the immediate next
die scope. For instance, there may be a lexical scope in between.
Instead, iterate the remaining scopes until an appropriate tag is found.
Signed-off-by: Josh Stone <jistone@redhat.com>
+2014-12-10 Josh Stone <jistone@redhat.com>
+
+ * addr2line.c (handle_address): Find the proper inline parents.
+
2014-12-07 Mark Wielaard <mjw@redhat.com>
* readelf.c (print_debug_line_section): max_ops_per_instr cannot
continue;
if (show_functions)
- print_diesym (&scopes[i + 1]);
+ {
+ /* Search for the parent inline or function. It
+ might not be directly above this inline -- e.g.
+ there could be a lexical_block in between. */
+ for (int j = i + 1; j < nscopes; j++)
+ {
+ Dwarf_Die *parent = &scopes[j];
+ int tag = dwarf_tag (parent);
+ if (tag == DW_TAG_inlined_subroutine
+ || tag == DW_TAG_entry_point
+ || tag == DW_TAG_subprogram)
+ {
+ print_diesym (parent);
+ break;
+ }
+ }
+ }
src = NULL;
lineno = 0;