================ @@ -230,10 +230,36 @@ Load(EmulateInstructionRISCV &emulator, I inst, uint64_t (*extend)(E)) { auto addr = LoadStoreAddr(emulator, inst); if (!addr) return false; - return transformOptional( - emulator.ReadMem<T>(*addr), - [&](T t) { return inst.rd.Write(emulator, extend(E(t))); }) - .value_or(false); + + // Set up context for the load operation, similar to ARM64 + EmulateInstructionRISCV::Context context; + + // Get register info for base register + uint32_t rs1_lldb = GPREncodingToLLDB(inst.rs1.rs); + std::optional<RegisterInfo> reg_info_rs1 = + emulator.GetRegisterInfo(eRegisterKindLLDB, rs1_lldb); + + if (!reg_info_rs1) + return false; + + // Set context type based on whether this is a stack-based load + if (inst.rs1.rs == 2) { // x2 is the stack pointer in RISC-V ---------------- dmpots wrote:
Can we use a named constant for this? https://github.com/llvm/llvm-project/pull/158161 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits