diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp index 1993840ab..236fcf7a0 100644 --- a/debuggerd/libdebuggerd/tombstone.cpp +++ b/debuggerd/libdebuggerd/tombstone.cpp @@ -428,7 +428,7 @@ void dump_registers(log_t* log, unwindstack::Regs* regs) { std::vector> special_row; #if defined(__arm__) || defined(__aarch64__) - static constexpr const char* special_registers[] = {"ip", "lr", "sp", "pc"}; + static constexpr const char* special_registers[] = {"ip", "lr", "sp", "pc", "pst"}; #elif defined(__i386__) static constexpr const char* special_registers[] = {"ebp", "esp", "eip"}; #elif defined(__x86_64__) diff --git a/libunwindstack/RegsArm64.cpp b/libunwindstack/RegsArm64.cpp index e9787aa46..2e8af20cb 100644 --- a/libunwindstack/RegsArm64.cpp +++ b/libunwindstack/RegsArm64.cpp @@ -103,6 +103,7 @@ void RegsArm64::IterateRegisters(std::function fn) fn("sp", regs_[ARM64_REG_SP]); fn("lr", regs_[ARM64_REG_LR]); fn("pc", regs_[ARM64_REG_PC]); + fn("pst", regs_[ARM64_REG_PSTATE]); } Regs* RegsArm64::Read(void* remote_data) { @@ -113,6 +114,7 @@ Regs* RegsArm64::Read(void* remote_data) { uint64_t* reg_data = reinterpret_cast(regs->RawData()); reg_data[ARM64_REG_PC] = user->pc; reg_data[ARM64_REG_SP] = user->sp; + reg_data[ARM64_REG_PSTATE] = user->pstate; return regs; } diff --git a/libunwindstack/include/unwindstack/MachineArm64.h b/libunwindstack/include/unwindstack/MachineArm64.h index e8b778b13..e95333510 100644 --- a/libunwindstack/include/unwindstack/MachineArm64.h +++ b/libunwindstack/include/unwindstack/MachineArm64.h @@ -55,6 +55,7 @@ enum Arm64Reg : uint16_t { ARM64_REG_R30, ARM64_REG_R31, ARM64_REG_PC, + ARM64_REG_PSTATE, ARM64_REG_LAST, ARM64_REG_SP = ARM64_REG_R31, diff --git a/libunwindstack/tests/RegsIterateTest.cpp b/libunwindstack/tests/RegsIterateTest.cpp index 7e36953f2..bc95851fe 100644 --- a/libunwindstack/tests/RegsIterateTest.cpp +++ b/libunwindstack/tests/RegsIterateTest.cpp @@ -114,6 +114,7 @@ std::vector ExpectedRegisters() { result.push_back({"sp", ARM64_REG_SP}); result.push_back({"lr", ARM64_REG_LR}); result.push_back({"pc", ARM64_REG_PC}); + result.push_back({"pst", ARM64_REG_PSTATE}); return result; }