[Lldb-commits] [lldb] [lldb] Add WebAssembly Process Plugin (PR #150143)
Quentin Michaud via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 24 06:02:10 PDT 2025
================
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "UnwindWasm.h"
+#include "Plugins/Process/gdb-remote/ThreadGDBRemote.h"
+#include "ProcessWasm.h"
+#include "ThreadWasm.h"
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Log.h"
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace process_gdb_remote;
+using namespace wasm;
+
+class WasmGDBRemoteRegisterContext : public GDBRemoteRegisterContext {
+public:
+ WasmGDBRemoteRegisterContext(ThreadGDBRemote &thread,
+ uint32_t concrete_frame_idx,
+ GDBRemoteDynamicRegisterInfoSP ®_info_sp,
+ uint64_t pc)
+ : GDBRemoteRegisterContext(thread, concrete_frame_idx, reg_info_sp, false,
+ false) {
+ PrivateSetRegisterValue(0, pc);
----------------
mh4ck-Thales wrote:
Wasm does not have a fixed set of registers but relies on a mechanism named local and global variables to store information such as the stack pointer. I gave a more detailed explanation in the related PR : https://github.com/llvm/llvm-project/pull/77949#issuecomment-1906103928
https://github.com/llvm/llvm-project/pull/150143
More information about the lldb-commits
mailing list