Skip to content

Commit 56a2912

Browse files
committed
Use box now that the enum contains xmm registers which are large
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 5fe77e8 commit 56a2912

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

src/hyperlight_host/examples/guest-debugging/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ mod tests {
104104
use std::io;
105105
use std::process::{Command, Stdio};
106106
use std::time::Duration;
107+
use serial_test::serial;
107108

108109
use hyperlight_host::{Result, new_error};
109110
use io::{BufReader, BufWriter, Read, Write};

src/hyperlight_host/src/hypervisor/gdb/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub(crate) enum DebugMsg {
142142
RemoveSwBreakpoint(u64),
143143
Step,
144144
WriteAddr(u64, Vec<u8>),
145-
WriteRegisters(X86_64Regs),
145+
WriteRegisters(Box<X86_64Regs>),
146146
}
147147

148148
/// Enumerates the possible responses that a hypervisor can provide to a debugger
@@ -157,7 +157,7 @@ pub(crate) enum DebugResponse {
157157
NotAllowed,
158158
InterruptHandle(Arc<dyn InterruptHandle>),
159159
ReadAddr(Vec<u8>),
160-
ReadRegisters(X86_64Regs),
160+
ReadRegisters(Box<X86_64Regs>),
161161
RemoveHwBreakpoint(bool),
162162
RemoveSwBreakpoint(bool),
163163
Step,
@@ -451,7 +451,7 @@ mod tests {
451451
let res = gdb_conn.try_recv();
452452
assert!(res.is_err());
453453

454-
let res = hyp_conn.send(DebugResponse::ReadRegisters(X86_64Regs::default()));
454+
let res = hyp_conn.send(DebugResponse::ReadRegisters(Box::default()));
455455
assert!(res.is_ok());
456456

457457
let res = gdb_conn.recv();

src/hyperlight_host/src/hypervisor/gdb/x86_64_target.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl SingleThreadBase for HyperlightSandboxTarget {
273273
mxcsr: regs.mxcsr,
274274
};
275275

276-
match self.send_command(DebugMsg::WriteRegisters(regs))? {
276+
match self.send_command(DebugMsg::WriteRegisters(Box::new(regs)))? {
277277
DebugResponse::WriteRegisters => Ok(()),
278278
DebugResponse::NotAllowed => {
279279
log::error!("Action not allowed at this time, crash might have occurred");
@@ -486,7 +486,7 @@ mod tests {
486486

487487
// Check response to read registers - send the response first to not be blocked
488488
// by the recv call in the target
489-
let msg = DebugResponse::ReadRegisters(X86_64Regs::default());
489+
let msg = DebugResponse::ReadRegisters(Box::default());
490490
let res = gdb_conn.send(msg);
491491
assert!(res.is_ok());
492492

src/hyperlight_host/src/hypervisor/hyperv_linux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ mod debug {
202202

203203
e
204204
})
205-
.map(|_| DebugResponse::ReadRegisters(regs))
205+
.map(|_| DebugResponse::ReadRegisters(Box::new(regs)))
206206
}
207207
DebugMsg::RemoveHwBreakpoint(addr) => Ok(DebugResponse::RemoveHwBreakpoint(
208208
debug

src/hyperlight_host/src/hypervisor/hyperv_windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ mod debug {
185185

186186
e
187187
})
188-
.map(|_| DebugResponse::ReadRegisters(regs))
188+
.map(|_| DebugResponse::ReadRegisters(Box::new(regs)))
189189
}
190190
DebugMsg::RemoveHwBreakpoint(addr) => Ok(DebugResponse::RemoveHwBreakpoint(
191191
debug

src/hyperlight_host/src/hypervisor/kvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ mod debug {
194194

195195
e
196196
})
197-
.map(|_| DebugResponse::ReadRegisters(regs))
197+
.map(|_| DebugResponse::ReadRegisters(Box::new(regs)))
198198
}
199199
DebugMsg::RemoveHwBreakpoint(addr) => Ok(DebugResponse::RemoveHwBreakpoint(
200200
debug

0 commit comments

Comments
 (0)