symbols(1) | General Commands Manual | symbols(1) |
symbols
— display
symbol information about a file or process
symbols |
[-help ] [-w ]
[-uuid ] [-arch
arch_name] [-saveSignature
path] [-symbolsPackageDir
path] [-lookup
(0x1234 | symbol) ...]
[-dedup ] file... pid... process-name...
signature... dSYM... |
The symbols
command may be used to examine
library, symbol, and source line information in files and running
processes.
You may need root privileges to examine running processes.
The symbols command can be used to determine symbol availability to tools such as Instruments, dtrace, and sample.
-help
-v
-w
-uuid
-arch
arch_name-cpuType
#-cpuSubtype
#-noHeaders
-noRegions
, -noSymbols
,
and -noSources
-noRegions
-noSymbols
and
-noSources
-noSymbols
-noSources
-noSources
-noDemangling
-printSignature
-saveSignature
flag-deepSignature
-fullSourcePath
-printDsymPaths
-lookup
(0x1234 | symbol)-dedup
<deduplicated_symbol>.
Deduplicated symbols
are the result of linker optimization that unites functions with identical
instructions into one symbol, i.e. deduplicates them. The original
function variants are deduced from the Nlist.Output from symbols
has the following
format:
target [arch_name, elapsed-time]:
UUID symbol-owner-path [FLAGS]
address (size) region-name
address (size) symbol-name [FLAGS]
address (size) sourcefile : line #
Symbol owner flags have the following meanings:
Symbol flags have the following meanings:
symbols
uses multiple sources of symbol
information. All sources are queried, and the resulting data is merged.
NLIST symbol information is found in the LINKEDIT segment. It is imprecise, and only contains a starting address, not a length or ending address. Nlist data is not required to (and typically does not) reference all symbols. Usually only external symbol information is available. Even that may be removed by use of strip(1)
DEBUG MAP symbol information is multi-part. A per-symbol reference in the original file points to an external file containing additional debug information, usually DWARF.
FUNCTION STARTS symbol information is found in the LC_FUNCTION_STARTS load command of the target. It is imprecise, and only contains a starting address, not a length or ending address. Furthermore, it contains no name or mangled name information. The LC_FUNCTION_STARTS load command is optional, it may not be found in all targets.
DWARF symbol information is true debug info. It is usually precise (but it is not required to be). When available, dwarf information is treated as more reliable than any other information source, and conflicts are resolved in favor of dwarf data.
DSYM. A dSYM is an external file containing DWARF and NLIST symbol information.
Kernel symbols are available by using the special pid "-1". This includes loaded kexts.
A signature is the information needed to reconstruct symbol information at a later date. For example, a signature contains a list of libraries, and for each library a UUID and the addresses the segments were loaded at. You can also ask for a "deep" signature, which contains complete information about every piece of information symbols could find. This can be very useful for later diagnosis and exploration.
A symbols package is a directory with "deep" signatures for one or more binary images. When a directory is specified with -symbolsPackageDir, symbols will output a deep signature for each binary image slice it reads. These files contain enough information to symbolicate application stack traces (such as those generated by crash reports) with function names and file names/line numbers.
symbols
/System/Library/Frameworks/AppKit.framework/AppKit
symbols
-uuid /System/Library/Frameworks/AppKit.framework/AppKit
symbols
-arch i386
/System/Library/Frameworks/AppKit.framework/AppKit
symbols
7085
symbols
7085 -lookup 0x7fff5bf0008
symbols
Safari
symbols
-deepSignature -saveSignature /tmp/Safari.signature Safari
symbols
/tmp/Safari.signature -lookup "*alloc*"
symbols
-w -1
9/20/10 | Darwin |