Skip to content

Commit ce1dc01

Browse files
committed
add gdb tips for symbol-mangling-version
1 parent 5c4b673 commit ce1dc01

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/compiler-debugging.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ Setting `debug = true` turns on many different debug options (e.g., `debug-asser
1818
`debug-logging`, etc.) which can be individually tweaked if you want to, but many people
1919
simply set `debug = true`. Check out the comments in config.toml.example for more info.
2020

21+
If you want to use GDB to debug rustc, please set `config.toml` with options:
22+
23+
```toml
24+
[rust]
25+
debug = true
26+
debuginfo-level = 2
27+
# WANRING: this will cost a lot of disk space (about 35GB) and compiling time.
28+
# Without debuginfo-level, you may also track the execution path, but lost
29+
# the symbol information for debugging.
30+
```
31+
32+
Default configuration will enable `symbol-mangling-version` v0, you need to install a GDB
33+
with version higher than 10.2, otherwise you need to disable new symbol-mangling-version.
34+
35+
```toml
36+
[rust]
37+
new-symbol-mangling = false
38+
```
39+
2140
You will need to rebuild the compiler once you've changed any configuration options.
2241

2342
## `-Z` flags

0 commit comments

Comments
 (0)