[Dwarf-discuss] dwarf information for mutiple statements at thesame line.

Chris Quenelle Chris.Quenelle
Mon Jul 17 20:19:04 GMT 2006


I think the HP scheme described by Cary seems to be a good
design in terms of density.  But the simple name of a routine has
proven to be only a fuzzy way to identify a function
when combined with C++ and templates and overloading. I
try to stay away from forcing the debugger to resolve
names to program objects, in favor of using addresses
and direct pointers where possible.

It seems like it would be better to have the line number
table reference an offset within the debug_info section
as a way to identify which function got inlined.  And
if we're going to do that, why not point to the
DW_TAG_inlined_subroutine die instead of the DW_TAG_subroutine die?

You might not need to record any additional line information
in the line table, if we allowed a way to efficiently point
from a row in the line table to a specific inlined_subroutine
die.

The source coordinates in the inlined subroutine die apply
to a much larger number of individual instructions, so
duplicating the same source coords over and over in the
line table doesn't seem efficient to me.


--chris




Daniel Jacobowitz wrote:
> On Fri, Jul 14, 2006 at 12:53:33PM -0700, Chris Quenelle wrote:
> 
>>>I can see how this scheme would be useful for macros, but does it offer
>>>anything that the combination of DW_TAG_inlined_subroutine,
>>>DW_AT_call_file, et cetera don't for inlined functions?  Or is it just
>>>a different model that accomplishes roughly the same thing?
>>
>>Using DW_TAG_inlined_subroutine requires that you specify the
>>instruction range for the inlined routine using a location
>>list and DW_AT_ranges.  This is very inefficient compared the
>>encoding the same information in the line table.
> 
> 
> Hmm... that's true.  I wouldn't be averse to supporting an alternative
> representation in the GNU tools, if there's interest in adding same
> to DWARF.
> 





More information about the Dwarf-discuss mailing list