• 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: Debug Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debug Problems


  • Subject: Re: Debug Problems
  • From: Justin Greenfield <email@hidden>
  • Date: Sun, 12 Jun 2005 12:57:37 -0500


On Jun 12, 2005, at 11:36 AM, Chris Espinosa wrote:


On Jun 12, 2005, at 9:24 AM, Jesse Grosjean wrote:


Sorry if this has already been mentioned.... but

I've been having lots of trouble making the debugger (in 2.1) work properly and think I've traced it to an incorrect default setting. If you create a new project the "Optimization Level" for the "Debug" configuration is set to "Fastest, Smallest". If you change this to "None" then clean everything debugging seems to work well again.



This is a well-known trait of optimized code in all environments. A compiler will reorder instructions, take shortcuts, hide variables, and make other assumptions from your code that make it differ wildly from the way you wrote it. Setting the optimization level to "None" in all Development or Debug build settings or configurations is highly recommended.


Chris


I ported our Carbon project from CW 8.3 to XCode 2.1 this past week at WWDC and noticed while debugging that in some functions, some of my symbols show up as <incomplete type>. In other functions, the same type of symbols show up okay. In some functions, even C++ types like bool show up in the debugger as <incomplete type>, so this is pretty seriously broken for me.


I dropped by the XCode lab on Friday and talked to one of the gdb gurus there, and after an hour or so, he couldn't figure out why this was happening either. He had me file a bug on the spot and submit a source file that reproduced the problem (radr://4144739). He showed me a sort of workaround by typing some commands in the gdb console. For a pointer variable "bar" that's of type "Foo" that shows up as <incomplete type> in the debugger, I can see the members of that class by typing:

 print *(Foo*)(void*)bar

It works but it's not a solution that's going to get me to use XCode for my day to day work. We're going to have to come up with a better solution than this to use XCode.

When I saw this e-mail, I went into my Debug build configuration and turned the optimizations off, but my problems viewing some symbols in the debugger still persist. I created my XCode project from the Carbon app template, so it didn't inherit this setting from a previous build style or anything like that. I was surprised that optimizations weren't turned off in the Debug build configuration by default. That kinda seems like a bug to me.

Other than this debugger problem, which I must say is a pretty major sticking point for me to be productive with XCode, getting things building in XCode for both architectures took only a couple of hours, and our app (which is cross-platform already) ran natively on the Intel transition machines on the first launch. I installed XCode and setup my project Tuesday night, and first thing Wednesday morning I went into the Universal Binaries Lab and tried it out. It worked great. I was really pleased (not to mention amazed) at how straightforward it was.

Justin
--
OCS Software Development Group
http://sdg.ocs.ou.edu/


_______________________________________________ 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: 
 >Debug Problems (From: Jesse Grosjean <email@hidden>)
 >Re: Debug Problems (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Xcode 2.1 debugger grief [Solved]
  • Next by Date: Re: Debug Problems
  • Previous by thread: Re: Debug Problems
  • Next by thread: Re: Debug Problems
  • Index(es):
    • Date
    • Thread