Re: -[MyClass mySelector] + 99. How interpret "99"?
Re: -[MyClass mySelector] + 99. How interpret "99"?
- Subject: Re: -[MyClass mySelector] + 99. How interpret "99"?
- From: "Shawn Erickson" <email@hidden>
- Date: Mon, 19 Mar 2007 09:07:52 -0700
On 3/17/07, Jerry Krinock <email@hidden> wrote:
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.
Some weeks ago, I was able to pinpoint the statement causing a rare crash by
adding a statement which did something stupid, causing a guaranteed crash,
compile/running it, noting the number in the crash report, then moving that
known-crash-causing statement and re-compil/running until the number in the
Crash Log was close to the number in the rare Crash Log.
But there must be a more intelligent way; obviously Apple supplies that
number to help us with this problem. How can we use it?
The best way is to run your application under the debugger and probe
the failure directly instead attempting to do what you are doing
above.
The second best thing to do is run a debug build or even a release
build of your application that contains full symbol information. That
would give you backtraces with line information either directly or by
using atos (or gdb command line info).
What we do here is build debug and release versions of our products
(and libraries) with full debug symbols using the DWARF format. We use
dsymutil to build a dSYM file for the final product binaries and then
fully strip those binaries before shipping them to customers (we want
the smallest file size possible).
We save the dSYM file so we can symbolize crash reports we get from the field.
-Shawn
_______________________________________________
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