Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-3073: Fixes NPE in Listing, while working GP-3046

Dan1ffbcb422a23
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java
index 4e28d97e85..66d215257f 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java
@@ -747,7 +747,8 @@ public class DebuggerListingProvider extends CodeViewerProvider {
if (gotoProgram != getProgram()) {
doSetProgram(gotoProgram);
}
- if (!gotoProgram.getMemory().contains(location.getAddress())) {
+ if (gotoProgram == null ||
+ !gotoProgram.getMemory().contains(location.getAddress())) {
return false;
}
if (super.goTo(gotoProgram, location)) {
diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProviderTest.java
index 7b93305433..b7eb9ab11d 100644
--- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProviderTest.java
+++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProviderTest.java
@@ -803,4 +803,18 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
assertTrue(LongLongDataType.dataType.isEquivalent(rRow0.getDataType()));
assertEquals(FormatSettingsDefinition.DECIMAL, format.getChoice(rRow0.getSettings()));
}
+
+ @Test
+ public void testTraceClosure() throws Throwable {
+ setRegisterValues(thread);
+ watchesProvider.addWatch("r0");
+ watchesProvider.addWatch("*:8 r0");
+
+ traceManager.openTrace(tb.trace);
+ waitForSwing();
+
+ tb.close();
+ traceManager.activateThread(thread);
+ traceManager.closeTrace(tb.trace);
+ }
}