symbols are already in .exe, why do you need .dSYM?

Trying to figure out some confusing bugs and the manual resymbolication process...


Unwinding the app package as sent to the app store (well, test flight), i see .symbol files, and if i run the MacOS nm command on

the executable, I see symbols in the .exe...so why does one need the complicated .dSYM, resymbolication process?


examplepartial nm output from the exe:


00000001001452f0 d _vidcalibrate:.first

0000000100146218 b _vidcalibrate:.origTransform

00000001001452ec d _vidcalibrateX:.first

00000001001461e8 b _vidcalibrateX:.origTransform

00000001099dd718 b _viewDidLoad.alreadyPutMessage

00000001001458a8 b _viewDidLoad.tv

00000001001453cc d _viewWillAppear:.first

00000001001452f8 d _viewWillAppear:.once


00000001001452f4 d _viewWillAppear:.once0

Is the .dSYM baggage needed to get to the proper line numbers or something?


so you can see in the app package, there is a Payload dir and a Symbols dir:


anyone know where the doc is for these .symbols file...does this come from llvm?


ls -ltra *

-rw-r--r-- 1 aa staff 20521482 Jan 10 15:20 APPNAME.ipa

Payload:

total 0

drwxr-xr-x 3 aa staff 102 Jan 10 15:20 .

drwxr-xr-x 259 aa staff 8806 Jan 10 15:20 APPNAME.app

drwxr-xr-x 5 aa staff 170 Jan 10 15:21 ..

Symbols:

total 5576

-rw-r--r-- 1 aa staff 1440288 Jan 10 15:20 F22D108A-95D0-316D-B466-E638485AC913.symbols

-rw-r--r-- 1 aa staff 1411832 Jan 10 15:20 C306780B-40FB-3ED6-848F-9379B3B1B652.symbols

"Is the .dSYM baggage needed to get to the proper line numbers or something?"


Yes. Because there are enough other factors involved (compiler versions, optimization settings, etc.) that the translation from addresses inside a method to line numbers wouldn't be deterministic without a symbol map.


You can find documentation for dSym and the related stuff on the LLVM pages, but I don't know whether that's "We're documenting this after figuring it out or being told what it is, so we know what the heck we're doing in the future", "We're making this up", or a combination of the two. As software, it's probably a bit of both. 🙂


lldb.llvm.org/symbols.html


Edit: When dealing with debugging, do also keep in mind that there's an option to strip debugging symbols from executables. So were you running nm on the binary with debugging symbols; or with only the necessary symbols needed to interact with the Objective-C runtime, linker, and loader?

symbols are already in .exe, why do you need .dSYM?
 
 
Q