rust-lang / backtrace-rs

Backtraces in Rust
https://docs.rs/backtrace
Other
524 stars 240 forks source link

Build errors on a Windows ARM32 target since c1464fa #572

Closed kleisauke closed 9 months ago

kleisauke commented 9 months ago

Since commit c1464fadd7c870c87818b86b6161ee188be6f3a4, I'm getting the following build errors on a custom armv7-pc-windows-gnullvm target:

Details ``` error[E0609]: no field `Eip` on type `backtrace_rs::windows::CONTEXT` --> /data/mxe/usr/x86_64-pc-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/dbghelp.rs:170:54 | 170 | stack_frame_ex.AddrPC.Offset = context.0.Eip as u64; | ^^^ unknown field | = note: available fields are: `ContextFlags`, `R0`, `R1`, `R2`, `R3` ... and 21 others error[E0609]: no field `Esp` on type `backtrace_rs::windows::CONTEXT` --> /data/mxe/usr/x86_64-pc-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/dbghelp.rs:172:57 | 172 | stack_frame_ex.AddrStack.Offset = context.0.Esp as u64; | ^^^ unknown field | = note: available fields are: `ContextFlags`, `R0`, `R1`, `R2`, `R3` ... and 21 others error[E0609]: no field `Ebp` on type `backtrace_rs::windows::CONTEXT` --> /data/mxe/usr/x86_64-pc-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/dbghelp.rs:174:57 | 174 | stack_frame_ex.AddrFrame.Offset = context.0.Ebp as u64; | ^^^ unknown field | = note: available fields are: `ContextFlags`, `R0`, `R1`, `R2`, `R3` ... and 21 others error[E0609]: no field `Eip` on type `backtrace_rs::windows::CONTEXT` --> /data/mxe/usr/x86_64-pc-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/dbghelp.rs:208:53 | 208 | stack_frame64.AddrPC.Offset = context.0.Eip as u64; | ^^^ unknown field | = note: available fields are: `ContextFlags`, `R0`, `R1`, `R2`, `R3` ... and 21 others error[E0609]: no field `Esp` on type `backtrace_rs::windows::CONTEXT` --> /data/mxe/usr/x86_64-pc-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/dbghelp.rs:210:56 | 210 | stack_frame64.AddrStack.Offset = context.0.Esp as u64; | ^^^ unknown field | = note: available fields are: `ContextFlags`, `R0`, `R1`, `R2`, `R3` ... and 21 others error[E0609]: no field `Ebp` on type `backtrace_rs::windows::CONTEXT` --> /data/mxe/usr/x86_64-pc-linux-gnu/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/dbghelp.rs:212:56 | 212 | stack_frame64.AddrFrame.Offset = context.0.Ebp as u64; | ^^^ unknown field | = note: available fields are: `ContextFlags`, `R0`, `R1`, `R2`, `R3` ... and 21 others ```

Looking at these logs, I think this also affects the thumbv7a-pc-windows-msvc and thumbv7a-uwp-windows-msvc targets. However, since no one's actively working on these targets^1 and the fact that is untested/unsupported territory^2, feel free to close this as invalid.

ChrisDenton commented 9 months ago

Thanks for the report! While support for Windows 32-bit arm is ambiguous at best, we'd certainly accept patches to fix small issues. In this case I think it should just be a matter of using Sp, Pc and Lr for arm in src/backtrace/dbghelp.rs.

kleisauke commented 9 months ago

Great! I just opened PR #573 for this.