File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
src/hyperlight_host/src/hypervisor/gdb Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 1
1
# How to debug a Hyperlight guest
2
2
3
- Currently Hyperlight support gdb debugging of a guest running inside a Hyperlight sandbox.
4
- When the option is enabled Hyperlight starts listening on port ` 8081 ` for a gdb connection.
3
+ Hyperlight supports gdb debugging of a guest running inside a Hyperlight sandbox.
4
+ When Hyperlight is compiled with the ` gdb ` feature enabled, Hyperlight starts listening on port ` 8081 ` for a gdb connection.
5
5
6
6
Note: It will only accept one connection, if the connection is closed, the debug session is also closed.
7
7
@@ -14,7 +14,7 @@ The execution will wait for gdb to attach.
14
14
One can use a simple gdb config to provide the symbols and desired configuration:
15
15
16
16
For the above example, when running from the repository root directory, the below contents
17
- of ` .gdbinit ` file can be used.
17
+ of ` .gdbinit ` file can be used to provide configuration to gdb startup .
18
18
``` gdb
19
19
file src/tests/rust_guests/bin/debug/simpleguest
20
20
target remote :8081
@@ -23,4 +23,6 @@ set disassemble-next-line on
23
23
enable pretty-printer
24
24
layout regs
25
25
layout src
26
- ```
26
+ ```
27
+
28
+ One can find more information about the ` .gdbinit ` file at [ gdbinit(5)] ( https://www.man7.org/linux/man-pages/man5/gdbinit.5.html ) .
Original file line number Diff line number Diff line change @@ -176,7 +176,6 @@ impl HyperlightKvmSandboxTarget {
176
176
177
177
/// Translates the guest address to physical address
178
178
fn translate_gva ( & self , gva : u64 ) -> Result < u64 , GdbTargetError > {
179
- // TODO: Properly handle errors
180
179
let tr = self
181
180
. vcpu_fd
182
181
. lock ( )
Original file line number Diff line number Diff line change @@ -43,11 +43,8 @@ impl From<io::Error> for GdbTargetError {
43
43
}
44
44
45
45
impl From < DebugMessage > for GdbTargetError {
46
- fn from ( value : DebugMessage ) -> Self {
47
- match value {
48
- DebugMessage :: VcpuStoppedEv => GdbTargetError :: UnexpectedMessageError ,
49
- _ => GdbTargetError :: UnexpectedMessageError ,
50
- }
46
+ fn from ( _value : DebugMessage ) -> Self {
47
+ GdbTargetError :: UnexpectedMessageError
51
48
}
52
49
}
53
50
@@ -140,7 +137,6 @@ where
140
137
<T as Target >:: Error :
141
138
std:: fmt:: Debug + Send + From < io:: Error > + From < DebugMessage > + From < TryRecvError > ,
142
139
{
143
- // TODO: Address multiple sandboxes scenario
144
140
let socket = format ! ( "localhost:{}" , 8081 ) ;
145
141
146
142
log:: info!( "Listening on {:?}" , socket) ;
You can’t perform that action at this time.
0 commit comments