Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-5852: Force saved tracking config to be an option.

Dan07105dbc3317
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerTrackLocationTrait.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerTrackLocationTrait.java
index f31c3b4a1b..a75000e3ec 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerTrackLocationTrait.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerTrackLocationTrait.java
@@ -222,13 +222,19 @@ public class DebuggerTrackLocationTrait {
return action;
}
+ protected ActionState<LocationTrackingSpec> makeState(LocationTrackingSpec spec) {
+ return new ActionState<>(spec.getMenuName(), spec.getMenuIcon(), spec);
+ }
+
public List<ActionState<LocationTrackingSpec>> getStates() {
Map<String, ActionState<LocationTrackingSpec>> states = new TreeMap<>();
+ // NOTE: Ensure the saved spec is available, even if no factory produces it, yet.
+ // NOTE: In particular, the DebuggerWatchesPlugin may not read its config before us.
+ states.put(spec.getConfigName(), makeState(spec));
for (LocationTrackingSpec spec : LocationTrackingSpecFactory
.allSuggested(tool)
.values()) {
- states.put(spec.getConfigName(),
- new ActionState<>(spec.getMenuName(), spec.getMenuIcon(), spec));
+ states.put(spec.getConfigName(), makeState(spec));
}
ActionState<LocationTrackingSpec> current = action.getCurrentState();
if (current != null) {