Problem with gdb skipping lines
Problem with gdb skipping lines
- Subject: Problem with gdb skipping lines
- From: Laurent Daudelin <email@hidden>
- Date: Thu, 14 Apr 2011 15:17:02 -0700
This one has me stumped.
When stepping over Obj-C code, line by line, all of a sudden, gdb starts skipping lines for no apparent reason. Some data formatters also report "<value temporarily unavailable, due to optimizations>". I thought I was building and stripping debug info but I double-checked that the active config is Debug and that GCC_OPTIMIZATION_LEVEL is set to 0 (none). GCC is 4.2, btw.
So, how to explain that? I have condition that tests for a nil pointer and gdb seems to fly past it and jumps 5 or 6 lines ahead with complete disregards for that condition or doesn't seem to follow return and break instructions either. Given the following code:
NSFileHandle *inflatedFile = [[NSFileHandle zk_newFileHandleForWritingAtPath:path] autorelease];
if (inflatedFile == NULL)
{
/* Problem creating a file handle. File is DRM'd? */
return zkFailed;
}
if (inflatedFile != NULL)
{
NSAutoreleasePool *pool = [NSAutoreleasePool new];
do {
[inflatedFile writeData:deflatedData];
bytesWritten += bytesRead;
gdb will step to the "do" line without any consideration for the condition if (inflatedFile == NULL).
I must be missing something obvious but I can't see it. Anyone?
Thanks!
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/
Logiciels Nemesys Software 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