We have actually finished all initial jobs, so we can come down to the real work. And for this, we utilize our great old relied on good friend, the command line. We have a command made specifically for this function. It is called atos
and it transforms hexadecimal addresses into function names and line numbers.
Let’s see how to utilize it and what specifications we can pass in by typing the following in the command line:
atos -h
We get the following information:
Use: atos [-p pid] [-o executable] [-f file] [-s slide | -l loadAddress] [-arch architecture] [-printHeader] [-fullPath] [address …]
Out of all these possible specifications, we will just input the following 4: architecture
, executable
, load address
, and address
Let’s start with architecture
In your crash log, scroll down to the “Binary Images” area.
We discover the binary architecture beside the binary image name. In our case, it is arm64.
For executable
, we pass in the following course:
<< PathToDSYMFile>>/ Contents/Resources/DWARF/<< BinaryName>>
We discover the load address
at the start of the binary image we symbolicate. As you can see in the image above, for me, it is 0x100bb0000
The last criterion is the address
, which is the memory address of the frame. You can see this on the 2nd image in this short article if you scroll back to the part where I discussed frames in the thread backtraces. For frame # 5, for instance, the address
is 0x0000000100bb6080
If you wish to symbolicate several frames, you do not need to call the command several times. Simply pass in all addresses separated by a comma.
Here is our magic formula in one piece:
atos -arch << Binary Architecture> > -o << Course to dSYM file>>/ Contents/Resources/DWARF/<< binary image name> > -l << load address> <> < address to symbolicate>>
And the real execution for our present example:
atos -arch arm64 -o dSYMs/D1ABC7F3-E 81D-3264-- 847E-4FB2578B43DD. dSYM/Contents/Resources/ DWARF/CrashLogExample -l 0x100bb0000 0x0000000100bb6080
Now you ideally see function names and line numbers in the console. If so, your work here is done and you can proceed with debugging. On the other hand, if you see things like _ concealed # 710 _
in the console output, then please kept reading.
This is since you made it possible for bitcode when you exported the ipa
declare circulation from the archive. There is no requirement to fret, nevertheless, since we just require one extra action to lastly get to some beneficial details from our crash log.
This last piece of the puzzle is called a sign map, which is an extra file that is created by Xcode throughout the procedure of archiving the app. With the aid of a sign map, we have the ability to bring back the obfuscated dSYM file.
The command we require for this is called dsymutil
If we inspect what it carries out in the terminal, we see this:
SUMMARY: control archived DWARF debug sign files. dsymutil links the DWARF debug details discovered in the things apply for the executable << input file> > by utilizing debug signs details included in its sign table.
The method we utilize the command:
dsymutil -symbol-map << course to BCSymbolMaps> <> < course to dSYM file>>
Using it to our present example:
dsymutil -symbol-map CrashLogExample.xcarchive/ BCSymbolMaps dSYMs/D1ABC7F3-E 81D-3264-- 847E-4FB2578B43DD. dSYM
If you run the atos
command once again, you must lastly see the involved function names and line numbers in the console.