• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GDB Breakpoints in C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: GDB Breakpoints in C++
      • From: "Rob Napier" <email@hidden>
References: 
 >GDB Breakpoints in C++ (From: "Rob Napier" <email@hidden>)

  • Prev by Date: GDB Breakpoints in C++
  • Next by Date: IB3.0 bug? IB3 won't let me move any new objects with the mouse
  • Previous by thread: GDB Breakpoints in C++
  • Next by thread: Re: GDB Breakpoints in C++
  • Index(es):
    • Date
    • Thread