views:

545

answers:

2

When symbolicating crash reports, I noticed that line numbers are off. I tested this with a project in which I deliberately cause a crash. It seems the generated line number do not include certain lines, e.g. comment lines or compiler preprocessor statements (not sure what it does and does not include)...

Is there an easy way to get from the "off" line number in the symbolicated crash report to the actual line of code in the source?

Edit: An example of a line in a symbolicated crash report:

7 Luisterpaal 0x00005de2 -[SWFMP3 connection:didReceiveData:] (SWFMP3.m:320)

So, the line number 320 is almost correct, but not exactly. It's a few lines off...

+1  A: 

In a word… no. If you're looking at a line like this in a crash report:

0 com.apple.CoreFoundation 0x95cb046b CFArrayAppendValue + 43

The "+43" isn't a line number, but a memory location from the beginning of the function. The code as you wrote it simply doesn't exist in the compiled binary - the compiler optimises and changes the code (in a Release build, at least) around so it most often doesn't match what you wrote.

Unfortunately, the solution is to provide the person experiencing the crash with a debug version that you can remote debug or at least throw out NSLog() statements to help track it down, and/or write smaller methods.

iKenndac
Upvoted for "write smaller methods" :)
rpetrich
I meant the numbers of a symbolicated crash log e.g. the "320" in:7 Luisterpaal 0x00005de2 -[SWFMP3 connection:didReceiveData:] (SWFMP3.m:320)
Martijn Thé
A: 

This Technical Note shows how to relate the report to code

psychotik