Re: Finding assembly offset in code
Re: Finding assembly offset in code
- Subject: Re: Finding assembly offset in code
- From: email@hidden
- Date: Mon, 10 Feb 2014 13:20:28 -0800
If you are crashing in code that you have debug info for, one other trick you can sometimes take advantage of (once lldb has loaded your dSYM's) is to do:
(lldb) image lookup -av <CRASHING ADDRESS>
Among other things if there are any local variables reconstructible at that address, lldb will tell you, and if they are in registers in the crashing thread, you can look at the crash log's register dump for the crashing thread and get their value. You generally don't luck out like this. Often you crash in some system routines and without the memory from the crashing program, lldb can't unwind variables up the stack. But when you do it's another little clue that can speed up your diagnosis of the issue.
Jim
On Feb 10, 2014, at 1:11 PM, Wim Lewis <email@hidden> wrote:
>
> On 10 Feb 2014, at 12:26 PM, Mills, Steve wrote:
>> On Feb 7, 2014, at 17:34:37, Sean McBride <email@hidden> wrote:
>>> but it just gets better and better as you go. Basically, lldb has a slick 'crashlog' command! You just do:
>>>
>>> (lldb) command script import lldb.macosx.crashlog
>>> (lldb) crashlog ~/Library/Logs/DiagnosticReports/foo.crash
>>
>> OK, this is working. I guess. It basically dumps the crashlog into the debugger console (I did this from Xcode's console after running the app and pausing execution). Are there benefits to viewing the crashlog here rather than just looking at it with Console or QuickLook?
>
> In theory, lldb will use the debug symbols (the stuff in the .dSYM package) to convert that byte offset into a file+linenumber. If it isn't doing that, maybe it can't find the relevant .dSYMs. Note that, in order to reliably get line numbers for an address, you need to have kept the .dSYM for the *same build* that produced the crash --- each build gets a unique identifier for matching crashlogs up with debug symbols.
>
> You can also do this manually with the "atos" command, passing the dsym file with the -o option and possibly the framework's load address to the -l option. Using lldb should be easier though.
>
>
>
> _______________________________________________
> 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