diff options
| author | kennytm <kennytm@gmail.com> | 2019-01-05 23:56:47 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-05 23:56:47 +0800 |
| commit | dd3e27357d47c4a983d40e19539e3abee22c532d (patch) | |
| tree | 7327f773d75913b5ea78ae257cb70ff92c33f0fd /src/libstd | |
| parent | 3d8e5d40c5cd63b59ab12cf96bae40fdaa03927a (diff) | |
| parent | f4826abf6d04d3c468e37c3e7b670d35030ef0e0 (diff) | |
| download | rust-dd3e27357d47c4a983d40e19539e3abee22c532d.tar.gz rust-dd3e27357d47c4a983d40e19539e3abee22c532d.zip | |
Rollup merge of #57238 - Zoxc:bt-fix, r=alexcrichton
Fix backtraces for inlined functions on Windows Fixes an regression introduced in https://github.com/rust-lang/rust/pull/50526 r? @alexcrichton
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/windows/backtrace/mod.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libstd/sys/windows/backtrace/mod.rs b/src/libstd/sys/windows/backtrace/mod.rs index a6bd8f8cc51..4bda8ac91da 100644 --- a/src/libstd/sys/windows/backtrace/mod.rs +++ b/src/libstd/sys/windows/backtrace/mod.rs @@ -103,7 +103,7 @@ fn set_frames<W: StackWalker>(StackWalk: W, frames: &mut [Frame]) -> io::Result< frames[i] = Frame { symbol_addr: addr, exact_position: addr, - inline_context: 0, + inline_context: frame.get_inline_context(), }; i += 1 @@ -209,6 +209,7 @@ trait StackFrame { fn new() -> Self; fn init(&mut self, ctx: &c::CONTEXT) -> c::DWORD; fn get_addr(&self) -> *const u8; + fn get_inline_context(&self) -> u32; } impl StackFrame for c::STACKFRAME_EX { @@ -263,6 +264,10 @@ impl StackFrame for c::STACKFRAME_EX { fn get_addr(&self) -> *const u8 { (self.AddrPC.Offset - 1) as *const u8 } + + fn get_inline_context(&self) -> u32 { + self.InlineFrameContext + } } impl StackFrame for c::STACKFRAME64 { @@ -317,6 +322,10 @@ impl StackFrame for c::STACKFRAME64 { fn get_addr(&self) -> *const u8 { (self.AddrPC.Offset - 1) as *const u8 } + + fn get_inline_context(&self) -> u32 { + 0 + } } enum StackWalkVariant { |
