[Lldb-commits] [lldb] RISCV unwinding enable (PR #158161)
David Peixotto via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 12 10:13:41 PDT 2025
================
@@ -737,11 +792,42 @@ class Executor {
bool operator()(SH inst) { return Store<SH, uint16_t>(m_emu, inst); }
bool operator()(SW inst) { return Store<SW, uint32_t>(m_emu, inst); }
bool operator()(ADDI inst) {
- return transformOptional(inst.rs1.ReadI64(m_emu),
- [&](int64_t rs1) {
- return inst.rd.Write(
- m_emu, rs1 + int64_t(SignExt(inst.imm)));
- })
+ return transformOptional(
+ inst.rs1.ReadI64(m_emu),
+ [&](int64_t rs1) {
+ int64_t result = rs1 + int64_t(SignExt(inst.imm));
+ // Check if this is a stack pointer adjustment
+ if (inst.rd.rd == 2 && inst.rs1.rs == 2) { // rd=sp, rs1=sp
+ EmulateInstruction::Context context;
+ context.type =
+ EmulateInstruction::eContextAdjustStackPointer;
+ context.SetImmediateSigned(SignExt(inst.imm));
+ uint32_t sp_lldb_reg = GPREncodingToLLDB(2);
----------------
dmpots wrote:
Another magic number here.
https://github.com/llvm/llvm-project/pull/158161
More information about the lldb-commits
mailing list