atos(1) | General Commands Manual | atos(1) |
atos
— convert
numeric addresses to symbols of binary images or processes
atos |
[-o
<binary-image-file> |
<dSYM>] [-p
<pid> |
<partial-executable-name>]
[-arch architecture]
[-l <load-address>]
[-s <slide>]
[-offset ] [-printHeader ]
[-fullPath ] [-i ]
[-d <delimiter>]
[-f
<address-input-file>] [<address>
...] |
The atos
command converts numeric
addresses to their symbolic equivalents. If full debug symbol information is
available, for example in a .app.dSYM sitting beside a .app, then the output
of atos will include file name and source line number information.
The input addresses may be given in one of three ways:
-f
<address-input-file> argument to specify the
path of an input file containing whitespace-separated numeric
addresses.atos
enters an interactive mode, reading addresses from stdin.The symbols are found in either a binary image file or in a currently executing process, as specified by:
-o
<binary-image-file> |
<dSYM>-p
<pid> |
<partial-executable-name>Multiple process IDs or paths can be specified if necessary, and
the two can be mixed in any order. When working with a Mach-O binary image
file, atos
considers only addresses and symbols
defined in that binary image file, at their default locations (unless the -l
or -s option is given). When working with a running process,
atos
considers addresses and symbols defined in all
binary images currently loaded by that process, at their loaded
locations.
The following additional options are available.
-arch
architecture-l
<load-address>-s
<slide>-l
argument than to manually calculate a slide
value.-offset
-s
,
-l
or -offset.
-printHeader
atos
is invoked as part of a stackshot(1) run, for
verification of the process ID and name.-fullPath
-i
-d
<delimiter>A stripped, optimized version of Sketch was built as an x86_64 position-independent executable (PIE) into /BuildProducts/Release. Full debug symbol information is available in Sketch.app.dSYM, which sits alongside Sketch.app. When Sketch.app was run, the Sketch binary (which was built at 0x100000000) was loaded at 0x10acde000. Running 'sample Sketch' showed 3 addresses that we want to get symbol information for -- 0x10acea1d3, 0x10ace4bea, and 0x10ace4b7a.
First notice that the .dSYM is next to the .app:
% ls -1 /BuildProducts/Release/ Sketch.app Sketch.app.dSYM
Now, to symbolicate, we run atos with the
-o
flag specifying the path to the actual Sketch
executable (not the .app wrapper), the -arch
x86_64 flag, and the -l
0x10acde000 flag to specify the load address.
% atos -o /BuildProducts/Release/Sketch.app/Contents/MacOS/Sketch -arch x86_64 -l 0x10acde000 0x10acea1d3 0x10ace4bea 0x10ace4b7a -[SKTGraphicView drawRect:] (in Sketch) (SKTGraphicView.m:445) -[SKTGraphic drawHandlesInView:] (in Sketch) (NSGeometry.h:110) -[SKTGraphic drawHandleInView:atPoint:] (in Sketch) (SKTGraphic.m:490)
The same goal can be achieved by running atos with the dSYM:
% atos -o /BuildProducts/Release/Sketch.app.dSYM -arch x86_64 -l 0x10acde000 0x10acea1d3 0x10ace4bea 0x10ace4b7a -[SKTGraphicView drawRect:] (in Sketch) (SKTGraphicView.m:445) -[SKTGraphic drawHandlesInView:] (in Sketch) (NSGeometry.h:110) -[SKTGraphic drawHandleInView:atPoint:] (in Sketch) (SKTGraphic.m:490)
It is possible to get symbols for addresses from a different
machine architecture than the system on which atos
is running. For example, when running atos
on an
Intel-based system, one may wish to get the symbol for an address that came
from a backtrace of a process running on an ARM device. To do so, use the
-arch
flag to specify the desired architecture (such
as i386 or arm) and pass in a corresponding symbol-rich Mach-O binary image
file with a binary image of the corresponding architecture (such as a
Universal Binary).
May 9, 2017 | Mac OS X 12 |