Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-1142: Catching error and returning empty map, allowing default logic.

Dance073cd0f688
diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java
index f48070cb56..d1a62a11f0 100644
--- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java
+++ b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java
@@ -106,7 +106,10 @@ public class GdbModelTargetProcessMemory
setElements(List.of(), "Refreshed (while no process)");
return AsyncUtils.NIL;
}
- return inferior.listMappings().thenAccept(this::updateUsingMappings);
+ return inferior.listMappings().exceptionally(ex -> {
+ Msg.error(this, "Could not list regions", ex);
+ return Map.of(); // empty map will be replaced with default
+ }).thenAccept(this::updateUsingMappings);
}
protected synchronized GdbModelTargetMemoryRegion getTargetRegion(GdbMemoryMapping mapping) {