• 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: Xcode Ignoring breakpoints!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode Ignoring breakpoints!


  • Subject: Re: Xcode Ignoring breakpoints!
  • From: Andreas Grosam <email@hidden>
  • Date: Fri, 9 Sep 2005 13:28:23 +0200


On 09.09.2005, at 05:48, Sailesh Agrawal wrote:

Ando Sonenblick wrote:

Gang,

Is there anything I can do to get Xcode to break at all my breakpoints?!

Make sure you have "Load symbols lazily" unchecked (Preferences -> Debugging).


XCode runs best when you've disabled all of Apple's little features like zero link, auto completion, etc...

I would like to mention another problem with breakpoints:

Often XCode does not break in constructors and destructors of C++ classes.

This is due a bug in gdb, which is unable to properly handle the new ABI specification, which gcc-3.3 and gcc-4 conforms to. This is a long standing bug, and i only know of a sound fix in the Redhat distribution of gdb.

The reason is, with the new ABI (see link below), compilers generate up to 3 versions of a certain constructor, respectively destructur. That means, there may exist three different versions of code for the same constructor, for instance for A::A() there are three different code versions.

The different versions are needed for different purposes. For instance, there is one version of c-tor for constructing a complete object, another is required for constructing an object which is a sub object of another one.

Each version has its own unique mangeled name, for the Foo::Foo() c-tor this is for instance
_ZN3FooC1Ev, _ZN3FooC2Ev and _ZN3FooC3Ev. This is necessary to link appropriately.


Well, now when you set a breakpoint in the gutter within a c-tor, XCode interfaces to gdb, and gdb evaluates an address which corresponds to the source line and sets the breakpoint at this address. It only finds the first occurence of the address which matches the source line. However, actually, there are up to three code addresses matching the same source line.

Of course, you can imagine that the breakpoint set at only one version of the c-tor might not correspond to the version of the c-tor you need to break in.


A workaround to this problem is to use gdb´s console directly to set breakpoints in constructors and destructors.
Actually, you *can* set a breakpoint in all three versions of a c-tor.
However, this is a bit tedious. You need to get the mangled names for the c-tors, and d-tors, and type it into the console. And you need to get familiar with gdb.


Furthermore, there are currently some issues when setting breakpoints within gdb and how XCode handles these. For instance, you do not see the "arrow" in the gutter which indicates a breakpoint, if you set it with gdb. Due to a bug in the breakpoint window, the list of breakpoints may become out of sync with the actually set breakpoints - which are stored within gdb. (bug already filed, no fix in 2.2 seed so far).



More info about the ABI:
http://www.codesourcery.com/cxx-abi/abi.html#obj-ctor


An example of the error in gdb how it occures, confuses people and how it is fixed finally (read with care):
https://bugzilla.redhat.com/bugzilla/long_list.cgi?buglist=117826
http://rhn.redhat.com/errata/RHBA-2005-187.html



Regards Andreas


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ 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
References: 
 >Xcode Ignoring breakpoints! (From: Ando Sonenblick <email@hidden>)
 >Re: Xcode Ignoring breakpoints! (From: Sailesh Agrawal <email@hidden>)

  • Prev by Date: Re: Xcode Rules
  • Next by Date: Re: Xcode Rules
  • Previous by thread: Re: Xcode Ignoring breakpoints!
  • Next by thread: Frameworks and SDKs
  • Index(es):
    • Date
    • Thread