[Dwarf-Discuss] Lexical block address ranges when nesting

Martin Day martin at snsys.com
Fri Nov 7 04:14:22 PST 2008

Section 3.4 of the dwarf3 spec says :

"The lexical block entry may have either a DW_AT_low_pc and DW_AT_high_pc
pair of attributes or a DW_AT_ranges attribute whose values encode the
contiguous or non-contiguous address ranges, respectively, of the machine
instructions generated for the lexical block (see Section 2.17)."

We're compiling C/C++ using DW_AT_ranges. Should the ranges specified for a
lexical block include the ranges of all nested (child) lexical blocks or
should it only be the address ranges of instructions generated for that
lexical block as the quote above seems to imply or is it undefined and
implementation dependant?

Compiler writers say it's easier for them to just list the ranges for
instructions in the block excluding those in nested blocks. Debugger writers
would prefer the ranges of a parent block to include all the ranges of child
blocks so that a tree search is easier.

Is this explicitly defined somewhere in the standard or should the debugger
be able to cope with either method?



More information about the Dwarf-Discuss mailing list