-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add information on how to setup debugging
Signed-off-by: Doru Blânzeanu <[email protected]>
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# How to debug a Hyperlight guest | ||
|
||
Currently Hyperlight support gdb debugging of a guest running inside a Hyperlight sandbox. | ||
When the option is enabled Hyperlight starts listening on port `8081` for a gdb connection. | ||
|
||
Note: It will only accept one connection, if the connection is closed, the debug session is also closed. | ||
|
||
## Example | ||
```bash | ||
cargo run --example hello-world --features gdb | ||
``` | ||
The execution will wait for gdb to attach. | ||
|
||
One can use a simple gdb config to provide the symbols and desired configuration: | ||
|
||
For the above example, when running from the repository root directory, the below contents | ||
of `.gdbinit` file can be used. | ||
```gdb | ||
file src/tests/rust_guests/bin/debug/simpleguest | ||
target remote :8081 | ||
set disassembly-flavor intel | ||
set disassemble-next-line on | ||
enable pretty-printer | ||
layout regs | ||
layout src | ||
``` |