Skip to content

Commit af80d31

Browse files
chenyukangjyn514
authored andcommitted
add gdb tips for symbol-mangling-version
1 parent f979af6 commit af80d31

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Diff for: src/compiler-debugging.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,29 @@ set `debug = true` in your config.toml.
1616

1717
Setting `debug = true` turns on many different debug options (e.g., `debug-assertions`,
1818
`debug-logging`, etc.) which can be individually tweaked if you want to, but many people
19-
simply set `debug = true`. Check out the comments in config.toml.example for more info.
19+
simply set `debug = true`.
2020

21-
You will need to rebuild the compiler once you've changed any configuration options.
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+
40+
Check out the comments in config.toml.example for more info, you will need to rebuild the
41+
compiler once you've changed any configuration options.
2242

2343
## `-Z` flags
2444

0 commit comments

Comments
 (0)