[Dwarf-discuss] tag nesting question

Martin Day martin
Fri Dec 22 13:23:41 GMT 2006

> -----Original Message-----
> From: dwarf-discuss-bounces at lists.freestandards.org 
> [mailto:dwarf-discuss-bounces at lists.freestandards.org] On 
> Behalf Of Marcel Mettes
> > In the specific case of GCC, we'd either have to have a callback to 
> > the C++ FE at debug info output to ask it whether it's 
> struct/class, 
> > or waste a bit in the type structure to store this info.
> >
> > I posted a patch about 3 years ago that wasted a bit.
> > See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7081
> > and
> > http://gcc.gnu.org/ml/gcc-patches/2003-06/msg01748.html
> >
> > I never got back to updating it in response to the comments, even 
> > though they were very minor, as i started law school back up again 
> > soon after.
> >
> > If you really feel like it, you could update this patch and 
> resubmit 
> > it.
> >
> > Nowadays, I think it's a waste of time to differentiate the two :)
> >
> >
> As being someone who works on debuggers, I would love to see 
> the extra info. One of my personal goals for the debugger is 
> that it shows exactly what 
> was present in the original source code that was compiled, so that 
> someone who is debugging may spot an error because of the 
> actual input. 
> Hiding differences like struct versus class is not likely to 
> hide bugs, 
> but in general I prefer as much detail as possible.
> Also, with g++ compiled objects, the debugger must first use 
> some test 
> to detect how to display DW_TAG_struct_type (personally I do 
> not want to 
> see struct when debugging C++) which I do not like much 
> myself. I would 
> like to use as little heuristics as possible, there is enough 
> confusion 
> already :-).

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.

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".


More information about the Dwarf-discuss mailing list