https://github.com/DavidSpickett approved this pull request.
LGTM.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
DavidSpickett wrote:
Thanks! Ok good enough for me, and at some point I'll put some time into
working with Wasm so I can better review in future.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-commits@lists.llvm.or
https://github.com/JDevlieghere updated
https://github.com/llvm/llvm-project/pull/150143
>From 4294028e3db13cde0b99a18a0a1ee3a551d591ee Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere
Date: Tue, 22 Jul 2025 16:37:03 -0700
Subject: [PATCH] [lldb] Add WebAssembly Process Plugin
Extend support i
JDevlieghere wrote:
> > I'll be adding the other features in separate PRs to make reviewing easier.
>
> Just for good faith purposes, can you give me a list of the parts you've got
> it split into at the moment and what state they are in? Done, WIP, whatever.
> I assume from what you've said,
@@ -0,0 +1,89 @@
+//===--===//
+//
+// 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: Apac
@@ -2076,6 +2076,13 @@ size_t Platform::GetSoftwareBreakpointTrapOpcode(Target
&target,
trap_opcode_size = sizeof(g_loongarch_opcode);
} break;
+ case llvm::Triple::wasm32: {
+// Unreachable (0x00) triggers an unconditional trap.
DavidSpickett wrot
@@ -2076,6 +2076,13 @@ size_t Platform::GetSoftwareBreakpointTrapOpcode(Target
&target,
trap_opcode_size = sizeof(g_loongarch_opcode);
} break;
+ case llvm::Triple::wasm32: {
+// Unreachable (0x00) triggers an unconditional trap.
JDevlieghere wrote
@@ -0,0 +1,131 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,131 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,131 @@
+//===--===//
+//
+// 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: Apa
@@ -1998,6 +1998,19 @@ threads (live system debug) / cores (JTAG) in your
program have
stopped and allows LLDB to display and control your program
correctly.
+## qWasmCallStack
+
+Get the Wasm callback for the given thread id. This returns a hex-encoding list
+of 64-bit addre
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
DavidSpickett wrote:
Closed all the comments I think have been addressed. Please look at the ones
that remain open.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-b
@@ -1998,6 +1998,19 @@ threads (live system debug) / cores (JTAG) in your
program have
stopped and allows LLDB to display and control your program
correctly.
+## qWasmCallStack
+
+Get the Wasm callback for the given thread id. This returns a hex-encoding list
+of 64-bit addre
@@ -0,0 +1,89 @@
+//===--===//
+//
+// 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: Apac
@@ -1998,6 +1998,19 @@ threads (live system debug) / cores (JTAG) in your
program have
stopped and allows LLDB to display and control your program
correctly.
+## qWasmCallStack
+
+Get the Wasm callback for the given thread id. This returns a hex-encoding list
+of 64-bit addre
@@ -0,0 +1,131 @@
+//===--===//
+//
+// 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: Apa
@@ -1998,6 +1998,19 @@ threads (live system debug) / cores (JTAG) in your
program have
stopped and allows LLDB to display and control your program
correctly.
+## qWasmCallStack
+
+Get the Wasm callback for the given thread id. This returns a hex-encoding list
@@ -0,0 +1,85 @@
+//===--===//
+//
+// 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: Apac
@@ -1998,6 +1998,19 @@ threads (live system debug) / cores (JTAG) in your
program have
stopped and allows LLDB to display and control your program
correctly.
+## qWasmCallStack
+
+Get the Wasm callback for the given thread id. This returns a hex-encoding list
+of 64-bit addre
@@ -2076,6 +2076,13 @@ size_t Platform::GetSoftwareBreakpointTrapOpcode(Target
&target,
trap_opcode_size = sizeof(g_loongarch_opcode);
} break;
+ case llvm::Triple::wasm32: {
+// Unreachable (0x00) triggers an unconditional trap.
DavidSpickett wrot
DavidSpickett wrote:
And by "all" I mean your current stack, not "all" of wasm debugging support.
That is of an unknown scope at the moment and I'm fine with that.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-com
DavidSpickett wrote:
> I'll be adding the other features in separate PRs to make reviewing easier.
Just for good faith purposes, can you give me a list of the parts you've got it
split into at the moment and what state they are in? Done, WIP, whatever. I
assume from what you've said, that it's
JDevlieghere wrote:
> @JDevlieghere do you have a WIP tree they can use that has more changes?
Not currently no, but it's only one or two patches more patches before we have
parity with the original PR. I just need to decide how to split them up once
this PR lands.
As much as I enjoy the disc
@@ -0,0 +1,127 @@
+//===--===//
DavidSpickett wrote:
Cool.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-commits
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
DavidSpickett wrote:
> I'm personally skeptical of this part. LLDB's command line driver is very
> small and doesn't do much. You absolutely could turn that into a DAP client,
> but you wouldn't get much in return. Most of the "TUI" parts of LLDB are
> tightly coupled with the core of the libr
DavidSpickett wrote:
> Hence why I think the "user" approach is the most promising, generally
> speaking.
Agreed. If I want to debug qemu-user I treat it like any other program, if I
want the simulated process I connect to the internal stub. Some will want
integrated solutions but that can co
mh4ck-Thales wrote:
I tested this patch and while basic debugging works, some features that were
available in #77949 are not working anymore (retrieval of variable values,
disassembly of the Wasm bytecode...). I'm not sure if it's a bug or if it's
because the #77949 patch has been split into i
mh4ck-Thales wrote:
> I'd be happy to keep chatting about this if you're interested in exploring
> that path further, now or in the future. I also don't want to necessarily
> push you towards the GDB remote protocol. For languages like C++, Rust,
> Swift, or really anything targeting LLVM/supp
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
jimingham wrote:
> > I see two new ways that LLDB and Wasmtime could interact in the future (on
> > top of the existing way by attaching LLDB to a native Wasmtime process and
> > debugging Wasm (and native code) via the JIT code registration system APIs):
> >
> > 1. LLDB's TUI frontend could b
@@ -1998,6 +1998,18 @@ threads (live system debug) / cores (JTAG) in your
program have
stopped and allows LLDB to display and control your program
correctly.
+## qWasmCallStack
+
+Get the Wasm callback for the given thread id. This returns a hex-encoding list
+of 64-bit addre
@@ -1998,6 +1998,18 @@ threads (live system debug) / cores (JTAG) in your
program have
stopped and allows LLDB to display and control your program
correctly.
+## qWasmCallStack
+
+Get the Wasm callback for the given thread id. This returns a hex-encoding list
+of 64-bit addre
JDevlieghere wrote:
> I see two new ways that LLDB and Wasmtime could interact in the future (on
> top of the existing way by attaching LLDB to a native Wasmtime process and
> debugging Wasm (and native code) via the JIT code registration system APIs):
>
> 1. LLDB's TUI frontend could be a cli
fitzgen wrote:
> This is basically describing the GDB remote protocol.
Clarification: The interfaces described in that RFC and that I am describing
below are programmatic/function interfaces (specifically [Wasm
component](https://github.com/WebAssembly/component-model/blob/main/design/mvp/Expl
JDevlieghere wrote:
Hey @alexcrichton and @fitzgen, thanks for chiming in here! The idea to
implement a DAP server to support interpreted languages is an interesting idea.
As someone who's been involved with
[lldb-dap](https://github.com/llvm/llvm-project/tree/main/lldb/tools/lldb-dap)
I have
https://github.com/JDevlieghere updated
https://github.com/llvm/llvm-project/pull/150143
>From 1d0ad45e68339fa1da2f7e3fa34826498c21594c Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere
Date: Tue, 22 Jul 2025 16:37:03 -0700
Subject: [PATCH 1/3] [lldb] Add WebAssembly Process Plugin
Extend suppo
fitzgen wrote:
Great to see more interest in WebAssembly from `lld`, and thanks for sharing
our debugging plans here, @alexcrichton.
> We do not currently have anyone slated to implement this work as it hasn't
> been a priority for existing maintainers yet and we haven't had other
> voluntee
alexcrichton wrote:
> I'm bringing @alexcrichton into the loop, he's involved in the Bytecode
> Alliance and LLVM, maybe he'll be able to help us on these topics.
👋
FWIW I'm very much an outsider here so I don't fully understand all the
dynamics in play per se, but what I can speak more to i
JDevlieghere wrote:
> > process connect --plugin wasm connect://localhost:4567
>
> On the original review, auto-detection of the plugin wasn't working which
> meant this `plugin wasm` was needed. Did you ever find out what was the
> cause? I presume lldb still has a local copy of the program f
JDevlieghere wrote:
> Sure, so this is like qemu-user? You want to debug the wasm process being
> hosted within the runtime not the runtime itself.
>
> Because the internet is 99% "use a web browser" for debug, then
> https://docs.wasmtime.dev/examples-debugging-native-debugger.html seems to be
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,127 @@
+//===--===//
JDevlieghere wrote:
Yes, this was changed with
https://discourse.llvm.org/t/is-c-in-header-files-still-relevant/83124/. New
files shouldn't have the filename or
@@ -2076,6 +2076,12 @@ size_t Platform::GetSoftwareBreakpointTrapOpcode(Target
&target,
trap_opcode_size = sizeof(g_loongarch_opcode);
} break;
+ case llvm::Triple::wasm32: {
+static const uint8_t g_wasm_opcode[] = {0x00}; // unreachable
JDevlieghe
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -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: Apac
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
DavidSpickett wrote:
Certainly lldb being in this conversation early would be a good way to prevent
the reliance on GDB specific behaviour that often happens in the native
debugging world.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-com
DavidSpickett wrote:
Long term, if the WASM standard makes recommendations for debugging then that's
great. You are correct there.
Short term, users will need to know what to expect so we need a short, simple,
answer to "I tried lldb with whatever runtime and it didn't work". Which
ideally is
@@ -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: Apac
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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: Apa
mh4ck-Thales wrote:
Thanks for picking up the work on this!
> I'm not aware of any other runtimes besides WAMR that support debugging
> through GDB remote. Of all the approaches, I think it's the most "desirable"
> going forward. The fact that there is a ByteCode Alliance runtime that
> suppo
https://github.com/DavidSpickett deleted
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -323,6 +323,11 @@ ProcessGDBRemote::~ProcessGDBRemote() {
KillDebugserverProcess();
}
+std::shared_ptr
DavidSpickett wrote:
`static`
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing li
DavidSpickett wrote:
> process connect --plugin wasm connect://localhost:4567
On the original review, auto-detection of the plugin wasn't working which meant
this `plugin wasm` was needed. Did you ever find out what was the cause? I
presume lldb still has a local copy of the program file, so i
DavidSpickett wrote:
Also can we get a vague idea of how many more PRs are in the stack for this?
Just so save me asking "why is X missing" over and over.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-commits@list
DavidSpickett wrote:
This is an overly harsh way of phrasing it, but hopefully it gives you an idea
of why I'm asking for an overview of this effort:
* We already have at least one barely tested architecture, I would like to
avoid picking up another one.
I think WASM is cool (all WASM userspac
DavidSpickett wrote:
> I've been told that the runtime can have a different stack (separate from the
> native stack) for the Wasm code and also that the format of call frames may
> not match native stack frame ABI.
Sure, so this is like qemu-user? You want to debug the wasm process being
host
https://github.com/JDevlieghere updated
https://github.com/llvm/llvm-project/pull/150143
>From 1d0ad45e68339fa1da2f7e3fa34826498c21594c Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere
Date: Tue, 22 Jul 2025 16:37:03 -0700
Subject: [PATCH 1/2] [lldb] Add WebAssembly Process Plugin
Extend suppo
@@ -0,0 +1,88 @@
+//===--===//
+//
+// 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: Apac
@@ -0,0 +1,88 @@
+//===--===//
+//
+// 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: Apac
@@ -0,0 +1,88 @@
+//===--===//
+//
+// 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: Apac
@@ -0,0 +1,88 @@
+//===--===//
+//
+// 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: Apac
@@ -0,0 +1,124 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,124 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,124 @@
+//===--===//
+//
+// 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: Apa
@@ -0,0 +1,88 @@
+//===--===//
+//
+// 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: Apac
JDevlieghere wrote:
Tagging @xujuntwt95329, @mh4ck-Thales and @xwang98 who took part in the
discussion in the previous PRs.
https://github.com/llvm/llvm-project/pull/150143
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.o
JDevlieghere wrote:
> How does this relate to / overlap with existing PRs #77949 and #78977? They
> are unlikely to get merged by the authors, so I assume you'll make your own
> equivalent.
I had totally forgotten about those PRs . Yes, they're iterations of the same
patch by @paolosevMSFT (w
DavidSpickett wrote:
How does this relate to / overlap with existing PRs
https://github.com/llvm/llvm-project/pull/77949 and
https://github.com/llvm/llvm-project/pull/78977? They are unlikely to get
merged by the authors, so I assume you'll make your own equivalent.
> qWasmCallStack
This is
77 matches
Mail list logo