Skip to content

Commit

Permalink
Fixup x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Apr 20, 2022
1 parent 3b02f16 commit 84612ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/mac/mach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/mac/streams/system_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions src/mac/streams/thread_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 84612ba

Please sign in to comment.