Re: GDB Breakpoints in C++
Re: GDB Breakpoints in C++
- Subject: Re: GDB Breakpoints in C++
- From: Jason Molenda <email@hidden>
- Date: Wed, 9 Jan 2008 17:16:57 -0800
On Jan 9, 2008, at 5:02 PM, Rob Napier wrote:
I'm debugging some C++ code in GDB using XCode3. I've set the
breakpoint to run the command "p connection->getType()". When the
breakpoint fires, I get the error "Couldn't find method getType", but
if I then run the command by hand, it works fine.
I've dug into this and found that in the breakpoint-command, "ptype
connection" returns "struct Connection *", while if I run "ptype
connection" by hand I get "class Connection *". I strongly believe
this is the culprit.
Is it possible that this is Objective C++ code? Given a simple C++
program like
#include <unistd.h>
class myc {
public:
bool leBool() { return _b; }
myc() { _b = true; }
bool _b;
};
main () {
myc *a = new myc;
while (1)
sleep (1);
return a->leBool();
}
if I put a conditional breakpoint on the sleep() line,
(gdb) b 11 if a->leBool()
it works. If you can isolate a reproducible case of this issue,
please file a bug at http://bugreport.apple.com/ . I couldn't get it
to occur but if I were guessing I'd guess that there could be some ObjC
++ "which language are we evaluating this expression in" confusion at
the source.
Thanks
J
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden