Re: Debugger Printing Wrong Variable's Value
Re: Debugger Printing Wrong Variable's Value
- Subject: Re: Debugger Printing Wrong Variable's Value
- From: Jean-Denis Muys <email@hidden>
- Date: Wed, 25 May 2011 07:19:40 +0000
- Thread-topic: Debugger Printing Wrong Variable's Value
As I posted on the dev forums, I even had the debugger report the same address for 'self' and for another parameter of the current method. With no one there suggesting anything I didn't file a bug report. Thanks to Joar and your suggestions, I now have an idea of what information to gather to file a bug report should that happen again.
Let me reiterate though: I voiced my frustration about several serious shortcomings of Xcode 4 (windowing model, missing features, you name them). But *none* of them is even comparable to that. As a developer, I can live with Xcode crashing. I *cannot* live with a debugger I cannot trust. This should be your (Apple) number one priority. Elevate those bug reports to highest priority, take your best engineers, [re]do a 100% code review of everything debugger-related. I can't overstress that enough: the debugger must be rock solid.
I will report any bug I find using your suggestions, even though I tend to report bugs less and less, out of discouragement from the apparent uselessness of doing so. But this is another issue for another rant. Let me just say I am not alone.
Jean-Denis
On 24 mai 2011, at 19:27, Jim Ingham wrote:
> 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