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: gdb needs full C++ function signature to set a breakpoint


On Fri, Jul 08, 2005 at 04:09:44PM +0200, Klaus Zeitler wrote:
> I figured out the difference between my small example and the big image.
> For the example image gdb correctly recognizes the program as C++, i.e. says:
> "The current source language is "auto; currently c++"."
> whereas for the real image gdb claims, that it's c.
> So a simple "set lang c++" is all that was needed.
> 
> Now I would like to know why gdb thinks that this is a c image.
> Could it be that gdb decides that by searching main()?

GDB does not have a single impression of the language - it depends on
the current location in the code.  But yes, before the program is
started, the current "location" used is main().

This is a wart; it'd be nice if the CLI did not depend on this for some
things that it does presently, but it isn't clear how to fix it.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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