[libunwind][RISCV] Track PC separately from RA

Summary:
This allows unwinding to work across signal handler frames where the IP of the previous frame is not the same as the current value of the RA register. This is particularly useful for acquiring backtraces from signal handlers.

I kept the size of the context structure the same to avoid ABI breakage; the PC is stored in the previously unused slot for register 0.

Reviewers: #libunwind, mhorne, lenary, luismarques, arichardson, compnerd

Reviewed By: #libunwind, mhorne, lenary, compnerd

Subscribers: kamleshbhalui, jrtc27, bsdjhb, arichardson, compnerd, simoncook, kito-cheng, shiva0217, rogfer01, rkruppe, psnobl, benna, Jim, s.egerton, sameer.abuasal, evandro, llvm-commits, libcxx-commits

Tags: #libunwind, #llvm

Differential Revision: https://reviews.llvm.org/D78931

GitOrigin-RevId: 0c1a135adae530b88f68c9425fb85bd8fb9152ca
3 files changed
tree: c1b354fe601a83369bc7c79d48d2620196210c59
  1. cmake/
  2. docs/
  3. include/
  4. src/
  5. test/
  6. .clang-format
  7. CMakeLists.txt
  8. LICENSE.TXT