From c9b87ac4b306cf43ca6e46defb91267fe257e45b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 17 Feb 2020 21:44:32 +0100 Subject: [PATCH 1/2] Don't eliminate frame pointers on thumb targets --- src/librustc_target/spec/thumb_base.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc_target/spec/thumb_base.rs b/src/librustc_target/spec/thumb_base.rs index 204f4723b70..6ab6fcb58bd 100644 --- a/src/librustc_target/spec/thumb_base.rs +++ b/src/librustc_target/spec/thumb_base.rs @@ -50,6 +50,9 @@ pub fn opts() -> TargetOptions { // until we figure a way to add the pretty printers without requiring a volatile load cf. // rust-lang/rust#44993. emit_debug_gdb_scripts: false, + // LLVM is eager to trash the link register when calling `nounwind` functions, which + // breaks debugging. Preserve LR by default to prevent that from happening. + eliminate_frame_pointer: false, ..Default::default() } } From 27cfb2b9c2baacc7110cd73a96d0989b73e2a597 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 18 Feb 2020 00:00:06 +0100 Subject: [PATCH 2/2] Fix typo --- src/librustc_target/spec/thumb_base.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_target/spec/thumb_base.rs b/src/librustc_target/spec/thumb_base.rs index 6ab6fcb58bd..99ab996be95 100644 --- a/src/librustc_target/spec/thumb_base.rs +++ b/src/librustc_target/spec/thumb_base.rs @@ -50,7 +50,7 @@ pub fn opts() -> TargetOptions { // until we figure a way to add the pretty printers without requiring a volatile load cf. // rust-lang/rust#44993. emit_debug_gdb_scripts: false, - // LLVM is eager to trash the link register when calling `nounwind` functions, which + // LLVM is eager to trash the link register when calling `noreturn` functions, which // breaks debugging. Preserve LR by default to prevent that from happening. eliminate_frame_pointer: false, ..Default::default()