C++ support improvement patch

Daniel Jacobowitz drow@false.org
Mon Jan 23 15:05:00 GMT 2006


On Mon, Jan 23, 2006 at 03:59:50PM +0100, Thomas Richter wrote:
> Thanks for letting me know that this is being worked on. I agree that
> the given patch is pretty much a "hands on" approach. If there's a better
> way to do it, please do. Otherwise, the patch is "better than nothing".

Maybe, maybe not.  The readline completion is fairly finicky.  I'm
pretty sure colon was included for a reason, although I don't know
offhand what it was; but this is exactly the same problem as with
var.<tab> and it shouldn't be solved differently.

> > > o) GDB now avoids to set multiple breakpoints to the same location.
> > > This goes in conjunction with another bug, namely that of being unable
> > > to find constructors of multiply-inherited classes. Without the current
> > > patch, setting a breakpoint for a constructor results in multiple breakpoint
> > > locations found, all of them identical, and none of them actually 
> > > beeing breaked on. With the patch applied, GDB at least finds only one
> > > of the locations (good), but still doesn't break there (bad). This bug
> > > seems partially caused by g++ not emmiting mangled names for constructors.
> > 
> > Would be better not to return duplicates, instead of not putting
> > duplicates on the list... we know exactly why this happens.  It's
> > all part of the multiple constructors issue that you mentioned below,
> > and you can find more information about this in the gdb@ list archives.
> 
> Could you provide a reference, please? Currently, the found symbols are
> identically (in fact, it's even the same structure using the same pointer),
> so I don't quite see what's the benefit as there's no chance of telling
> them apart later. I get two breakpoints at the same location (then, breaking
> nothing). In the long run, though, I agree and the problem should be fixed,
> not the symptom.

For instance, this and followups:
  http://sourceware.org/ml/gdb/2006-01/msg00102.html

Although that doesn't address this particular sub-problem.  The actual
cause of the two duplicate breakpoints is GDB's bogus dependence on
DW_AT_MIPS_linkage_name, which the abstract constructors do not have.
Both your breakpoints are probably being placed at the not-in-charge
constructor; if you constructed a derived class which virtually
inherited from this one, you would probably hit that breakpoint.

> Thus, a similar patch applied higher in the calling chain, within
> "info"?

Probably a new interface.  I haven't thought about where it would go.
But breaking the current behavior for 'print' just isn't acceptable;
too many people expect it.


-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list