diff options
| author | yukang <moorekang@gmail.com> | 2022-08-10 19:21:03 +0800 |
|---|---|---|
| committer | Joshua Nelson <github@jyn.dev> | 2022-08-10 09:23:51 -0500 |
| commit | acda23e85b7c38d9cac473f7c8f9af29617d180d (patch) | |
| tree | 0af7b4c7dd6715a6967014f7ad0e1ef9cabd816e /src/doc | |
| parent | a5fe677985c91944a15d9c6e292789d7db4ab8d5 (diff) | |
add gdb tips for symbol-mangling-version
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/compiler-debugging.md | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/doc/rustc-dev-guide/src/compiler-debugging.md b/src/doc/rustc-dev-guide/src/compiler-debugging.md index 8f46e896eb3..e29c0c9ef5f 100644 --- a/src/doc/rustc-dev-guide/src/compiler-debugging.md +++ b/src/doc/rustc-dev-guide/src/compiler-debugging.md @@ -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 +# WANRING: this will cost a lot of disk space (about 35GB) and compiling 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 |
