From 20f1337d4a73b700d06eda72a4e209108d3bb699 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Wed, 20 Apr 2022 08:59:40 +0200 Subject: [PATCH] Fixup x86_64 --- src/mac/mach.rs | 4 ++-- src/mac/streams/system_info.rs | 2 +- src/mac/streams/thread_list.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mac/mach.rs b/src/mac/mach.rs index 651a9f7b..de5031fb 100644 --- a/src/mac/mach.rs +++ b/src/mac/mach.rs @@ -254,7 +254,7 @@ impl ThreadState { pub fn pc(&self) -> u64 { cfg_if::cfg_if! { if #[cfg(target_arch = "x86_64")] { - self.arch_state().__pc + self.arch_state().__rip } else if #[cfg(target_arch = "aarch64")] { self.arch_state().pc } @@ -266,7 +266,7 @@ impl ThreadState { pub fn sp(&self) -> u64 { cfg_if::cfg_if! { if #[cfg(target_arch = "x86_64")] { - self.arch_state().__sp + self.arch_state().__rsp } else if #[cfg(target_arch = "aarch64")] { self.arch_state().sp } diff --git a/src/mac/streams/system_info.rs b/src/mac/streams/system_info.rs index 7357f719..0fbbc030 100644 --- a/src/mac/streams/system_info.rs +++ b/src/mac/streams/system_info.rs @@ -152,7 +152,7 @@ impl MinidumpWriter { let model: u8 = mach::int_sysctl_by_name(b"machdep.cpu.model\0"); let stepping: u8 = mach::int_sysctl_by_name(b"machdep.cpu.stepping\0"); - let processor_revision: u16 = (model << 8) | stepping; + let processor_revision = ((model as u16) << 8) | stepping as u16; } else if #[cfg(target_arch = "aarch64")] { let processor_architecture = MDCPUArchitecture::PROCESSOR_ARCHITECTURE_ARM64; diff --git a/src/mac/streams/thread_list.rs b/src/mac/streams/thread_list.rs index 5306ea00..5fd2c771 100644 --- a/src/mac/streams/thread_list.rs +++ b/src/mac/streams/thread_list.rs @@ -189,9 +189,9 @@ impl MinidumpWriter { // specifies 32 bits for the flags register, we can truncate safely // with no loss. out.eflags = ts.__rflags as _; - out.cs = ts.__cs; - out.fs = ts.__fs; - out.gs = ts.__gs; + out.cs = ts.__cs as u16; + out.fs = ts.__fs as u16; + out.gs = ts.__gs as u16; } else if #[cfg(target_arch = "aarch64")] { // This is kind of a lie as we don't actually include the full float state..? out.context_flags = format::ContextFlagsArm64Old::CONTEXT_ARM64_OLD_FULL.bits() as u64;