================
@@ -64,9 +64,21 @@ const RegisterSet
*RegisterContextWasm::GetRegisterSet(size_t reg_set) {
bool RegisterContextWasm::ReadRegister(const RegisterInfo *reg_info,
RegisterValue &value) {
- // The only real registers is the PC.
- if (reg_info->name)
+ // The only real register is the PC.
+ if (reg_info->name) {
+ // A caller frame's PC is the unwound return address, which the base
+ // register context cannot provide because it only sees the innermost
+ // frame's live PC. Use the PC the unwinder recorded for this frame.
+ if (m_concrete_frame_idx > 0) {
+ ThreadWasm &wasm_thread = static_cast<ThreadWasm &>(GetThread());
----------------
felipepiovezan wrote:
I don't want to open a patch now to avoid any conflicts, but on line 84 we have:
```
ThreadWasm *thread = static_cast<ThreadWasm *>(&GetThread());
ProcessWasm *process = static_cast<ProcessWasm *>(thread->GetProcess().get());
if (!thread)
return false;
```
It also declares a ThreadWasm variable, and does a null test which is
non-sensical (the variable starts as a reference, and a static cast will never
turn non-null into null).
I think it is defensible to hoist your variable to the function scope and
delete the `if` in this PR, since you are indirectly re-using existing code.
But I'm also happy to put a patch after you merge this.
https://github.com/llvm/llvm-project/pull/212326
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits