Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cd52599

Browse files
committedFeb 5, 2025
[lldb-dap] Support vscode launch URLs
This commit adds support for starting debug sessions through special `vscode://llvm-vs-code-extensions.lldb-dap/launch/config?config={launch-config}` URIs. This allows tighter integration with custom scripts. One potential use case is providing similar functionality to `xcdebug`, see llvm#125777 for some discussion on that use case. The functionality was inspired by @vadimcn's CodeLLDB extension, which [provides similar functionality](https://github.com/vadimcn/codelldb/blob/master/MANUAL.md#debugging-externally-launched-code).
1 parent 439de72 commit cd52599

File tree

5 files changed

+1505
-199
lines changed

5 files changed

+1505
-199
lines changed
 

‎lldb/tools/lldb-dap/README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,20 @@ The default hostname being used `localhost`.
174174
}
175175
```
176176

177+
### Launching via `vscode://` URIs
178+
179+
Debugging sessions can also be starting using special URIs.
180+
181+
The `vscode://llvm-vs-code-extensions.lldb-dap/launch/config?config={launch-config}`
182+
URI accepts a [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding)
183+
JSON launch config.
184+
185+
This is useful, e.g., to integrate with custom scripts which start debugging
186+
sessions. The URIs might be printed to the terminal, potentially using
187+
[OSC-8 hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda),
188+
or passed to `vscode --open-url` or `xdg-open`, although mileage may vary
189+
depending on your specific debugging setup.
190+
177191
### Configuration Settings Reference
178192

179193
For both launch and attach configurations, lldb-dap accepts the following `lldb-dap`
@@ -328,4 +342,4 @@ The source code is part of the [LLVM repository](https://github.com/llvm/llvm-pr
328342
We use Github's [issue tracker](https://github.com/llvm/llvm-project/issues?q=label%3Alldb-dap) and patches can be submitted via [pull requests](https://github.com/llvm/llvm-project/pulls?q=label%3Alldb-dap).
329343
Furthermore, there is a [LLDB category](https://discourse.llvm.org/c/subprojects/lldb/8) on the LLVM discourse forum.
330344

331-
For instructions on how to get started with development on lldb-dap, see the "[Contributing to lldb-dap](https://lldb.llvm.org/resources/lldbdap.html)"
345+
For instructions on how to get started with development on lldb-dap, see the "[Contributing to lldb-dap](https://lldb.llvm.org/resources/lldbdap.html)" guide.

0 commit comments

Comments
 (0)
Please sign in to comment.