diff --git a/src/client/linux/minidump_writer/linux_core_dumper.cc b/src/client/linux/minidump_writer/linux_core_dumper.cc index eb9e3fd0..aa6aa70f 100644 --- a/src/client/linux/minidump_writer/linux_core_dumper.cc +++ b/src/client/linux/minidump_writer/linux_core_dumper.cc @@ -188,7 +188,19 @@ bool LinuxCoreDumper::EnumerateThreads() { memset(&info, 0, sizeof(ThreadInfo)); info.tgid = status->pr_pgrp; info.ppid = status->pr_ppid; +#if defined(__mips__) + for (int i = EF_REG0; i <= EF_REG31; i++) + info.regs.regs[i - EF_REG0] = status->pr_reg[i]; + + info.regs.lo = status->pr_reg[EF_LO]; + info.regs.hi = status->pr_reg[EF_HI]; + info.regs.epc = status->pr_reg[EF_CP0_EPC]; + info.regs.badvaddr = status->pr_reg[EF_CP0_BADVADDR]; + info.regs.status = status->pr_reg[EF_CP0_STATUS]; + info.regs.cause = status->pr_reg[EF_CP0_CAUSE]; +#else memcpy(&info.regs, status->pr_reg, sizeof(info.regs)); +#endif if (first_thread) { crash_thread_ = pid; crash_signal_ = status->pr_info.si_signo; diff --git a/src/common/android/include/sys/procfs.h b/src/common/android/include/sys/procfs.h index 94994147..bedae34a 100644 --- a/src/common/android/include/sys/procfs.h +++ b/src/common/android/include/sys/procfs.h @@ -55,6 +55,8 @@ typedef unsigned long elf_greg_t; #define ELF_NGREG (sizeof(struct user_regs) / sizeof(elf_greg_t)) #elif defined(__aarch64__) #define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t)) +#elif defined(__mips__) +#define ELF_NGREG 45 #else #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) #endif @@ -95,6 +97,9 @@ struct elf_prpsinfo { #ifdef __x86_64__ unsigned int pr_uid; unsigned int pr_gid; +#elif defined(__mips__) + unsigned long pr_uid; + unsigned long pr_gid; #else unsigned short pr_uid; unsigned short pr_gid; diff --git a/src/common/android/include/sys/user.h b/src/common/android/include/sys/user.h index 7cafd2c9..40567416 100644 --- a/src/common/android/include/sys/user.h +++ b/src/common/android/include/sys/user.h @@ -127,6 +127,54 @@ struct user { #define _ASM_USER_H 1 // Prevent conflicts +#define EF_REG0 6 +#define EF_REG1 7 +#define EF_REG2 8 +#define EF_REG3 9 +#define EF_REG4 10 +#define EF_REG5 11 +#define EF_REG6 12 +#define EF_REG7 13 +#define EF_REG8 14 +#define EF_REG9 15 +#define EF_REG10 16 +#define EF_REG11 17 +#define EF_REG12 18 +#define EF_REG13 19 +#define EF_REG14 20 +#define EF_REG15 21 +#define EF_REG16 22 +#define EF_REG17 23 +#define EF_REG18 24 +#define EF_REG19 25 +#define EF_REG20 26 +#define EF_REG21 27 +#define EF_REG22 28 +#define EF_REG23 29 +#define EF_REG24 30 +#define EF_REG25 31 + +/* + * k0/k1 unsaved + */ +#define EF_REG26 32 +#define EF_REG27 33 + +#define EF_REG28 34 +#define EF_REG29 35 +#define EF_REG30 36 +#define EF_REG31 37 + +/* + * Saved special registers + */ +#define EF_LO 38 +#define EF_HI 39 +#define EF_CP0_EPC 40 +#define EF_CP0_BADVADDR 41 +#define EF_CP0_STATUS 42 +#define EF_CP0_CAUSE 43 + struct user_regs_struct { unsigned long long regs[32]; unsigned long long lo;