diff options
-rw-r--r-- | lib/libunwind/src/DwarfInstructions.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libunwind/src/DwarfInstructions.hpp b/lib/libunwind/src/DwarfInstructions.hpp index fcf2dd0c739..4455827a40b 100644 --- a/lib/libunwind/src/DwarfInstructions.hpp +++ b/lib/libunwind/src/DwarfInstructions.hpp @@ -240,6 +240,16 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc, } #endif +#if defined(_LIBUNWIND_TARGET_PPC64) + if (R::getArch() == REGISTERS_PPC64) { + if (addressSpace.get32(returnAddress) == 0xE8410018) { + pint_t sp = newRegisters.getRegister(UNW_REG_SP); + pint_t r2 = addressSpace.get64(sp + 24); + newRegisters.setRegister(UNW_PPC64_R2, r2); + } + } +#endif + // Return address is address after call site instruction, so setting IP to // that does simualates a return. newRegisters.setIP(returnAddress); |