Skip to content

Commit

Permalink
Enable support for Windows/AArch64
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielesvelto committed Oct 26, 2022
1 parent 18d57a8 commit 313842b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fn write_minidump(crash_context: crash_context::CrashContext) {
`x86_64` | ✅ | ✅ | ⚠️ | ✅ | ✅ | ⭕️ |
`i686` | ✅ | ✅ | ❌ | ⚠️ | ❌ | ❌ | ⭕️ |
`arm` | ⚠️ | ⚠️ | ⚠️ | ⭕️ | ❌ | ❌ |
`aarch64` | ⚠️ | ⚠️ | ⚠️ | ⭕️ | ✅ | ⭕️ |
`aarch64` | ⚠️ | ⚠️ | ⚠️ | | ✅ | ⭕️ |
`mips` | ⭕️ | ⭕️ | ❌ | ❌ | ❌ | ❌ |
`mips64` | ⭕️ | ⭕️ | ❌ | ❌ | ❌ | ❌ |
`powerpc` | ⭕️ | ⭕️ | ❌ | ❌ | ❌ | ❌ |
Expand Down
18 changes: 16 additions & 2 deletions tests/windows_minidump_writer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![cfg(all(target_os = "windows", target_arch = "x86_64"))]
#![cfg(all(target_os = "windows"))]

use cfg_if;
use minidump::{
CrashReason, Minidump, MinidumpBreakpadInfo, MinidumpMemoryList, MinidumpSystemInfo,
MinidumpThreadList,
Expand All @@ -17,6 +18,18 @@ extern "system" {
pub(crate) fn GetCurrentThreadId() -> u32;
}

fn get_target_cpu() -> minidump::system_info::Cpu {
cfg_if::cfg_if! {
if #[cfg(target_arch = "aarch64")] {
minidump::system_info::Cpu::Arm64
} else if #[cfg(target_arch = "x86")] {
minidump::system_info::Cpu::X86
} else if #[cfg(target_arch = "x86_64")] {
minidump::system_info::Cpu::X86_64
}
}
}

fn get_crash_reason<'a, T: std::ops::Deref<Target = [u8]> + 'a>(
md: &Minidump<'a, T>,
) -> CrashReason {
Expand All @@ -25,7 +38,8 @@ fn get_crash_reason<'a, T: std::ops::Deref<Target = [u8]> + 'a>(

exc.get_crash_reason(
minidump::system_info::Os::Windows,
minidump::system_info::Cpu::X86_64,
// This is currently ignored, but it might be used in the future
get_target_cpu(),
)
}

Expand Down

0 comments on commit 313842b

Please sign in to comment.