[Dwarf-discuss] tag nesting question

David Anderson davea42
Fri Dec 22 17:14:55 GMT 2006

Martin Day writes:

>I agree. I would  much prefer our debuggers to be able to show the type as
>"class x" or "struct x" as appropriate. Currently, for gcc built debug info,
>we have to take a guess.

If you mean 'reflect what the source code said' then I fully agree.
This was always the intent of DWARF (to allow the debugger to report
exactly what the coder said in the source code).  gcc is making
it difficult for the debugger to achieve this goal.

>It also makes sense to only accept the correct kind of tag when evaluating a
>type cast expression. e.g. only accept "(struct x*) 0x1000" when x is a
>struct and not "(class x*) 0x1000".

This is a Quality Of Implementation issue.  It is also a matter of taste.
Some feel it's better to 'do what the user clearly means' even if it's
not precisely what the language compiler would accept (I'm firmly in this camp).
But this is straying from DWARF itself, so lets not go too far
down this road...

David Anderson

More information about the Dwarf-discuss mailing list