llvm / llvm/llvm-project

[lldb][meta] Support building and embedding LLDB under Emscripten

Open
#223,598 1 comment 0 reactions 0 assignees View on GitHub
lldb metaissue
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

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:

- [x] #223169 — `[lldb] Add HostInfoEmscripten`
- [x] #223200 — `[lldb] Add PlatformEmscripten`
- [x] #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.

Contributor guide

Open the contributing guide

Research direction

Start by reading the four upstream issues in the listed order: #223169, #223200, #223206, and #223210. Use the prototype description and each issue's proposed patch as the entry points; the meta-issue is complete when the Emscripten host and platform support, lldbHost build, and static liblldb option are upstreamed.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
build-system, compilers, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.