Skip to content

Commit 5ea16c0

Browse files
committed
Try gdb patch
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent 22a0644 commit 5ea16c0

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/hyperlight_host/src/hypervisor/hyperlight_vm.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use crate::hypervisor::LinuxInterruptHandle;
4545
#[cfg(crashdump)]
4646
use crate::hypervisor::crashdump;
4747
#[cfg(gdb)]
48-
use crate::hypervisor::gdb::DebugError;
48+
use crate::hypervisor::gdb::{DebugError, DebugMemoryAccessError};
4949
#[cfg(gdb)]
5050
use crate::hypervisor::hyperlight_vm::debug::ProcessDebugRequestError;
5151
use crate::hypervisor::regs::CommonSpecialRegisters;
@@ -838,7 +838,7 @@ impl HyperlightVm {
838838
dbg_mem_access_fn: Arc<Mutex<SandboxMemoryManager<HostSharedMemory>>>,
839839
stop_reason: VcpuStopReason,
840840
) -> std::result::Result<(), HandleDebugError> {
841-
use crate::hypervisor::gdb::{DebugError, DebugMemoryAccess};
841+
use crate::hypervisor::gdb::DebugMemoryAccess;
842842
use crate::hypervisor::hyperlight_vm::debug::ProcessDebugRequestError;
843843

844844
if self.gdb_conn.is_none() {
@@ -893,10 +893,13 @@ impl HyperlightVm {
893893
let result = self.process_dbg_request(req, &mem_access);
894894
match result {
895895
Ok(response) => response,
896-
// Treat non fatal errors separately so the guest doesn't fail
897-
Err(ProcessDebugRequestError::Debug(DebugError::TranslateGva(
898-
_,
899-
))) => DebugResponse::ErrorOccurred,
896+
// Treat non-fatal errors separately so the guest doesn't fail
897+
Err(ProcessDebugRequestError::ReadMemory(
898+
DebugMemoryAccessError::TranslateGuestAddress(_),
899+
))
900+
| Err(ProcessDebugRequestError::Debug(
901+
DebugError::TranslateGva(_),
902+
)) => DebugResponse::ErrorOccurred,
900903
Err(e) => {
901904
log::error!("Error processing debug request: {:?}", e);
902905
return Err(HandleDebugError::ProcessRequest(e));
@@ -937,8 +940,11 @@ impl HyperlightVm {
937940

938941
let response = match result {
939942
Ok(response) => response,
940-
// Treat non fatal errors separately so the guest doesn't fail
941-
Err(ProcessDebugRequestError::Debug(DebugError::TranslateGva(_))) => {
943+
// Treat non-fatal errors separately so the guest doesn't fail
944+
Err(ProcessDebugRequestError::ReadMemory(
945+
DebugMemoryAccessError::TranslateGuestAddress(_),
946+
))
947+
| Err(ProcessDebugRequestError::Debug(DebugError::TranslateGva(_))) => {
942948
DebugResponse::ErrorOccurred
943949
}
944950
Err(e) => {

0 commit comments

Comments
 (0)