[Lldb-commits] [lldb] 4606712 - [lldb][lldb-vscode] Add example configuration for connecting to a remote gdbserver (#68866)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 17 01:01:11 PDT 2023
Author: David Spickett
Date: 2023-10-17T09:01:07+01:00
New Revision: 4606712ef5b422edbe3799b665dcad7dcf348b90
URL: https://github.com/llvm/llvm-project/commit/4606712ef5b422edbe3799b665dcad7dcf348b90
DIFF: https://github.com/llvm/llvm-project/commit/4606712ef5b422edbe3799b665dcad7dcf348b90.diff
LOG: [lldb][lldb-vscode] Add example configuration for connecting to a remote gdbserver (#68866)
This can be used to have VS Code debug various emulators, remote
systems, hardware probes, etc.
In my case I was doing this for the Gameboy Advance,
https://github.com/stuij/gba-llvm-devkit/blob/main/docs/Debugging.md#debugging-using-visual-studio-code.
It's not very complex if you know LLDB well, but when using another
plugin, CodeLLDB, I was very glad that they had an example for it. So we
should have one too.
Added:
Modified:
lldb/tools/lldb-vscode/README.md
Removed:
################################################################################
diff --git a/lldb/tools/lldb-vscode/README.md b/lldb/tools/lldb-vscode/README.md
index 6f930293126d53e..078129026cb0cc9 100644
--- a/lldb/tools/lldb-vscode/README.md
+++ b/lldb/tools/lldb-vscode/README.md
@@ -212,6 +212,38 @@ This loads the coredump file `/cores/123.core` associated with the program
}
```
+### Connect to a Debug Server on the Current Machine
+
+This connects to a debug server (e.g. `lldb-server`, `gdbserver`) on
+the current machine, that is debugging the program `/tmp/a.out` and listening
+locally on port `2345`.
+
+```javascript
+{
+ "name": "Local Debug Server",
+ "type": "lldb-vscode",
+ "request": "attach",
+ "program": "/tmp/a.out",
+ "attachCommands": ["gdb-remote 2345"],
+}
+```
+
+### Connect to a Debug Server on Another Machine
+
+This connects to a debug server running on another machine with hostname
+`hostnmame`. Which is debugging the program `/tmp/a.out` and listening on
+port `5678` of that other machine.
+
+```javascript
+{
+ "name": "Remote Debug Server",
+ "type": "lldb-vscode",
+ "request": "attach",
+ "program": "/tmp/a.out",
+ "attachCommands": ["gdb-remote hostname:5678"],
+}
+```
+
# Custom debugger commands
The `lldb-vscode` tool includes additional custom commands to support the Debug
More information about the lldb-commits
mailing list