Re: gdb debugger weirdness and custom data formatters
Re: gdb debugger weirdness and custom data formatters
- Subject: Re: gdb debugger weirdness and custom data formatters
- From: Jim Ingham <email@hidden>
- Date: Thu, 5 Feb 2004 17:46:17 -0800
Can you file a bug on this? The scoping information for things like
your block with x & y in it doesn't tell us when the variable gets
initialized, so we end up trying to inspect invalid data fairly often.
We usually manage to trap the errors from this, and back out if
anything bad happens. But you have clearly found a case where we
aren't catching the error. If I can watch it happen it is usually
pretty straightforward to handle it.
If you can make up a test case that compiles & shows this problem, that
would be best. Otherwise, if you can send me a copy of the binary with
debug symbols and instructions on how to run it and where to break, I
can work with that. Also, if you can do:
1) Quit Xcode.
2) In Terminal, say:
$ defaults write com.apple.Xcode PBXGDBDebuggerLogToFile YES
3) Restart Xcode, and do whatever you need to to make it fail.
4) Look in /tmp/<YOUR UID>/TemporaryItems/
There will be a file there called something like:
PBGDB-<Project Name>-<Xcode UID>
which contains the transcript of the gdb/Xcode communications. Include
this along with the bug report - it will tell me what gdb was trying to
do when it fell over...
Thanks,
Jim
On Feb 5, 2004, at 2:04 PM, Mark Lentczner wrote:
A follow up to my previous post: This seems to only occur when there
are multiple auto variables in the same function, even if they don't
have a scope conflict:
Polynomial ThingWithXandY::doThing(Func f) {
switch (f) {
case squareX: {
Polynomial x = getX();
return x*x;
}
case squareY: {
Polynomial y = getY();
return y*y;
}
case squareDist: {
Polynomial x = getX();
Polynomial y = getY(); // breakpoint here
return x*x + y*y;
}
}
return 0;
}
(I don't know that this is a minimal case yet... I just wrote this off
the top of my head to illustrate what I think is the issue... My real
code is quite a bit bigger and I haven't had the chance to pare it
down to the minimal case.)
At the breakpoint, the debugger will think is y is in scope, and try
to call the custom data formatter for Polynomial on it, sometimes
causing horrible debugger crashes. In other functions, at a similar
place, the debugger never thinks x is in scope.
It seems like the debugger (gdb or perhaps Xcode's UI) has picked one
of the 'y' variables and is associating it's in/out of scope with all
of the 'y' variables.
- Mark
Mark Lentczner
email@hidden
http://www.wheatfarm.org/
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
--
Jim Ingham email@hidden
Developer Tools
Apple Computer
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.