Skip to content

Commit d730b5f

Browse files
committed
Update debug info user docs
1 parent a26e4d6 commit d730b5f

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

docs/guide/types/debuginfo.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,54 @@
11
# Debug Info
22

3-
Debug Info is a mechanism for importing types, function signatures, and data variables from either the original binary (e.g. an ELF compiled with DWARF) or a supplemental file (e.g. a PDB).
3+
Debug Info is a mechanism for importing types, function signatures, data variables, and more from either the original binary (e.g. an ELF compiled with debug info) or a supplemental file (e.g. a PDB or .debug file).
44

5-
Currently, debug info plugins are limited to types, function signatures, and data variables, but in the future will include line number information, comments, local variables, and possibly more.
5+
Currently, debug info plugins are limited to applying types, function signatures, data variables, and local stack variables, but in the future will include line number information, comments, and possibly more.
66

7-
## Supported Debug Info
7+
## Supported Formats
88

99
We currently support [PDBs](https://github.com/Vector35/binaryninja-api/tree/dev/plugins/pdb-ng) and [DWARF](https://github.com/Vector35/binaryninja-api/tree/dev/plugins/dwarf/dwarf_import) (which are both open source), though you can also [register your own debug info parser through the API](https://api.binary.ninja/binaryninja.debuginfo-module.html#binaryninja.debuginfo.DebugInfoParser).
1010

11-
For PDBs, Binary Ninja will automatically try to source from specified local folders and Microsoft's symbol server ([see the PDB settings for more information](../settings.md#settings-reference)).
11+
Binary Ninja will automatically try to access relevant PDBs from specified local folders and Microsoft's symbol server (see the [PDB settings](../settings.md#settings-reference) for more information).
1212

13-
DWARF supports information compiled in to ELF binaries, information from external ELF files (`.dwo`, `.debug`, etc.), information compiled in to Mach-O's, and information from external `.dSYM` files as well. Support for DWARF information in PEs is [planned](https://github.com/Vector35/binaryninja-api/issues/1555).
13+
Binary Ninja's DWARF loader supports loading information compiled into binaries, information from external files (`.dwo`, `.debug`, etc.), and information from external `.dSYM` files as well.
1414

1515
## Applying Debug Info
1616

17-
Debug Info is automatically applied by default if applicable.
17+
Debug Info is automatically applied by default if available.
1818

1919
![Import Debug Info >](../../img/import-debug-info.png "Import Debug Info"){ width="300" }
2020

21-
However, for some file formats, you may wish to specify an external source of Debug Info using the `Import Debug Info from External File` menu option under `Analysis`.
21+
However, for some file formats, you may wish to specify an external source of Debug Info using the `Analysis/Import Debug Info from External File` menu option.
2222

2323
## Blocking Debug Info
2424

25-
You can control if debug information is imported for a file by changing the setting "Import Debug Information" ([`analysis.debugInfo.internal`](https://docs.binary.ninja/guide/settings.html#analysis.debugInfo.internal)). You can import debug information at any point later by using the menu action `Analysis` -> `Import Debug Info`.
25+
You can control if debug information is imported for a file by changing the setting [`analysis.debugInfo.internal`](https://docs.binary.ninja/guide/settings.html#analysis.debugInfo.internal). You can import debug information at any point later by using the menu action `Analysis/Import Debug Info`.
2626

27-
### PDB Notes
27+
## PDB Notes
2828

29-
PDBs will make a best effort to find relevant debug info and apply it when you open a binary. Some PDBs can be very large and take a significant amount of time to parse. When you open a large PDB, you'll see a progress indicator in the status bar at the bottom of the application.
29+
Binary Ninja will make a best effort to find relevant PDBs and apply debug info from them when you open a binary. Some PDBs can be very large and take a significant amount of time to process. When you open a file with a large PDB, you'll see a progress indicator in the status bar at the bottom of the application.
3030

31-
### DWARF Notes
31+
## DWARF Notes
3232

33-
DWARF information is imported from files that contain DWARF sections. Currently, Binary Ninja will not search local or remote locations to attempt to find the associated DWARF information for you. If you have separate DWARF info, you'll need to import that from an external file.
33+
DWARF information is imported from files that contain DWARF sections. Binary Ninja can automatically locate and load separate DWARF information through several methods:
3434

35-
#### DWARF Import Limitations
35+
- **Debuginfod servers**: If [`network.enableDebuginfod`](https://docs.binary.ninja/guide/settings.html#network.enableDebuginfod) is enabled, Binary Ninja will query the [debuginfod](https://developers.redhat.com/blog/2019/10/14/introducing-debuginfod-the-elfutils-debuginfo-server) servers configured in [`network.debuginfodServers`](https://docs.binary.ninja/guide/settings.html#network.debuginfodServers)
36+
- **Sibling debug files**: If [`analysis.debugInfo.loadSiblingDebugFiles`](https://docs.binary.ninja/guide/settings.html#analysis.debugInfo.loadSiblingDebugFiles) is enabled, Binary Ninja will look for files of the form `<filename>.debug` and `<filename>.dSYM` in the same directory as the binary
37+
- **Debug directories**: Binary Ninja will search the directories specified in [`analysis.debugInfo.debugDirectories`](https://docs.binary.ninja/guide/settings.html#analysis.debugInfo.debugDirectories) for debug files stored by the binary's build ID
38+
39+
If automatic loading does not succeed, you can still manually import debug info from an external file using the `Analysis/Import Debug Info from External File` menu option.
40+
41+
### DWARF Import Limitations
3642

3743
[DWARF version 5](https://dwarfstd.org/dwarf5std.html) is mostly backwards compatible with DWARF version 4, which we originally targeted with our DWARF import plugin, with the caveats described in [this issue](https://github.com/Vector35/binaryninja-api/issues/5423).
3844

3945
Components are supported by the API, but not in the parser. The [same issue](https://github.com/Vector35/binaryninja-api/issues/5423) as above would also allow us to support components more easily as well.
4046

41-
#### DWARF Export Limitations
47+
### DWARF Export Limitations
4248

4349
Our [DWARF Export plugin](https://github.com/Vector35/binaryninja-api/tree/dev/plugins/dwarf/dwarf_export) is also open source and uses a different system from our debug information import plugins. It also does not support function-local variable names or types. The export plugin currently will export the global variables, function prototypes, and all the types in your binary view except for ones that are `FunctionTypeClass` or `VarArgsTypeClass`.
4450

45-
#### Special Note for `.dSYM` Files
51+
### Special Note for `.dSYM` Files
4652

4753
Binary Ninja will automatically load `.dSYM` files given the following:
4854

0 commit comments

Comments
 (0)