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 fe685d88e5..f271bf3e6d 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 @@ -248,13 +248,19 @@ public class DebuggerTrackLocationTrait { return action; } + protected ActionState makeState(LocationTrackingSpec spec) { + return new ActionState<>(spec.getMenuName(), spec.getMenuIcon(), spec); + } + public List> getStates() { Map> 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 current = action.getCurrentState(); if (current != null) { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc index 88ca8e36c8..f00502ba65 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc @@ -1726,6 +1726,9 @@ Datatype *TypeStruct::nearestArrayedComponentForward(int8 off,int8 *newoff,int8 int8 suboff; Datatype *res = subtype->nearestArrayedComponentForward(remain, &suboff, elSize); if (res != (Datatype *)0) { + int8 subdiff = diff + remain - suboff; + if (subdiff > 128) + break; *newoff = -diff; return subtype; }