Re: Xcode Debugger Showing Wrong File
Re: Xcode Debugger Showing Wrong File
- Subject: Re: Xcode Debugger Showing Wrong File
- From: Jim Ingham <email@hidden>
- Date: Thu, 6 Dec 2007 11:31:40 -0800
On Dec 6, 2007, at 9:48 AM, Chris Espinosa wrote:
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.
dSYM and binary mismatch is not likely to be the problem. When the
linker builds a binary, it writes a unique identifier (UUID) into the
binary. When dsymutil makes the dSYM file from the binary, it copies
that UUID into the dSYM file. The debugger checks the two UUID's, and
if they don't match, then it doesn't use the dSYM file. You'll also
get a warning from the debugger telling you this:
warning: UUID mismatch detected between:
/private/tmp/main
/private/tmp/main.dSYM/Contents/Resources/DWARF/main...
If you want to check this yourself, BTW, you can use
"dwarfdump --uuid <BINARY>"
and
"dwarfdump --uuid <BINARY>.dSYM/Contents/Resources/DWARF/<BINARY>"
Either you are using stabs, in which case you will be much happier if
you switch to using DWARF, or if you are using DWARF, there is
probably something wrong with the line table. If I understand your
note aright, you saw the problem on Intel but not on PPC. That is
consistent with it being a line table problem, since the line tables
for different architectures are going to be totally different.
If you are using DWARF and want to chase this down further, please
file a bug. If you don't mind putting the .o file that contains the
code which is causing the problem in the RADAR, then please do that
and tell us where in that code you were seeing the problem. Then we
can take a look at the line table and see if gdb's reading it
correctly (in which case this may be a compiler issue) or if it's a
gdb issue. Even if you don't want to give us the .o file still file
the bug. We can walk you though using dwarfdump to print out the line
tables in a way that will reveal very little about your code...
Thanks,
Jim
_______________________________________________
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