about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/doc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-09-27 22:00:17 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-09-27 22:00:17 +0200
commit325b70890a4a9b4b14368cfdd87d0c161632cb30 (patch)
treee3264a25c52d21f90be467a7800b89c302c9db7e /compiler/rustc_codegen_gcc/doc
parenta3f76a26e045a760bb1163b7eab36872985242d5 (diff)
parent3187d32079b817522cc17413ec9185b130daf693 (diff)
downloadrust-325b70890a4a9b4b14368cfdd87d0c161632cb30.tar.gz
rust-325b70890a4a9b4b14368cfdd87d0c161632cb30.zip
Merge commit '3187d32079b817522cc17413ec9185b130daf693' into subtree-update
Diffstat (limited to 'compiler/rustc_codegen_gcc/doc')
-rw-r--r--compiler/rustc_codegen_gcc/doc/debugging-gcc-lto.md3
-rw-r--r--compiler/rustc_codegen_gcc/doc/debugging.md38
2 files changed, 38 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_gcc/doc/debugging-gcc-lto.md b/compiler/rustc_codegen_gcc/doc/debugging-gcc-lto.md
deleted file mode 100644
index 93b150d7686..00000000000
--- a/compiler/rustc_codegen_gcc/doc/debugging-gcc-lto.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# How to debug GCC LTO
-
-Run do the command with `-v -save-temps` and then extract the `lto1` line from the output and run that under the debugger.
diff --git a/compiler/rustc_codegen_gcc/doc/debugging.md b/compiler/rustc_codegen_gcc/doc/debugging.md
new file mode 100644
index 00000000000..6ff4edf8877
--- /dev/null
+++ b/compiler/rustc_codegen_gcc/doc/debugging.md
@@ -0,0 +1,38 @@
+# Debugging
+
+## How to debug GCC LTO
+
+Run do 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 ran 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
+----