This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Failed breakpoint for C++ in gdb


On Thu, Jul 28, 2005 at 05:39:28PM -0400, Alain Magloire wrote:
> 
> 
> > >
> > > Is the "const char *" vs. "char const *" example consistent in GDB i.e.
> > can
> > > I assume this and do some mangling on my own to satisfy the pickiness of
> > > GDB?
> > 
> > This is not GDB's pickiness.
> 
> Agreed, but for the user, with code source like this foobar(const char *p);
> and then having the debugger insisting on only accepting foobar(char const
> *p) for breakpoint is ... heu ... bizarre.
> 
> > It is following whatever the compiler has
> > specified in debug information.  You could still query GDB for the
> > overloads in some fashion, I expect, but I don't know for sure.
> >
> 
> That may not be possible (the query) for the front-end.  Let me ask you
> rephrase the question, is this behavior dependent of the type of debug info?
> i.e. if I use dwarf-2 vs. stabs++, GDB will not refuse "char const *" I can
> work around this if the behavior is consistent.

It's completely at the whim of the compiler.  Whatever strings the
compiler has put in the debug information, those are the ones GDB will
use in symbol names.  It varies between GCC versions; I believe it also
varies between formats.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]