Re: Debugger Printing Wrong Variable's Value
Re: Debugger Printing Wrong Variable's Value
- Subject: Re: Debugger Printing Wrong Variable's Value
- From: Jim Ingham <email@hidden>
- Date: Tue, 24 May 2011 10:27:46 -0700
gdb has a command "info address <SYMBOL>" that will tell you where the debugger thinks a given symbol lives. So for instance:
(gdb) info address self
Symbol "self" is at offset -136 from the frame base pointer.
When you get into the state you are mentioning, you can check out where the debugger thinks these variables actually live. If you can read assembly code, you can double-check whether these locations make sense, and then if they do indeed contain the values the debugger is reporting. If you see something like two variables reporting the same location, or reporting a location that doesn't make sense given the assembly code in your function, then that is probably a bug in the debug information. If you know the .o file that contains the function you are currently debugging, and don't mind sending us that .o file along with the Xcode-gdb log that Joar described how to produce, we can take a look and see if the debug info is indeed off.
Jim
On May 24, 2011, at 1:59 AM, Jean-Denis Muys wrote:
>
> On 23 mai 2011, at 22:43, Seth Willits wrote:
>
>>
>> Somehow when I print any variable in gdb, it's giving me a different variable's value. It's like the symbol list is off by one. Anyone ever seen this before? Valgrind doesn't show me smashing any memory and I know I'm not anyway ;-) I've cleaned and rebuilt, I've used both DWARF and Stabs...
>
> Yes I have seen this. Needless to say this is infuriating. The last thing you need, is your development tools lying to you.
>
> It's all the more frustrating that:
>
> - I haven't been able to identify how to trigger this misbehavior so I can file a bug report
> - I haven't been able to identify clearly how to convince the debugger to stop smoking whatever herb it decided to get high on
>
> What I did is to trash all the temporary stuff I could find, especially the project/workspace intermediate products directory.
>
> Jean-Denis
>
>
>
> _______________________________________________
> 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
_______________________________________________
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