Re: GDB Breakpoints in C++
Re: GDB Breakpoints in C++
- Subject: Re: GDB Breakpoints in C++
- From: "Rob Napier" <email@hidden>
- Date: Thu, 10 Jan 2008 07:46:36 -0500
Sorry, yes, it is Objective C++. I should have made this more clear. I
was also seeing this warning:
[Switching to process 1564 thread 0xb503]
[Switching to process 1564 thread 0xb503]
Current language: auto; currently objective-c++
Warning: the current language does not match this frame.
I'll see if I can isolate it to something smaller.
-Rob
On Jan 9, 2008 8:16 PM, Jason Molenda <email@hidden> wrote:
>
> 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