Re: -[MyClass mySelector] + 99. How interpret "99"?
Re: -[MyClass mySelector] + 99. How interpret "99"?
- Subject: Re: -[MyClass mySelector] + 99. How interpret "99"?
- From: James Bucanek <email@hidden>
- Date: Sat, 17 Mar 2007 17:55:42 -0700
Jerry Krinock wrote on Saturday, March 17, 2007:
>On Mar 16 Fri 02:46:00 2007, Shawn Erickson wrote:
>
>>> When my program crashes, I sometimes get a nice console printout like:
>>>
>>> -[MyClass mySelector] + 99
>>>
>>> How can I translate this to a line number?
>>
>> <http://developer.apple.com/technotes/tn2004/tn2123.html>
>> <http://developer.apple.com/technotes/tn2004/tn2124.html>
>> man atos
>
>Shawn, these are certainly interesting documents and I learned several
>tricks, but none of them say how to translate that '99' to a line number in
>my source code. The atos program in particular gives "the symbol...whose
>corresponding range of addresses contains the specified address". I
>interpret that to mean "the function/method in which the crash occurred".
>But I believe that we can get better granularity than that.
Jerry,
The correct tool to use here is atos. Given an executable file with debug information in the DWARF or Stabs format, atos will translate any address into a symbolic location.
How "granular" that information is depends entirely on how much debug information has been imbedded in the executable.
- If the executable has been stripped of all debug symbols, atos will simply tell you that the address is in your application (or not).
- If the executable has minimal debug information, you'll get a method name and an offset. This is the same information you see in the crash log. Note that this is the default for release builds.
- If the executable has full debug information, atos will deliver a complete symbol reference including filename and line number.
For example. let's say I have an application named TempConverter. It crashes. I build a copy of TempConverter with full debug symbol information. I take the address from the traceback and run it through atos:
atos -o Debug/TempConverter.app/Contents/MacOS/TempConverter 0x00002b84
Atos will spit out:
-[ConverterApplicationDelegate setCentigradeTemperature:] (in TempConverter) (ConverterApplicationDelegate.m:42)
_______________________________________________
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