This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

dwarflint: ranges of DIEs in hierarchy


Hi,

I'm implementing a check that the range of .debug_loc addresses doesn't 
run off range claimed by DW_AT_low_pc/high_pc pair or DW_AT_ranges.  It 
just so happens that it's also easy to check that ranges of a DIE are 
sub-range of its parent, since I need that range-tracking logic anyway. 
  Such a check sounded plausible to me, but it wasn't really that hard 
to found a case that gives me second thoughts (from readelf):

  [  5333]    subprogram
              name                 "parse_opt"
              decl_file            1
              decl_line            283
              prototyped
              type                 [   435]
              low_pc               0x0000000000403510 <parse_opt>
              high_pc              0x0000000000403ab0 <print_pubnames>
              frame_base           location list [   2b1]
              sibling              [  566d]
  [  5358]      formal_parameter [...]
  [  5368]      formal_parameter [...]
  [  5378]      subprogram
                name                 "add_dump_section"
                decl_file            1
                decl_line            286
                prototyped
                low_pc               0x004034b0 <add_dump_section.9838>
                high_pc              0x0040350e
                frame_base           location list [   4f7]
                static_link          1 byte block: 56
                 [   0] reg6
                sibling              [  53d5]

... so that's a case of internal function add_dump_section inside other 
function parse_opt.  The internal function wasn't inlined, and so 
occupies different part of address space.

I can't decide whether that case is kosher, I can argue both sides. 
Shouldn't the parent either claim addresses of its child, or not have 
that DIE as a child in a first place?

PM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]