rust/doc/debugging.md
ron dd1b72a0d8
Fix typos and grammar in documentation
- Readme.md: add missing "you" ("If don't" → "If you don't")
- Readme.md: fix wrong preposition ("without this backend" → "with this backend")
- Readme.md: fix double space
- doc/errors.md: fix transposed letters ("libgccijt" → "libgccjit")
- doc/debugging.md: remove extra word ("Run do the command" → "Run the command")
- doc/debugging.md: fix past participle ("cannot be ran" → "cannot be run")
- doc/tips.md: add missing verb ("won't a chance" → "won't have a chance")
- doc/gimple.md: fix preposition ("interested into" → "interested in")
2026-02-11 17:38:07 -05:00

1.3 KiB

Debugging

How to debug GCC LTO

Run the command with -v -save-temps and then extract the lto1 line from the output and run that under the debugger.

How to debug stdarch tests that cannot be run locally

First, run the tests normally:


cd build/build_sysroot/sysroot_src/library/stdarch/ STDARCH_TEST_EVERYTHING=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="sde -future -rtm_mode full --" TARGET=x86_64-unknown-linux-gnu ../../../../../y.sh cargo test

It will show the command it ran, something like this:


process didn't exit successfully: sde -future -rtm_mode full -- /home/user/projects/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/stdarch/target/debug/deps/core_arch-fd2d75f89baae5c6 (signal: 11, SIGSEGV: invalid memory reference)

Then add the -debug flag to it:


sde -debug -future -rtm_mode full -- /home/user/projects/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/stdarch/target/debug/deps/core_arch-fd2d75f89baae5c6

To see the symbols in gdb, specify the executable in your command:


gdb /home/user/projects/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/stdarch/target/debug/deps/core_arch-fd2d75f89baae5c6

and then write the gdb command that sde tells you to use, something like:


target remote :51299