<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/223598>223598</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[lldb][meta] Support building and embedding LLDB under Emscripten
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
anutosh491
</td>
</tr>
</table>
<pre>
Meta-issue to track the work required to build and embed LLDB under an Emscripten host.
This is related to, but distinct from #150449. That issue tracks LLDB support for debugging WebAssembly targets. This issue tracks LLDB itself running under Emscripten—for example, embedding `liblldb`, LLDB's command interpreter and
`lldb-dap` inside a browser application such as [WasmBolt](https://github.com/anutosh491/WasmBolt) (try [here](https://anutosh21.github.io/WasmBolt/))
## Current prototype
The browser-hosted prototype can currently:
- build and load `liblldb` under Emscripten;
- inspect Wasm symbols, DWARF source information and disassembly through the
SB API;
- connect LLDB's existing `ProcessWasm` support to an in-process WAMR runtime;
- set breakpoints, inspect local variables, step and continue;
- drive the same session through LLDB's command interpreter and `lldb-dap`.
These experiments are currently downstream prototypes. The patches below are intended to make the underlying LLDB build and host abstractions cleanly support this use case upstream. See demos below
https://github.com/user-attachments/assets/ff73f87f-0f9e-422a-aaba-5af6daa4bbb1
https://github.com/user-attachments/assets/2e35e88e-142c-4b69-a40c-5a943ead158c
## Upstream patch series
The patches should be reviewed and merged in this order:
- [ ] #223169 — `[lldb] Add HostInfoEmscripten`
- [ ] #223200 — `[lldb] Add PlatformEmscripten`
- [ ] #223206 — `[lldb] Support building lldbHost under Emscripten`
- [ ] #223210 — `[lldb] Add an option to build liblldb statically`
#223162 was the initial bootstrap that selected `PlatformLinux` as the Emscripten host platform. It is superseded by the dedicated
`HostInfoEmscripten` and `PlatformEmscripten` split above and is not intended to remain part of the final series.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVk9v2z4S_TT0ZWBDpv7YOvhgNw22QA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