Skip to content

Commit 4606712

Browse files
[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.
1 parent cbf7d5f commit 4606712

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lldb/tools/lldb-vscode/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,38 @@ This loads the coredump file `/cores/123.core` associated with the program
212212
}
213213
```
214214

215+
### Connect to a Debug Server on the Current Machine
216+
217+
This connects to a debug server (e.g. `lldb-server`, `gdbserver`) on
218+
the current machine, that is debugging the program `/tmp/a.out` and listening
219+
locally on port `2345`.
220+
221+
```javascript
222+
{
223+
"name": "Local Debug Server",
224+
"type": "lldb-vscode",
225+
"request": "attach",
226+
"program": "/tmp/a.out",
227+
"attachCommands": ["gdb-remote 2345"],
228+
}
229+
```
230+
231+
### Connect to a Debug Server on Another Machine
232+
233+
This connects to a debug server running on another machine with hostname
234+
`hostnmame`. Which is debugging the program `/tmp/a.out` and listening on
235+
port `5678` of that other machine.
236+
237+
```javascript
238+
{
239+
"name": "Remote Debug Server",
240+
"type": "lldb-vscode",
241+
"request": "attach",
242+
"program": "/tmp/a.out",
243+
"attachCommands": ["gdb-remote hostname:5678"],
244+
}
245+
```
246+
215247
# Custom debugger commands
216248

217249
The `lldb-vscode` tool includes additional custom commands to support the Debug

0 commit comments

Comments
 (0)