Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb][lldb-vscode] Add example configuration for connecting to a remote gdbserver #68866

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

DavidSpickett
Copy link
Collaborator

@DavidSpickett DavidSpickett commented Oct 12, 2023

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.

…ote gdbserver

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.
@llvmbot llvmbot added the lldb label Oct 12, 2023
@DavidSpickett DavidSpickett changed the title [lldb][lldb-vscode] Add example configuration for connecting to a rem… [lldb][lldb-vscode] Add example configuration for connecting to a remote gdbserver Oct 12, 2023
@llvmbot
Copy link
Member

llvmbot commented Oct 12, 2023

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/68866.diff

1 Files Affected:

  • (modified) lldb/tools/lldb-vscode/README.md (+15)
diff --git a/lldb/tools/lldb-vscode/README.md b/lldb/tools/lldb-vscode/README.md
index 6f930293126d53e..e5104adfda07942 100644
--- a/lldb/tools/lldb-vscode/README.md
+++ b/lldb/tools/lldb-vscode/README.md
@@ -212,6 +212,21 @@ This loads the coredump file `/cores/123.core` associated with the program
 }
 ```
 
+### Connect to a Remote Debug Server
+
+This connects to a debug server (e.g. `lldb-server`, `gdbserver`) that is
+debugging the program `/tmp/a.out` and listening locally on port `2345`.
+
+```javascript
+{
+  "name": "Remote Debug Server",
+  "type": "lldb-vscode",
+  "request": "launch",
+  "program": "/tmp/a.out",
+  "launchCommands": ["gdb-remote 2345"],
+}
+```
+
 # Custom debugger commands
 
 The `lldb-vscode` tool includes additional custom commands to support the Debug

@DavidSpickett DavidSpickett merged commit 4606712 into llvm:main Oct 17, 2023
@DavidSpickett DavidSpickett deleted the lldb-vscode-remote branch October 17, 2023 08:01
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Jan 18, 2024
…ote gdbserver (llvm#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.

(cherry picked from commit 4606712)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants