Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for aarch64-pc-windows-msvc #61

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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