99#include " UnwindWasm.h"
1010#include " Plugins/Process/gdb-remote/ThreadGDBRemote.h"
1111#include " ProcessWasm.h"
12+ #include " RegisterContextWasm.h"
1213#include " ThreadWasm.h"
1314#include " lldb/Utility/LLDBLog.h"
1415#include " lldb/Utility/Log.h"
@@ -18,21 +19,6 @@ using namespace lldb_private;
1819using namespace process_gdb_remote ;
1920using namespace wasm ;
2021
21- class WasmGDBRemoteRegisterContext : public GDBRemoteRegisterContext {
22- public:
23- WasmGDBRemoteRegisterContext (ThreadGDBRemote &thread,
24- uint32_t concrete_frame_idx,
25- GDBRemoteDynamicRegisterInfoSP ®_info_sp,
26- uint64_t pc)
27- : GDBRemoteRegisterContext(thread, concrete_frame_idx, reg_info_sp, false ,
28- false ) {
29- // Wasm does not have a fixed set of registers but relies on a mechanism
30- // named local and global variables to store information such as the stack
31- // pointer. The only actual register is the PC.
32- PrivateSetRegisterValue (0 , pc);
33- }
34- };
35-
3622lldb::RegisterContextSP
3723UnwindWasm::DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame) {
3824 if (m_frames.size () <= frame->GetFrameIndex ())
@@ -43,9 +29,9 @@ UnwindWasm::DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) {
4329 ProcessWasm *wasm_process =
4430 static_cast <ProcessWasm *>(thread->GetProcess ().get ());
4531
46- return std::make_shared<WasmGDBRemoteRegisterContext>(
47- *gdb_thread, frame->GetConcreteFrameIndex (),
48- wasm_process->GetRegisterInfo (), m_frames[frame-> GetFrameIndex ()] );
32+ return std::make_shared<RegisterContextWasm>(*gdb_thread,
33+ frame->GetConcreteFrameIndex (),
34+ wasm_process->GetRegisterInfo ());
4935}
5036
5137uint32_t UnwindWasm::DoGetFrameCount () {
0 commit comments