libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH] tdep_uc_addr: use +4 offset for UNW_MIPS_PC on


From: Королев Сергей
Subject: [Libunwind-devel] [PATCH] tdep_uc_addr: use +4 offset for UNW_MIPS_PC on MIPS (be)
Date: Wed, 22 Jun 2016 19:53:02 +0300

According to mcontext_t definition its "pc" field
is also 64 bit wide and thus requires 4 byte offset
on MIPS32 (be).
---
 src/mips/Ginit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mips/Ginit.c b/src/mips/Ginit.c
index 8290c40..83b100f 100644
--- a/src/mips/Ginit.c
+++ b/src/mips/Ginit.c
@@ -59,7 +59,7 @@ tdep_uc_addr (ucontext_t *uc, int reg)
 {
   char *addr = uc_addr (uc, reg);
 
-  if (reg >= UNW_MIPS_R0 && reg <= UNW_MIPS_R31
+  if (((reg >= UNW_MIPS_R0 && reg <= UNW_MIPS_R31) || reg == UNW_MIPS_PC)
       && tdep_big_endian (unw_local_addr_space)
       && unw_local_addr_space->abi == UNW_MIPS_ABI_O32)
     addr += 4;
-- 
2.1.4

reply via email to

[Prev in Thread] Current Thread [Next in Thread]