• 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 Debugger Showing Wrong File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode Debugger Showing Wrong File


  • Subject: Re: Xcode Debugger Showing Wrong File
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 6 Dec 2007 09:48:22 -0800


On Dec 6, 2007, at 8:11 AM, Steve Sisak wrote:

A little more detail:

Switching to a Quad G5, the problem goes away -- for now I'll just debug on the other machine, but it's a bit baffling.

Also, the source file in question includes a bunch of Mach headers, so it's possible that there's something making the preprocessor unhappy.

-Steve

At 10:30 AM -0500 12/4/07, Steve Sisak wrote:
Xcode 2.4.1, Mac OS X 10.4.10, Mac Pro (Intel)

I'm attempting to debug an application and when I step into a particular function, the Xcode debugger is showing <MacMemory.h> instead of the source file that I'm attempting to debug.

The register values are there, and the PC marker advances through the file as I step so debugging info should be there -- it's just showing me the wrong file.

I've tried:

  1) Quitting and relaunching Xcode (to clear caches)
  2) Rebuilding the project index
  3) Deleting the .pbxuser and .mode1 files from the pacage bundle
  4) Removing and re-adding the files to the project

I believe that this happened once before, but can't remember how I fixed it.


1) There are no caches that pertain here.  Unlike CodeWarrior, Xcode writes everything it cares about to disk and doesn't retain very much state, except for the dependency graph.  

2) The project index has nothing to do with debugging.  Rebuilding it will have no effect.

3) The .pbxuser and .mode1 files only affect user interface geometry and your per-user breakpoints.  I doubt they're involved. 

4) Removing and re-adding files to the project won't affect this, as the debugger doesn't use the project file at all.

What the debugger does use is the debugging information, which could be in one of two places: built into the binary or aside in a .dSym file.  I expect there's one of two problems: either you're still using STABS debug format, which sucks and is buggy, or you're using DWARF with dSym and your binary was rebuilt but your .dSym file was not.  

I suspect the second case because moving the project to a different machine (which I assume involved rebuilding it clean) would have rebuilt the .dSym file to get it in synch with the binary, et voila.

In all likelihood the root problem is that the binary has code at different offsets than are recorded in the .dSym file.  gdb is thinking you're stepping through a portion of your code that is composed of expansions of inlined routines defined in MacMemory.h, and that's why you're seeing it.

Chris
 _______________________________________________
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: Xcode Debugger Showing Wrong File
      • From: Jim Ingham <email@hidden>
References: 
 >Xcode Debugger Showing Wrong File (From: Steve Sisak <email@hidden>)
 >Re: Xcode Debugger Showing Wrong File (From: Steve Sisak <email@hidden>)

  • Prev by Date: Re: Since Xcode 3.0, ld insists on linking CoreData.framework
  • Next by Date: Xcode 3.0 - debugging custom executable
  • Previous by thread: Re: Xcode Debugger Showing Wrong File
  • Next by thread: Re: Xcode Debugger Showing Wrong File
  • Index(es):
    • Date
    • Thread