From b1af012d67a6e12fa7e1ed16563fd0e8750609cd Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 8 May 2026 10:33:10 -0400 Subject: [PATCH] Remove references to unsupported architectures --- README.md | 4 -- src/linux/dumper_cpu_info/mod.rs | 6 +-- .../dumper_cpu_info/{x86_mips.rs => x86.rs} | 6 +-- src/linux/thread_info/mips.rs | 54 ------------------- src/linux/thread_info/mod.rs | 3 -- src/minidump_cpu.rs | 2 - src/minidump_format.rs | 5 -- tests/linux_minidump_writer.rs | 4 -- tests/ptrace_dumper.rs | 6 +-- 9 files changed, 4 insertions(+), 86 deletions(-) rename src/linux/dumper_cpu_info/{x86_mips.rs => x86.rs} (93%) delete mode 100644 src/linux/thread_info/mips.rs diff --git a/README.md b/README.md index 9c9ed9d7..95bd183c 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,3 @@ fn write_minidump(crash_context: crash_context::CrashContext) { `i686` | ✅ | ✅ | ❌ | ⭕️ | ❌ | ❌ | `arm` | ⚠️ | ⚠️ | ⚠️ | ⭕️ | ❌ | ❌ | `aarch64` | ⚠️ | ⚠️ | ⚠️ | ⭕️ | ✅ | ⭕️ | -`mips` | ⭕️ | ⭕️ | ❌ | ❌ | ❌ | ❌ | -`mips64` | ⭕️ | ⭕️ | ❌ | ❌ | ❌ | ❌ | -`powerpc` | ⭕️ | ⭕️ | ❌ | ❌ | ❌ | ❌ | -`powerpc64` | ⭕️ | ⭕️ | ❌ | ❌ | ❌ | ❌ | diff --git a/src/linux/dumper_cpu_info/mod.rs b/src/linux/dumper_cpu_info/mod.rs index 54a4f3b7..6f898390 100644 --- a/src/linux/dumper_cpu_info/mod.rs +++ b/src/linux/dumper_cpu_info/mod.rs @@ -7,12 +7,10 @@ cfg_if::cfg_if! { if #[cfg(any( target_arch = "x86_64", target_arch = "x86", - target_arch = "mips", - target_arch = "mips64" ))] { - pub mod x86_mips; - pub use x86_mips as imp; + pub mod x86; + pub use x86 as imp; } else if #[cfg(any( target_arch = "arm", target_arch = "aarch64", diff --git a/src/linux/dumper_cpu_info/x86_mips.rs b/src/linux/dumper_cpu_info/x86.rs similarity index 93% rename from src/linux/dumper_cpu_info/x86_mips.rs rename to src/linux/dumper_cpu_info/x86.rs index ef0659e6..013bef1d 100644 --- a/src/linux/dumper_cpu_info/x86_mips.rs +++ b/src/linux/dumper_cpu_info/x86.rs @@ -39,11 +39,7 @@ pub fn write_cpu_information(sys_info: &mut MDRawSystemInfo) -> Result<()> { ]; // processor_architecture should always be set, do this first - sys_info.processor_architecture = if cfg!(target_arch = "mips") { - MDCPUArchitecture::PROCESSOR_ARCHITECTURE_MIPS - } else if cfg!(target_arch = "mips64") { - MDCPUArchitecture::PROCESSOR_ARCHITECTURE_MIPS64 - } else if cfg!(target_arch = "x86") { + sys_info.processor_architecture = if cfg!(target_arch = "x86") { MDCPUArchitecture::PROCESSOR_ARCHITECTURE_INTEL } else { MDCPUArchitecture::PROCESSOR_ARCHITECTURE_AMD64 diff --git a/src/linux/thread_info/mips.rs b/src/linux/thread_info/mips.rs deleted file mode 100644 index 1a6bdbf4..00000000 --- a/src/linux/thread_info/mips.rs +++ /dev/null @@ -1,54 +0,0 @@ -use super::{Pid, errors::ThreadInfoError}; - -type Result = std::result::Result; - -#[derive(Debug)] -pub struct ThreadInfoMips { - pub stack_pointer: libc::c_ulonglong, - pub tgid: Pid, // thread group id - pub ppid: Pid, // parent process - // Use the structure defined in - pub mcontext: libc::mcontext_t, -} - -impl ThreadInfoMips { - pub fn get_instruction_pointer(&self) -> libc::c_ulonglong { - self.mcontext.pc - } - - pub fn fill_cpu_context(&self, out: &mut RawContextCPU) { - // #if _MIPS_SIM == _ABI64 - // out->context_flags = MD_CONTEXT_MIPS64_FULL; - // #elif _MIPS_SIM == _ABIO32 - // out->context_flags = MD_CONTEXT_MIPS_FULL; - for idx in 0..MD_CONTEXT_MIPS_GPR_COUNT { - out.iregs[idx] = self.mcontext.gregs[idx]; - } - - out.mdhi = self.mcontext.mdhi; - out.mdlo = self.mcontext.mdlo; - out.dsp_control = self.mcontext.dsp; - - out.hi[0] = self.mcontext.hi1; - out.lo[0] = self.mcontext.lo1; - out.hi[1] = self.mcontext.hi2; - out.lo[1] = self.mcontext.lo2; - out.hi[2] = self.mcontext.hi3; - out.lo[2] = self.mcontext.lo3; - - out.epc = self.mcontext.pc; - out.badvaddr = 0; // Not stored in mcontext - out.status = 0; // Not stored in mcontext - out.cause = 0; // Not stored in mcontext - - for idx in 0..MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT { - out.float_save.regs[idx] = self.mcontext.fpregs.fp_r.fp_fregs[idx]._fp_fregs; - } - - out.float_save.fpcsr = mcontext.fpc_csr; - - // #if _MIPS_SIM == _ABIO32 - // out.float_save.fir = self.mcontext.fpc_eir; - // #endif - } -} diff --git a/src/linux/thread_info/mod.rs b/src/linux/thread_info/mod.rs index 20c0ff78..06c281db 100644 --- a/src/linux/thread_info/mod.rs +++ b/src/linux/thread_info/mod.rs @@ -48,9 +48,6 @@ cfg_if::cfg_if! { } else if #[cfg(target_arch = "aarch64")] { mod aarch64; pub type ThreadInfo = aarch64::ThreadInfoAarch64; - } else if #[cfg(target_arch = "mips")] { - mod mips; - pub type ThreadInfo = mips::ThreadInfoMips; } } diff --git a/src/minidump_cpu.rs b/src/minidump_cpu.rs index 6afc9402..3dee6581 100644 --- a/src/minidump_cpu.rs +++ b/src/minidump_cpu.rs @@ -18,8 +18,6 @@ cfg_if::cfg_if! { pub(crate) const FP_REG_COUNT: usize = 32; pub type RawContextCPU = minidump_common::format::CONTEXT_ARM64_OLD; - } else if #[cfg(target_arch = "mips")] { - compile_error!("flesh me out"); } else { compile_error!("unsupported target architecture"); } diff --git a/src/minidump_format.rs b/src/minidump_format.rs index 82e74784..065a00a1 100644 --- a/src/minidump_format.rs +++ b/src/minidump_format.rs @@ -23,11 +23,6 @@ cfg_if::cfg_if! { pub use format::X86CpuInfo as MDCPUInformation; } else if #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] { pub use format::ARMCpuInfo as MDCPUInformation; - } else if #[cfg(target_arch = "mips")] { - pub struct MDCPUInformation { - pub cpuid: [u64; 2], - _padding: [u32; 2], - } } } diff --git a/tests/linux_minidump_writer.rs b/tests/linux_minidump_writer.rs index 360c565e..31fedc2c 100644 --- a/tests/linux_minidump_writer.rs +++ b/tests/linux_minidump_writer.rs @@ -35,7 +35,6 @@ enum Context { impl Context { pub fn minidump_writer(&self, pid: Pid) -> MinidumpWriterConfig { let mut mw = MinidumpWriterConfig::new(pid, pid); - #[cfg(not(target_arch = "mips"))] if self == &Context::With { let crash_context = get_crash_context(pid); mw.set_crash_context(crash_context); @@ -44,7 +43,6 @@ impl Context { } } -#[cfg(not(target_arch = "mips"))] fn get_ucontext() -> Result { let mut context = std::mem::MaybeUninit::uninit(); unsafe { @@ -55,7 +53,6 @@ fn get_ucontext() -> Result { } } -#[cfg(not(target_arch = "mips"))] fn get_crash_context(tid: Pid) -> CrashContext { let siginfo: libc::signalfd_siginfo = unsafe { std::mem::zeroed() }; let context = get_ucontext().expect("Failed to get ucontext"); @@ -86,7 +83,6 @@ macro_rules! contextual_test { test(Context::Without) } - #[cfg(not(target_arch = "mips"))] #[test] $(#[$attr])? fn with_context() { diff --git a/tests/ptrace_dumper.rs b/tests/ptrace_dumper.rs index d9cbe777..01945a31 100644 --- a/tests/ptrace_dumper.rs +++ b/tests/ptrace_dumper.rs @@ -139,8 +139,6 @@ fn thread_list_from_parent() { let process_tid_location = info.regs.uregs[3]; #[cfg(target_arch = "aarch64")] let process_tid_location = info.regs.regs[3]; - #[cfg(target_arch = "mips")] - let process_tid_location = info.mcontext.gregs[1]; let thread_id_data = PtraceDumper::copy_from_process( *curr_thread, @@ -175,7 +173,7 @@ fn thread_list_from_parent() { // assert_eq!(matching_threads, num_of_threads); } -#[cfg(not(any(target_arch = "mips", target_os = "android")))] +#[cfg(not(target_os = "android"))] #[test] // Ensure that the linux-gate VDSO is included in the mapping list. fn mappings_include_linux_gate() { @@ -376,8 +374,6 @@ fn sanitizes_stack_copies() { // let heap_addr = thread_info.regs.uregs[3] as usize; // #[cfg(target_arch = "aarch64")] // let heap_addr = thread_info.regs.regs[3] as usize; - // #[cfg(target_arch = "mips")] - // let heap_addr = thread_info.mcontext.gregs[1] as usize; simulated_stack = vec![0u8; 2 * size_of::()];