Skip to content

Commit d03381c

Browse files
authored
dbg: update guest debugging docs to explain how to use lldb in vscode (#334)
Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent 9b37e49 commit d03381c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docs/how-to-debug-a-hyperlight-guest.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,24 @@ $ gdb
8585
### Using VSCode to debug a Hyperlight guest
8686

8787
To replicate the above behavior using VSCode follow the below steps:
88-
- install the `gdb` package on the host machine
89-
- install the `C/C++` extension in VSCode to add debugging capabilities
88+
- To use gdb:
89+
1. install the `gdb` package on the host machine
90+
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
91+
- To use lldb:
92+
1. install `lldb` on the host machine
93+
2. install the [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) extension in VSCode to add debugging capabilities
9094
- create a `.vscode/launch.json` file in the project directory with the below content:
9195
```json
9296
{
9397
"version": "0.2.0",
9498
"configurations": [
99+
{
100+
"name": "LLDB",
101+
"type": "lldb",
102+
"request": "launch",
103+
"targetCreateCommands": ["target create ${workspaceFolder}/src/tests/rust_guests/bin/debug/simpleguest"],
104+
"processCreateCommands": ["gdb-remote localhost:8080"]
105+
},
95106
{
96107
"name": "GDB",
97108
"type": "cppdbg",
@@ -122,9 +133,9 @@ To replicate the above behavior using VSCode follow the below steps:
122133
]
123134
}
124135
```
125-
- in `Run and Debug` tab, select the `GDB` configuration and click on the `Run`
136+
- in `Run and Debug` tab, select either `GDB` or `LLDB` configuration and click on the `Run`
126137
button to start the debugging session.
127-
The gdb client will connect to the Hyperlight sandbox and the guest vCPU will
138+
The debugger will connect to the Hyperlight sandbox and the guest vCPU will
128139
stop at the entry point.
129140

130141

0 commit comments

Comments
 (0)