about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-19 03:00:18 +0000
committerbors <bors@rust-lang.org>2023-11-19 03:00:18 +0000
commitd052f6fde6464326fb06e3d22df503e1d3cb0ae8 (patch)
tree43875562aaa9fddfeb0820a610d96cb64a208fef /compiler/rustc_codegen_gcc
parent0d3dfb529610660794b421d3b703fe44abb3ff47 (diff)
parentb576dd2b3ce9450151c1e0fa82e7377bbadc1123 (diff)
downloadrust-d052f6fde6464326fb06e3d22df503e1d3cb0ae8.tar.gz
rust-d052f6fde6464326fb06e3d22df503e1d3cb0ae8.zip
Auto merge of #117895 - mzohreva:mz/fix-sgx-backtrace, r=Mark-Simulacrum
Adjust frame IP in backtraces relative to image base for SGX target

This is followup to https://github.com/rust-lang/backtrace-rs/pull/566.

The backtraces printed by `panic!` or generated by `std::backtrace::Backtrace` in SGX target are not usable. The frame addresses need to be relative to image base address so they can be used for symbol resolution. Here's an example panic backtrace generated before this change:

```
$ cargo r --target x86_64-fortanix-unknown-sgx
...
stack backtrace:
   0:     0x7f8fe401d3a5 - <unknown>
   1:     0x7f8fe4034780 - <unknown>
   2:     0x7f8fe401c5a3 - <unknown>
   3:     0x7f8fe401d1f5 - <unknown>
   4:     0x7f8fe401e6f6 - <unknown>
```
Here's the same panic after this change:
```
$ cargo +stage1 r --target x86_64-fortanix-unknown-sgx
stack backtrace:
   0:            0x198bf - <unknown>
   1:            0x3d181 - <unknown>
   2:            0x26164 - <unknown>
   3:            0x19705 - <unknown>
   4:            0x1ef36 - <unknown>
```
cc `@jethrogb` and `@workingjubilee`
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions