It is possible. You can take a look at https://github.com/facebook/atosl
I got it working under Linux. (Ubuntu Server) However, it takes some time to get it up and running.
Installing atosl
First, you need to install libdwarf-dev
, dwarfdump
, binutils-dev
and libiberty-dev
.
E.g. on Ubuntu:
$ sudo apt-get install libdwarf-dev dwarfdump binutils-dev libiberty-dev
Download or clone the atosl repo from GitHub:
$ git clone https://github.com/facebook/atosl.git
CD to the atosl dir
$ cd atosl
Create a local config config.mk.local
which contains a flag with the location of your binutil apps. (in Ubuntu by default that's /usr/bin
). If you're not sure, you can find out by executing cat /var/lib/dpkg/info/binutils.list | less
and copy the path of the file objdump
. E.g. if the entry is /usr/bin/objdump
, your path is /usr/bin
.
So in the end, your config.mk.local
should look like this:
LDFLAGS += -L/usr/bin
Compile it:
$ make
Now you can start using it:
$ ./atosl --help
Symbolicating example
To show how atosl
is used, I'll provide a simple example.
Now let's take a look at a line from the crash log:
13 ErrorApp 0x000ea294 0xe3000 + 29332
To symbolicate this, we will need the load address
, and the runtime address
.
In this example the runtime address
is 0x000ea294
, and the load address
is 0xe3000
.
Now we have everything we need:
$ ./atosl -o [YOUR_dSYM_FILE] -l [LOAD_ADDRESS] [RUNTIME_ADDRESS]
In this example:
$ ./atosl -o ErrorApp.app.dSYM/Contents/Resources/DWARF/ErrorApp -l 0xe3000 0x000ea294
Which returns the symbolicated line:
main (in ErrorApp) (main.m:16)
FYI
Your vmaddr
, which usually is 0x00001000
, you can find by looking at the segname __TEXT
Mach-O load command of your binary. In my example, this happens to be different, namely 0x00004000
To find the address
, we need to do some math.
The address
is found by the following formula:
address = vmaddr + ( runtime_address - load_address )
In this example our address is:
0x00004000 + ( 0x000ea294 - 0xe3000 ) = 0xB294
I haven't played around with this that much yet, but for now it seems to give me the results I needed. Maybe it will work for you too.