summaryrefslogtreecommitdiff
path: root/src/mips/Ginit.c
diff options
context:
space:
mode:
authorTommi Rantala <tt.rantala@gmail.com>2012-09-07 12:12:50 +0300
committerTommi Rantala <tt.rantala@gmail.com>2012-09-28 14:50:03 +0300
commit79c2c254a74ca850aefe2c49b973dea1fa2934c2 (patch)
tree5f5a5f3014a9571dd10741914b505c9f5782dea3 /src/mips/Ginit.c
parentded94b98ff3534a3c394591f4b254b1af6f0711c (diff)
downloadlibunwind-79c2c254a74ca850aefe2c49b973dea1fa2934c2.tar.gz
MIPS coredump support
Add MIPS support to the coredump library. Explicit support for the MIPS program counter register is added so that we can start backtracing from the program counter value we read from a core dump. The PC register support was not strictly required for local backtracing, and we will in fact just plug the return address to the PC register in getcontext(). I have only tested the 32bit "OABI" paths.
Diffstat (limited to 'src/mips/Ginit.c')
-rw-r--r--src/mips/Ginit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mips/Ginit.c b/src/mips/Ginit.c
index 6ffeabfa..31000b3c 100644
--- a/src/mips/Ginit.c
+++ b/src/mips/Ginit.c
@@ -46,6 +46,8 @@ uc_addr (ucontext_t *uc, int reg)
{
if (reg >= UNW_MIPS_R0 && reg < UNW_MIPS_R0 + 32)
return &uc->uc_mcontext.gregs[reg - UNW_MIPS_R0];
+ else if (reg == UNW_MIPS_PC)
+ return &uc->uc_mcontext.pc;
else
return NULL;
}