diff options
author | gordana.cmiljanovic@imgtec.com <gordana.cmiljanovic@imgtec.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-09-11 11:37:04 +0000 |
---|---|---|
committer | gordana.cmiljanovic@imgtec.com <gordana.cmiljanovic@imgtec.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-09-11 11:37:04 +0000 |
commit | f78839c15730533fc433c50ea83a3afea835c245 (patch) | |
tree | 9b3136dd94e663af23394356679b78467fddd5b7 /src/tools/linux/md2core | |
parent | Fixing minidump_dump to handle nacl dumps. (diff) | |
download | breakpad-f78839c15730533fc433c50ea83a3afea835c245.tar.xz |
Adding support for mips.
Support for mips cpu is added to all breakapad targets including unittests.
BUG=none
TEST=unittests
Review URL: https://breakpad.appspot.com/614002
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1212 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/tools/linux/md2core')
-rw-r--r-- | src/tools/linux/md2core/minidump-2-core.cc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index 476f2dfa..e796dfe4 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -202,7 +202,7 @@ struct CrashedProcess { struct Thread { pid_t tid; user_regs_struct regs; -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) user_fpregs_struct fpregs; #endif #if defined(__i386__) @@ -357,6 +357,28 @@ ParseThreadRegisters(CrashedProcess::Thread* thread, thread->regs.uregs[16] = rawregs->cpsr; thread->regs.uregs[17] = 0; // what is ORIG_r0 exactly? } +#elif defined(__mips__) +static void +ParseThreadRegisters(CrashedProcess::Thread* thread, + const MinidumpMemoryRange& range) { + const MDRawContextMIPS* rawregs = range.GetData<MDRawContextMIPS>(0); + + for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i) + thread->regs.regs[i] = rawregs->iregs[i]; + + thread->regs.lo = rawregs->mdlo; + thread->regs.hi = rawregs->mdhi; + thread->regs.epc = rawregs->epc; + thread->regs.badvaddr = rawregs->badvaddr; + thread->regs.status = rawregs->status; + thread->regs.cause = rawregs->cause; + + for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) + thread->fpregs.regs[i] = rawregs->float_save.regs[i]; + + thread->fpregs.fpcsr = rawregs->float_save.fpcsr; + thread->fpregs.fir = rawregs->float_save.fir; +} #else #error "This code has not been ported to your platform yet" #endif @@ -421,6 +443,12 @@ ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range, "This version of minidump-2-core only supports ARM (32bit).\n"); _exit(1); } +#elif defined(__mips__) + if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_MIPS) { + fprintf(stderr, + "This version of minidump-2-core only supports mips (32bit).\n"); + _exit(1); + } #else #error "This code has not been ported to your platform yet" #endif @@ -445,6 +473,8 @@ ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range, ? "x86-64" : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_ARM ? "ARM" + : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_MIPS + ? "MIPS" : "???", sysinfo->number_of_processors, sysinfo->processor_level, |