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

dbg: update guest debugging docs to explain how to use lldb in vscode #334

Merged
merged 2 commits into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions docs/how-to-debug-a-hyperlight-guest.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,24 @@ $ gdb
### Using VSCode to debug a Hyperlight guest

To replicate the above behavior using VSCode follow the below steps:
- install the `gdb` package on the host machine
- install the `C/C++` extension in VSCode to add debugging capabilities
- To use gdb:
1. install the `gdb` package on the host machine
2. install the [C/C++ Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack) extension in VSCode to add debugging capabilities
- To use lldb:
1. install `lldb` on the host machine
2. install the [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) extension in VSCode to add debugging capabilities
- create a `.vscode/launch.json` file in the project directory with the below content:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "LLDB",
"type": "lldb",
"request": "launch",
"targetCreateCommands": ["target create ${workspaceFolder}/src/tests/rust_guests/bin/debug/simpleguest"],
"processCreateCommands": ["gdb-remote localhost:8080"]
},
{
"name": "GDB",
"type": "cppdbg",
Expand Down Expand Up @@ -122,9 +133,9 @@ To replicate the above behavior using VSCode follow the below steps:
]
}
```
- in `Run and Debug` tab, select the `GDB` configuration and click on the `Run`
- in `Run and Debug` tab, select either `GDB` or `LLDB` configuration and click on the `Run`
button to start the debugging session.
The gdb client will connect to the Hyperlight sandbox and the guest vCPU will
The debugger will connect to the Hyperlight sandbox and the guest vCPU will
stop at the entry point.


Expand Down