Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gdb tips for symbol-mangling-version #1417

Merged
merged 2 commits into from
Aug 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/compiler-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,29 @@ set `debug = true` in your config.toml.

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

You will need to rebuild the compiler once you've changed any configuration options.
If you want to use GDB to debug rustc, please set `config.toml` with options:

```toml
[rust]
debug = true
debuginfo-level = 2
# WARNING: this will use a lot of disk space (about 35GB) and compile time.
# Without debuginfo-level, you may also track the execution path, but lost
# the symbol information for debugging.
```

Default configuration will enable `symbol-mangling-version` v0, you need to install a GDB
with version higher than 10.2, otherwise you need to disable new symbol-mangling-version.

```toml
[rust]
new-symbol-mangling = false
```

Check out the comments in config.toml.example for more info, you will need to rebuild the
compiler once you've changed any configuration options.

## `-Z` flags

Expand Down