Ghidra is a software reverse engineering (SRE) framework
GP-2850: Let the theme handle color changes (GColor, not AutoOption)
Dan7731f9d9e4a3
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.javaindex e8d7214914..278a317c25 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java@@ -273,52 +273,18 @@ public interface DebuggerResources {String BOOKMARK_CATEGORY_MEMORY_READ_ERROR = "Debugger Memory Read Error";- String OPTION_NAME_COLORS_STALE_MEMORY = "Colors.Stale Memory";- GColor DEFAULT_COLOR_BACKGROUND_STALE = new GColor("color.bg.debugger.plugin.resources.stale");-- String OPTION_NAME_COLORS_ERROR_MEMORY = "Colors.Error Memory";- Color DEFAULT_COLOR_BACKGROUND_ERROR = new GColor("color.bg.debugger.plugin.resources.error");+ GColor COLOR_BACKGROUND_STALE = new GColor("color.bg.debugger.plugin.resources.stale");+ Color COLOR_BACKGROUND_ERROR = new GColor("color.bg.debugger.plugin.resources.error");int PRIORITY_REGISTER_MARKER = 10;- String OPTION_NAME_COLORS_TRACKING_MARKERS = "Colors.Tracking Markers";- Color DEFAULT_COLOR_REGISTER_MARKERS =- new GColor("color.debugger.plugin.resources.register.marker");+ Color COLOR_REGISTER_MARKERS = new GColor("color.debugger.plugin.resources.register.marker");Icon ICON_REGISTER_MARKER = new GIcon("icon.debugger.marker.register");- Icon ICON_EVENT_MARKER = new GIcon("icon.debugger.marker.event"); // TODO: Another icon?- // At least rename to "marker-arrow", and then have both ref it.-- //@formatter:off- String OPTION_NAME_COLORS_REGISTER_STALE = "Colors.Stale Registers";- Color DEFAULT_COLOR_REGISTER_STALE = new GColor("color.debugger.plugin.resources.register.stale");- String OPTION_NAME_COLORS_REGISTER_STALE_SEL = "Colors.Stale Registers (selected)";- Color DEFAULT_COLOR_REGISTER_STALE_SEL = new GColor("color.debugger.plugin.resources.register.stale.selected");- String OPTION_NAME_COLORS_REGISTER_CHANGED = "Colors.Changed Registers";- Color DEFAULT_COLOR_REGISTER_CHANGED = new GColor("color.debugger.plugin.resources.register.changed");- String OPTION_NAME_COLORS_REGISTER_CHANGED_SEL = "Colors.Changed Registers (selected)";- Color DEFAULT_COLOR_REGISTER_CHANGED_SEL = new GColor("color.debugger.plugin.resources.register.changed.selected");- //@formatter:on-- //@formatter:off- String OPTION_NAME_COLORS_WATCH_STALE = "Colors.Stale Watches";- Color DEFAULT_COLOR_WATCH_STALE = new GColor("color.debugger.plugin.resources.watch.stale");- String OPTION_NAME_COLORS_WATCH_STALE_SEL = "Colors.Stale Watches (selected)";- Color DEFAULT_COLOR_WATCH_STALE_SEL = new GColor("color.debugger.plugin.resources.watch.stale.selected");- String OPTION_NAME_COLORS_WATCH_CHANGED = "Colors.Changed Watches";- Color DEFAULT_COLOR_WATCH_CHANGED = new GColor("color.debugger.plugin.resources.watch.changed");- String OPTION_NAME_COLORS_WATCH_CHANGED_SEL = "Colors.Changed Watches (selected)";- Color DEFAULT_COLOR_WATCH_CHANGED_SEL = new GColor("color.debugger.plugin.resources.watch.changed.selected");- //@formatter:on-- //@formatter:off- String OPTION_NAME_COLORS_VALUE_CHANGED = "Colors.Changed Values";- Color DEFAULT_COLOR_VALUE_CHANGED = new GColor("color.debugger.plugin.resources.value.changed");- String OPTION_NAME_COLORS_VALUE_CHANGED_SEL = "Colors.Changed Values (selected)";- Color DEFAULT_COLOR_VALUE_CHANGED_SEL = new GColor("color.debugger.plugin.resources.value.changed.selected");- //@formatter:on-- String OPTION_NAME_COLORS_PCODE_COUNTER = "Colors.Pcode Counter";- Color DEFAULT_COLOR_PCODE_COUNTER = new GColor("color.debugger.plugin.resources.pcode.counter");+ Icon ICON_EVENT_MARKER = new GIcon("icon.debugger.marker.event");++ Color COLOR_VALUE_CHANGED = new GColor("color.debugger.plugin.resources.value.changed");+ Color COLOR_VALUE_CHANGED_SEL =+ new GColor("color.debugger.plugin.resources.value.changed.selected");String NAME_BREAKPOINT_MARKER_ENABLED = "Enabled Breakpoint";String NAME_BREAKPOINT_MARKER_DISABLED = "Disabled Breakpoint";@@ -355,17 +321,6 @@ public interface DebuggerResources {Icon ICON_UNIQUE_REF_WRITE = new GIcon("icon.debugger.unique.ref.write"); // TODOIcon ICON_UNIQUE_REF_RW = new MultiIcon(ICON_UNIQUE_REF_READ, ICON_UNIQUE_REF_WRITE); // TODO- //@formatter:off- String OPTION_NAME_COLORS_ENABLED_BREAKPOINT_MARKERS = "Colors.Enabled Breakpoint Markers";- Color DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.enabled");- String OPTION_NAME_COLORS_DISABLED_BREAKPOINT_MARKERS = "Colors.Disabled Breakpoint Markers";- Color DEFAULT_COLOR_DISABLED_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.disabled");- String OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_MARKERS = "Colors.Ineffective Enabled Breakpoint Markers";- Color DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective");- String OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_MARKERS = "Colors.Ineffective Disabled Breakpoint Markers";- Color DEFAULT_COLOR_INEFF_DIS_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.disabled.ineffective");- //@formatter:on-String OPTION_NAME_COLORS_ENABLED_BREAKPOINT_COLORING_BACKGROUND ="Colors.Enabled Breakpoint Markers Have Background";boolean DEFAULT_COLOR_ENABLED_BREAKPOINT_COLORING_BACKGROUND = true;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.javaindex 094d4af1cb..3d6d97e3f8 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@@ -37,9 +37,7 @@ import ghidra.app.plugin.core.debug.gui.listing.DebuggerTrackedRegisterListingBaimport ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;import ghidra.app.util.viewer.listingpanel.ListingPanel;import ghidra.async.AsyncUtils;-import ghidra.framework.options.AutoOptions;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.AutoOptionConsumed;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoConfigStateField;import ghidra.program.util.ProgramLocation;@@ -88,10 +86,6 @@ public class DebuggerTrackLocationTrait {// TODO: This may already be deprecated....protected class ColorModel extends DebuggerTrackedRegisterBackgroundColorModel {- public ColorModel() {- super(plugin);- }-@Overrideprotected ProgramLocation getTrackedLocation() {return trackedLocation;@@ -100,9 +94,8 @@ public class DebuggerTrackLocationTrait {protected class ListingColorModelextends DebuggerTrackedRegisterListingBackgroundColorModel {-public ListingColorModel(ListingPanel listingPanel) {- super(plugin, listingPanel);+ super(listingPanel);}@Override@@ -112,14 +105,7 @@ public class DebuggerTrackLocationTrait {}protected class TrackSelectionGenerator implements SelectionGenerator {- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_TRACKING_MARKERS)- private Color trackingColor = DebuggerResources.DEFAULT_COLOR_REGISTER_MARKERS;- @SuppressWarnings("unused")- private final AutoOptions.Wiring autoOptionsWiring;-- public TrackSelectionGenerator() {- autoOptionsWiring = AutoOptions.wireOptions(plugin, this);- }+ private final Color trackingColor = DebuggerResources.COLOR_REGISTER_MARKERS;@Overridepublic void addSelections(BigInteger layoutIndex, SelectionTranslator translator,diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointMarkerPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointMarkerPlugin.javaindex f6bfaef5ce..a80b230451 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointMarkerPlugin.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointMarkerPlugin.java@@ -28,6 +28,7 @@ import docking.ActionContext;import docking.Tool;import docking.action.*;import docking.actions.PopupActionProvider;+import generic.theme.GColor;import ghidra.app.context.ProgramLocationActionContext;import ghidra.app.decompiler.*;import ghidra.app.decompiler.component.margin.LineNumberDecompilerMarginProvider;@@ -81,6 +82,15 @@ import ghidra.util.Msg;public class DebuggerBreakpointMarkerPlugin extends Pluginimplements PopupActionProvider {+ private static final Color COLOR_BREAKPOINT_ENABLED_MARKER =+ new GColor("color.debugger.plugin.resources.breakpoint.marker.enabled");+ private static final Color COLOR_BREAKPOINT_DISABLED_MARKER =+ new GColor("color.debugger.plugin.resources.breakpoint.marker.disabled");+ private static final Color COLOR_BREAKPOINT_INEFF_EN_MARKER =+ new GColor("color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective");+ private static final Color COLOR_BREAKPOINT_INEFF_DIS_MARKER =+ new GColor("color.debugger.plugin.resources.breakpoint.marker.disabled.ineffective");+protected static ProgramLocation getSingleLocationFromContext(ActionContext context) {if (context == null) {return null;@@ -291,11 +301,11 @@ public class DebuggerBreakpointMarkerPlugin extends Pluginprotected Color colorForState(State state) {return state.isEnabled()? state.isEffective()- ? breakpointEnabledMarkerColor- : breakpointIneffEnMarkerColor+ ? COLOR_BREAKPOINT_ENABLED_MARKER+ : COLOR_BREAKPOINT_INEFF_EN_MARKER: state.isEffective()- ? breakpointDisabledMarkerColor- : breakpointIneffDisMarkerColor;+ ? COLOR_BREAKPOINT_DISABLED_MARKER+ : COLOR_BREAKPOINT_INEFF_DIS_MARKER;}protected boolean stateColorsBackground(State state) {@@ -376,12 +386,10 @@ public class DebuggerBreakpointMarkerPlugin extends Pluginif (!(program instanceof TraceProgramView)) {BookmarkManager manager = program.getBookmarkManager();manager.defineType(LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE,- DebuggerResources.ICON_BLANK,- DebuggerResources.DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS,+ DebuggerResources.ICON_BLANK, COLOR_BREAKPOINT_ENABLED_MARKER,MarkerService.BREAKPOINT_PRIORITY - 1);manager.defineType(LogicalBreakpoint.BREAKPOINT_DISABLED_BOOKMARK_TYPE,- DebuggerResources.ICON_BLANK,- DebuggerResources.DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS,+ DebuggerResources.ICON_BLANK, COLOR_BREAKPOINT_DISABLED_MARKER,MarkerService.BREAKPOINT_PRIORITY - 1);}@@ -403,42 +411,6 @@ public class DebuggerBreakpointMarkerPlugin extends PlugincolorForState(state), state.icon, true);}- public void setEnabledMarkerColor(Color color) {- for (State state : State.values()) {- if (state == State.NONE || !state.isEnabled() || !state.isEffective()) {- continue;- }- getMarkerSet(state).setMarkerColor(color);- }- }-- public void setDisabledMarkerColor(Color color) {- for (State state : State.values()) {- if (state == State.NONE || state.isEnabled() || !state.isEffective()) {- continue;- }- getMarkerSet(state).setMarkerColor(color);- }- }-- public void setIneffectiveEnabledMarkerColor(Color color) {- for (State state : State.values()) {- if (state == State.NONE || !state.isEnabled() || state.isEffective()) {- continue;- }- getMarkerSet(state).setMarkerColor(color);- }- }-- public void setIneffectiveDisabledMarkerColor(Color color) {- for (State state : State.values()) {- if (state == State.NONE || state.isEnabled() || state.isEffective()) {- continue;- }- getMarkerSet(state).setMarkerColor(color);- }- }-public void setEnabledColoringBackground(boolean coloringBackground) {for (State state : State.values()) {if (state == State.NONE || !state.isEnabled() || !state.isEffective()) {@@ -753,13 +725,6 @@ public class DebuggerBreakpointMarkerPlugin extends Plugin@SuppressWarnings("unused")private final AutoService.Wiring autoServiceWiring;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_ENABLED_BREAKPOINT_MARKERS, //- description = "Background color for memory at an enabled breakpoint", //- help = @HelpInfo(anchor = "colors"))- private Color breakpointEnabledMarkerColor =- DebuggerResources.DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS;-@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_ENABLED_BREAKPOINT_COLORING_BACKGROUND, //description = "Whether or not to color background for memory at an enabled breakpoint", //@@ -767,13 +732,6 @@ public class DebuggerBreakpointMarkerPlugin extends Pluginprivate boolean breakpointEnabledColoringBackground =DebuggerResources.DEFAULT_COLOR_ENABLED_BREAKPOINT_COLORING_BACKGROUND;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_DISABLED_BREAKPOINT_MARKERS, //- description = "Background color for memory at a disabled breakpoint", //- help = @HelpInfo(anchor = "colors"))- private Color breakpointDisabledMarkerColor =- DebuggerResources.DEFAULT_COLOR_DISABLED_BREAKPOINT_MARKERS;-@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_DISABLED_BREAKPOINT_COLORING_BACKGROUND, //description = "Whether or not to color background for memory at a disabled breakpoint", //@@ -781,13 +739,6 @@ public class DebuggerBreakpointMarkerPlugin extends Pluginprivate boolean breakpointDisabledColoringBackground =DebuggerResources.DEFAULT_COLOR_DISABLED_BREAKPOINT_COLORING_BACKGROUND;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_MARKERS, //- description = "Background color for memory at an enabled, but ineffective, breakpoint", //- help = @HelpInfo(anchor = "colors"))- private Color breakpointIneffEnMarkerColor =- DebuggerResources.DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS;-@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_COLORING_BACKGROUND, //description = "Whether or not to color background for memory at an enabled, but ineffective, breakpoint", //@@ -795,13 +746,6 @@ public class DebuggerBreakpointMarkerPlugin extends Pluginprivate boolean breakpointIneffEnColoringBackground =DebuggerResources.DEFAULT_COLOR_INEFF_EN_BREAKPOINT_COLORING_BACKGROUND;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_MARKERS, //- description = "Background color for memory at an disabled, but ineffective, breakpoint", //- help = @HelpInfo(anchor = "colors"))- private Color breakpointIneffDisMarkerColor =- DebuggerResources.DEFAULT_COLOR_INEFF_DIS_BREAKPOINT_MARKERS;-@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_COLORING_BACKGROUND, //description = "Whether or not to color background for memory at an disabled, but ineffective, breakpoint", //@@ -854,13 +798,6 @@ public class DebuggerBreakpointMarkerPlugin extends PlugincreateActions();}- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_ENABLED_BREAKPOINT_MARKERS)- private void setEnabledBreakpointMarkerColor(Color breakpointMarkerColor) {- for (BreakpointMarkerSets markers : markersByProgram.values()) {- markers.setEnabledMarkerColor(breakpointMarkerColor);- }- }-@AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_ENABLED_BREAKPOINT_COLORING_BACKGROUND)private void setEnabledBreakpointMarkerBackground(boolean breakpointColoringBackground) {@@ -869,13 +806,6 @@ public class DebuggerBreakpointMarkerPlugin extends Plugin}}- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_DISABLED_BREAKPOINT_MARKERS)- private void setDisabledBreakpointMarkerColor(Color breakpointMarkerColor) {- for (BreakpointMarkerSets markers : markersByProgram.values()) {- markers.setDisabledMarkerColor(breakpointMarkerColor);- }- }-@AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_DISABLED_BREAKPOINT_COLORING_BACKGROUND)private void setDisabledBreakpointMarkerBackground(boolean breakpointColoringBackground) {@@ -884,14 +814,6 @@ public class DebuggerBreakpointMarkerPlugin extends Plugin}}- @AutoOptionConsumed(- name = DebuggerResources.OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_MARKERS)- private void setIneffectiveEBreakpointMarkerColor(Color breakpointMarkerColor) {- for (BreakpointMarkerSets markers : markersByProgram.values()) {- markers.setIneffectiveEnabledMarkerColor(breakpointMarkerColor);- }- }-@AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_COLORING_BACKGROUND)private void setIneffectiveEBreakpointMarkerBackground(boolean breakpointColoringBackground) {@@ -900,14 +822,6 @@ public class DebuggerBreakpointMarkerPlugin extends Plugin}}- @AutoOptionConsumed(- name = DebuggerResources.OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_MARKERS)- private void setIneffectiveDBreakpointMarkerColor(Color breakpointMarkerColor) {- for (BreakpointMarkerSets markers : markersByProgram.values()) {- markers.setIneffectiveDisabledMarkerColor(breakpointMarkerColor);- }- }-@AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_COLORING_BACKGROUND)private void setIneffectiveDBreakpointMarkerBackground(boolean breakpointColoringBackground) {diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/colors/DebuggerTrackedRegisterBackgroundColorModel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/colors/DebuggerTrackedRegisterBackgroundColorModel.javaindex 3129e0d6af..ca2b691d15 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/colors/DebuggerTrackedRegisterBackgroundColorModel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/colors/DebuggerTrackedRegisterBackgroundColorModel.java@@ -21,9 +21,6 @@ import java.math.BigInteger;import docking.widgets.fieldpanel.support.BackgroundColorModel;import ghidra.app.plugin.core.debug.gui.DebuggerResources;import ghidra.app.util.viewer.util.AddressIndexMap;-import ghidra.framework.options.AutoOptions;-import ghidra.framework.options.annotation.AutoOptionConsumed;-import ghidra.framework.plugintool.Plugin;import ghidra.program.model.address.Address;import ghidra.program.model.listing.Program;import ghidra.program.util.ProgramLocation;@@ -33,15 +30,7 @@ public abstract class DebuggerTrackedRegisterBackgroundColorModel implements Bacprotected Program program;protected AddressIndexMap addressIndexMap;- // TODO: Seems I should at least rename this option- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_TRACKING_MARKERS)- Color trackingColor = DebuggerResources.DEFAULT_COLOR_REGISTER_MARKERS;- @SuppressWarnings("unused")- private final AutoOptions.Wiring autoOptionsWiring;-- public DebuggerTrackedRegisterBackgroundColorModel(Plugin plugin) {- autoOptionsWiring = AutoOptions.wireOptions(plugin, this);- }+ private final Color trackingColor = DebuggerResources.COLOR_REGISTER_MARKERS;/*** Get the location which is to be highlighted as "tracked."diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.javaindex cdcf982555..b8e224a785 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.java@@ -96,9 +96,9 @@ public class DebuggerCopyPlan {s -> s == TraceMemoryState.ERROR);AddressSetView staleSet = rngAsSet.subtract(knownSet).subtract(errorSet);setShifted(map, fromRange.getMinAddress(), intoAddress, errorSet,- DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR.getRGB());+ DebuggerResources.COLOR_BACKGROUND_ERROR.getRGB());setShifted(map, fromRange.getMinAddress(), intoAddress, staleSet,- DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE.getRGB());+ DebuggerResources.COLOR_BACKGROUND_STALE.getRGB());}public void setShifted(IntRangeMap map, Address src, Address dst, AddressSetView set,diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPlugin.javaindex 26659b9a67..c98268a853 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPlugin.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPlugin.java@@ -43,8 +43,6 @@ import ghidra.app.services.*;import ghidra.app.services.DebuggerListingService.LocationTrackingSpecChangeListener;import ghidra.app.util.viewer.listingpanel.ListingPanel;import ghidra.async.AsyncUtils;-import ghidra.framework.options.AutoOptions;-import ghidra.framework.options.annotation.AutoOptionConsumed;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoServiceConsumed;import ghidra.framework.plugintool.util.PluginStatus;@@ -58,20 +56,27 @@ import ghidra.trace.model.program.TraceProgramView;import ghidra.trace.model.time.schedule.TraceSchedule;import ghidra.util.Msg;-@PluginInfo(shortDescription = "Compare memory state between times in a trace", description = "Provides a side-by-side diff view between snapshots (points in time) in a " +- "trace. The comparison is limited to raw bytes.", category = PluginCategoryNames.DEBUGGER, packageName = DebuggerPluginPackage.NAME, status = PluginStatus.RELEASED, eventsConsumed = {+@PluginInfo(+ shortDescription = "Compare memory state between times in a trace",+ description = "Provides a side-by-side diff view between snapshots (points in time) in a " ++ "trace. The comparison is limited to raw bytes.",+ category = PluginCategoryNames.DEBUGGER,+ packageName = DebuggerPluginPackage.NAME,+ status = PluginStatus.RELEASED,+ eventsConsumed = {TraceClosedPluginEvent.class,- }, eventsProduced = {}, servicesRequired = {+ },+ eventsProduced = {},+ servicesRequired = {DebuggerListingService.class,- }, servicesProvided = {})+ },+ servicesProvided = {})public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {+ static final Color COLOR_DIFF = new GColor("color.bg.debugger.diff.marker");+protected static final String MARKER_NAME = "Trace Diff";protected static final String MARKER_DESCRIPTION = "Difference between snapshots in this trace";- public static final String DIFF_COLOR_CATEGORY = "Listing Fields";- public static final String DIFF_COLOR_NAME = "Selection Colors.Difference Color";- public static final Color DEFAULT_DIFF_COLOR = new GColor("color.bg.debugger.diff.marker");-protected class ListingCoordinationListener implements CoordinatedListingPanelListener {@Overridepublic boolean listingClosed() {@@ -125,11 +130,6 @@ public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {//@AutoServiceConsumed via methodprivate MarkerService markerService;- @AutoOptionConsumed(category = DIFF_COLOR_CATEGORY, name = DIFF_COLOR_NAME)- private Color diffColor = DEFAULT_DIFF_COLOR;- @SuppressWarnings("unused")- private final AutoOptions.Wiring autoOptions;-protected final DebuggerTimeSelectionDialog timeDialog;protected ToggleDockingAction actionCompare;@@ -154,8 +154,6 @@ public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {public DebuggerTraceViewDiffPlugin(PluginTool tool) {super(tool);- autoOptions = AutoOptions.wireOptions(this);-timeDialog = new DebuggerTimeSelectionDialog(tool);trackingTrait = new ForAltListingTrackingTrait();createActions();@@ -426,12 +424,11 @@ public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {diffMarkersL = null;return;}- Color diffColor = this.diffColor == null ? DEFAULT_DIFF_COLOR : this.diffColor;TraceProgramView viewL = traceManager.getCurrentView();diffMarkersL = markerService.createAreaMarker(MARKER_NAME, MARKER_DESCRIPTION, viewL, 0,- true, true, true, diffColor, true);+ true, true, true, COLOR_DIFF, true);diffMarkersR = markerService.createAreaMarker(MARKER_NAME, MARKER_DESCRIPTION, viewR, 0,- true, true, true, diffColor, true);+ true, true, true, COLOR_DIFF, true);return;}@@ -486,16 +483,6 @@ public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {}}- @AutoOptionConsumed(category = DIFF_COLOR_CATEGORY, name = DIFF_COLOR_NAME)- private void setDiffColor(Color diffColor) {- if (diffMarkersL != null) {- diffMarkersL.setMarkerColor(diffColor);- }- if (diffMarkersR != null) {- diffMarkersR.setMarkerColor(diffColor);- }- }-@Overridepublic void processEvent(PluginEvent event) {super.processEvent(event);diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/CursorBackgroundColorModel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/CursorBackgroundColorModel.javaindex fb97c718fb..b336d9c632 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/CursorBackgroundColorModel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/CursorBackgroundColorModel.java@@ -35,7 +35,6 @@ class CursorBackgroundColorModel implements ListingBackgroundColorModel {private ListingPanel listingPanel;private AddressIndexMap addressIndexMap;- @AutoOptionConsumed(category = {}, name = GhidraOptions.HIGHLIGHT_CURSOR_LINE_COLOR)private Color cursorLineColor = GhidraOptions.DEFAULT_CURSOR_LINE_COLOR;@AutoOptionConsumed(category = {}, name = GhidraOptions.HIGHLIGHT_CURSOR_LINE)private boolean doHighlight = true;diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.javaindex 4002f5fcf4..232eefae44 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.java@@ -15,9 +15,8 @@*/package ghidra.app.plugin.core.debug.gui.listing;-import static ghidra.app.plugin.core.debug.gui.DebuggerResources.*;+import static ghidra.app.plugin.core.debug.gui.DebuggerResources.GROUP_TRANSIENT_VIEWS;-import java.awt.Color;import java.util.List;import java.util.function.Consumer;import java.util.stream.Collectors;@@ -39,10 +38,7 @@ import ghidra.app.plugin.core.debug.gui.action.NoneLocationTrackingSpec;import ghidra.app.services.*;import ghidra.app.util.viewer.format.FormatManager;import ghidra.app.util.viewer.listingpanel.ListingPanel;-import ghidra.framework.options.AutoOptions;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.AutoOptionDefined;-import ghidra.framework.options.annotation.HelpInfo;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoServiceConsumed;import ghidra.framework.plugintool.util.PluginStatus;@@ -131,27 +127,6 @@ public class DebuggerListingPlugin extends AbstractCodeBrowserPlugin<DebuggerLis@SuppressWarnings("unused")private AutoService.Wiring autoServiceWiring;- @AutoOptionDefined(- name = OPTION_NAME_COLORS_STALE_MEMORY,- description = "Color of memory addresses whose content is not known in the view's " +- "snap",- help = @HelpInfo(anchor = "colors"))- private Color staleMemoryColor = DEFAULT_COLOR_BACKGROUND_STALE;- @AutoOptionDefined( //- name = OPTION_NAME_COLORS_ERROR_MEMORY, //- description = "Color of memory addresses whose content could not be read in the " +- "view's snap", //- help = @HelpInfo(anchor = "colors"))- private Color errorMemoryColor = DEFAULT_COLOR_BACKGROUND_ERROR;- // NOTE: Static programs are marked via markerSet. Dynamic are marked via custom color model- @AutoOptionDefined( //- name = OPTION_NAME_COLORS_TRACKING_MARKERS, //- description = "Background color for locations referred to by a tracked register", //- help = @HelpInfo(anchor = "colors"))- private Color trackingColor = DEFAULT_COLOR_REGISTER_MARKERS;- @SuppressWarnings("unused")- private AutoOptions.Wiring autoOptionsWiring;-private final SuppressableCallback<Void> cbProgramLocationEvents = new SuppressableCallback<>();private final SuppressableCallback<Void> cbProgramSelectionEvents =new SuppressableCallback<>();@@ -161,7 +136,6 @@ public class DebuggerListingPlugin extends AbstractCodeBrowserPlugin<DebuggerLispublic DebuggerListingPlugin(PluginTool tool) {super(tool);autoServiceWiring = AutoService.wireServicesProvidedAndConsumed(this);- autoOptionsWiring = AutoOptions.wireOptions(this);createActions();}@@ -171,7 +145,7 @@ public class DebuggerListingPlugin extends AbstractCodeBrowserPlugin<DebuggerLisListingPanel listingPanel) {MultiBlendedListingBackgroundColorModel colorModel =new MultiBlendedListingBackgroundColorModel();- colorModel.addModel(new MemoryStateListingBackgroundColorModel(this, listingPanel));+ colorModel.addModel(new MemoryStateListingBackgroundColorModel(listingPanel));colorModel.addModel(new CursorBackgroundColorModel(this, listingPanel));return colorModel;}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.javaindex 0923321f72..5f312bb53f 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@@ -16,7 +16,6 @@package ghidra.app.plugin.core.debug.gui.listing;import static ghidra.app.plugin.core.debug.gui.DebuggerResources.ICON_REGISTER_MARKER;-import static ghidra.app.plugin.core.debug.gui.DebuggerResources.OPTION_NAME_COLORS_TRACKING_MARKERS;import java.awt.Color;import java.lang.invoke.MethodHandles;@@ -56,9 +55,7 @@ import ghidra.app.services.DebuggerStateEditingService.StateEditingMode;import ghidra.app.util.viewer.format.FormatManager;import ghidra.app.util.viewer.listingpanel.ListingPanel;import ghidra.framework.model.DomainFile;-import ghidra.framework.options.AutoOptions;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.AutoOptionConsumed;import ghidra.framework.plugintool.AutoConfigState;import ghidra.framework.plugintool.AutoService;import ghidra.framework.plugintool.annotation.AutoConfigStateField;@@ -247,10 +244,7 @@ public class DebuggerListingProvider extends CodeViewerProvider {@SuppressWarnings("unused")private final AutoService.Wiring autoServiceWiring;- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_TRACKING_MARKERS)- private Color trackingColor = DebuggerResources.DEFAULT_COLOR_REGISTER_MARKERS;- @SuppressWarnings("unused")- private final AutoOptions.Wiring autoOptionsWiring;+ private final Color trackingColor = DebuggerResources.COLOR_REGISTER_MARKERS;DebuggerCoordinates current = DebuggerCoordinates.NOWHERE;@@ -315,7 +309,6 @@ public class DebuggerListingProvider extends CodeViewerProvider {listingPanel.setBackgroundColorModel(colorModel);autoServiceWiring = AutoService.wireServicesConsumed(plugin, this);- autoOptionsWiring = AutoOptions.wireOptionsConsumed(plugin, this);setVisible(true);createActions();@@ -502,13 +495,6 @@ public class DebuggerListingProvider extends CodeViewerProvider {}}- @AutoOptionConsumed(name = OPTION_NAME_COLORS_TRACKING_MARKERS)- private void setTrackingColor(Color trackingColor) {- if (trackingMarker != null) {- trackingMarker.setMarkerColor(trackingColor);- }- }-@AutoServiceConsumedprivate void setMarkerService(MarkerService markerService) {if (this.markerService != null) {diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerTrackedRegisterListingBackgroundColorModel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerTrackedRegisterListingBackgroundColorModel.javaindex 26b2bd18c0..0a8e57b7f8 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerTrackedRegisterListingBackgroundColorModel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerTrackedRegisterListingBackgroundColorModel.java@@ -18,14 +18,11 @@ package ghidra.app.plugin.core.debug.gui.listing;import ghidra.app.plugin.core.debug.gui.colors.DebuggerTrackedRegisterBackgroundColorModel;import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;import ghidra.app.util.viewer.listingpanel.ListingPanel;-import ghidra.framework.plugintool.Plugin;public abstract class DebuggerTrackedRegisterListingBackgroundColorModelextends DebuggerTrackedRegisterBackgroundColorModel implements ListingBackgroundColorModel {- public DebuggerTrackedRegisterListingBackgroundColorModel(Plugin plugin,- ListingPanel listingPanel) {- super(plugin);+ public DebuggerTrackedRegisterListingBackgroundColorModel(ListingPanel listingPanel) {modelDataChanged(listingPanel);}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MemoryStateListingBackgroundColorModel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MemoryStateListingBackgroundColorModel.javaindex e16bdd7d67..688d782440 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MemoryStateListingBackgroundColorModel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MemoryStateListingBackgroundColorModel.java@@ -24,34 +24,25 @@ import ghidra.app.plugin.core.debug.gui.DebuggerResources;import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;import ghidra.app.util.viewer.listingpanel.ListingPanel;import ghidra.app.util.viewer.util.AddressIndexMap;-import ghidra.framework.options.AutoOptions;-import ghidra.framework.options.annotation.AutoOptionConsumed;-import ghidra.framework.plugintool.Plugin;import ghidra.program.model.address.Address;import ghidra.program.model.listing.Program;import ghidra.trace.model.TraceAddressSnapRange;import ghidra.trace.model.memory.*;import ghidra.trace.model.program.TraceProgramView;-import ghidra.util.ColorUtils;public class MemoryStateListingBackgroundColorModel implements ListingBackgroundColorModel {+ private static final Color COLOR_BACKGROUND_ERROR = DebuggerResources.COLOR_BACKGROUND_ERROR;+ private static final GColor COLOR_BACKGROUND_UNKNOWN = DebuggerResources.COLOR_BACKGROUND_STALE;+ private static final Color COLOR_BACKGROUND_UNKNOWN_BLENDED =+ COLOR_BACKGROUND_UNKNOWN.withAlpha(127);+private Color defaultBackgroundColor = new GColor("color.bg");private AddressIndexMap addressIndexMap;private TraceProgramView view;private TraceMemoryManager memory;- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_ERROR_MEMORY)- private Color errorColor = DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR;- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_STALE_MEMORY)- private GColor unknownColor = DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE;- private Color unknownBlendedColor = unknownColor.withAlpha(127);- @SuppressWarnings("unused")- private final AutoOptions.Wiring autoOptionsWiring;-- public MemoryStateListingBackgroundColorModel(Plugin plugin,- ListingPanel listingPanel) {- autoOptionsWiring = AutoOptions.wireOptions(plugin, this);+ public MemoryStateListingBackgroundColorModel(ListingPanel listingPanel) {modelDataChanged(listingPanel);}@@ -73,28 +64,23 @@ public class MemoryStateListingBackgroundColorModel implements ListingBackgroundcase UNKNOWN:return getUnknownColor(address);case ERROR:- return errorColor;+ return COLOR_BACKGROUND_ERROR;default:return defaultBackgroundColor;}}- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_STALE_MEMORY)- protected void setUnknownColor(Color unknownColor) {- // computeUnknownBlendedColor(unknownColor, defaultBackgroundColor);- }-protected Color getUnknownColor(Address address) {Entry<TraceAddressSnapRange, TraceMemoryState> ent =memory.getViewMostRecentStateEntry(view.getSnap(), address);if (ent == null || ent.getValue() != TraceMemoryState.KNOWN) {- return unknownColor;+ return COLOR_BACKGROUND_UNKNOWN;}TraceMemoryRegion region = memory.getRegionContaining(ent.getKey().getY1(), address);if (region != null && !region.isWrite()) {- return unknownBlendedColor;+ return COLOR_BACKGROUND_UNKNOWN_BLENDED;}- return unknownColor;+ return COLOR_BACKGROUND_UNKNOWN;}@Override@@ -102,22 +88,9 @@ public class MemoryStateListingBackgroundColorModel implements ListingBackgroundreturn defaultBackgroundColor;}- protected synchronized void computeUnknownBlendedColor(Color unkCol, Color defBg) {- if (unkCol == null) {- unknownBlendedColor = defBg;- }- else if (defBg == null) {- unknownBlendedColor = unkCol;- }- else {- unknownBlendedColor = ColorUtils.blend(unkCol, defBg, 0.1f);- }- }-@Overridepublic void setDefaultBackgroundColor(Color c) {defaultBackgroundColor = c;- // computeUnknownBlendedColor(unknownColor, c);}@Overridediff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MultiBlendedListingBackgroundColorModel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MultiBlendedListingBackgroundColorModel.javaindex 934cfa2ba6..8cfae329e9 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MultiBlendedListingBackgroundColorModel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/MultiBlendedListingBackgroundColorModel.java@@ -27,7 +27,7 @@ import ghidra.app.util.viewer.listingpanel.ListingPanel;import ghidra.util.ColorUtils.ColorBlender;public class MultiBlendedListingBackgroundColorModel implements ListingBackgroundColorModel {- private static final Color BG_COLOR_EMPTY = new GColor("color.bg");+ private static final Color COLOR_BACKGROUND = new GColor("color.bg");private final List<BackgroundColorModel> models = new ArrayList<>();@@ -63,7 +63,7 @@ public class MultiBlendedListingBackgroundColorModel implements ListingBackgroun@Overridepublic Color getDefaultBackgroundColor() {if (models.isEmpty()) {- return BG_COLOR_EMPTY;+ return COLOR_BACKGROUND;}return models.get(0).getDefaultBackgroundColor();}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryByteViewerComponent.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryByteViewerComponent.javaindex efe904caa2..27a4236a19 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryByteViewerComponent.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryByteViewerComponent.java@@ -29,8 +29,6 @@ import ghidra.app.plugin.core.debug.gui.DebuggerResources;import ghidra.app.plugin.core.debug.gui.colors.*;import ghidra.app.plugin.core.debug.gui.colors.MultiSelectionBlendedLayoutBackgroundColorManager.ColoredFieldSelection;import ghidra.app.plugin.core.format.DataFormatModel;-import ghidra.framework.options.AutoOptions;-import ghidra.framework.options.annotation.AutoOptionConsumed;import ghidra.program.model.address.*;import ghidra.trace.model.Trace;import ghidra.trace.model.memory.TraceMemoryState;@@ -114,12 +112,8 @@ public class DebuggerMemoryByteViewerComponent extends ByteViewerComponentprivate final DebuggerMemoryBytesPanel panel;- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_ERROR_MEMORY)- private Color errorColor = DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR;- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_STALE_MEMORY)- private Color unknownColor = DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE;- @SuppressWarnings("unused")- private final AutoOptions.Wiring autoOptionsWiring;+ private Color errorColor = DebuggerResources.COLOR_BACKGROUND_ERROR;+ private Color unknownColor = DebuggerResources.COLOR_BACKGROUND_STALE;private final List<SelectionGenerator> selectionGenerators;@@ -130,8 +124,6 @@ public class DebuggerMemoryByteViewerComponent extends ByteViewerComponent// TODO: I don't care much for this reverse paththis.panel = vpanel;- autoOptionsWiring = AutoOptions.wireOptionsConsumed(vpanel.getProvider().getPlugin(), this);-selectionGenerators = List.of(new SelectionHighlightSelectionGenerator(),new TraceMemoryStateSelectionGenerator(),diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.javaindex f3f13943f8..e9bbda7298 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.java@@ -15,9 +15,6 @@*/package ghidra.app.plugin.core.debug.gui.memory;-import static ghidra.app.plugin.core.debug.gui.DebuggerResources.*;--import java.awt.Color;import java.util.List;import java.util.function.Consumer;import java.util.stream.Collectors;@@ -32,14 +29,11 @@ import ghidra.app.plugin.core.byteviewer.*;import ghidra.app.plugin.core.debug.DebuggerCoordinates;import ghidra.app.plugin.core.debug.DebuggerPluginPackage;import ghidra.app.plugin.core.debug.event.*;-import ghidra.app.plugin.core.debug.gui.DebuggerResources;import ghidra.app.plugin.core.debug.gui.DebuggerResources.NewMemoryAction;import ghidra.app.plugin.core.debug.gui.action.LocationTrackingSpec;import ghidra.app.plugin.core.debug.gui.action.NoneLocationTrackingSpec;import ghidra.app.services.*;-import ghidra.framework.options.AutoOptions;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.AutoOptionConsumed;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoServiceConsumed;import ghidra.framework.plugintool.util.PluginStatus;@@ -82,21 +76,11 @@ public class DebuggerMemoryBytesPlugin@SuppressWarnings("unused")private AutoService.Wiring autoServiceWiring;- @AutoOptionConsumed(name = OPTION_NAME_COLORS_STALE_MEMORY)- private Color staleMemoryColor = DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE;- @AutoOptionConsumed(name = OPTION_NAME_COLORS_ERROR_MEMORY)- private Color errorMemoryColor = DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR;- @AutoOptionConsumed(name = OPTION_NAME_COLORS_TRACKING_MARKERS)- private Color trackingColor = DebuggerResources.DEFAULT_COLOR_REGISTER_MARKERS;- @SuppressWarnings("unused")- private AutoOptions.Wiring autoOptionsWiring;-private DebuggerCoordinates current = DebuggerCoordinates.NOWHERE;public DebuggerMemoryBytesPlugin(PluginTool tool) {super(tool);autoServiceWiring = AutoService.wireServicesProvidedAndConsumed(this);- autoOptionsWiring = AutoOptions.wireOptions(this);createActions();}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.javaindex b6f74b2327..b1865930d9 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.java@@ -20,7 +20,6 @@ import java.awt.Graphics;import java.util.HashMap;import java.util.Map;-import generic.theme.GColor;import generic.theme.GThemeDefaults.Colors.Java;import ghidra.program.model.address.AddressRange;import ghidra.trace.model.Lifespan;@@ -36,7 +35,6 @@ public class MemoryBox {protected long stopAddr = -1;protected long startTime;protected long stopTime = -1;- protected Color color = new GColor("color.debugger.plugin.memview.box");protected int pixAstart;protected int pixAend;@@ -44,6 +42,7 @@ public class MemoryBox {protected int pixTstart;protected int pixTend;protected int boundT;+ protected final Color color;protected boolean current;@@ -92,19 +91,6 @@ public class MemoryBox {return color;}- public void setColor(Color color) {- this.color = color;- }-- public void setColor(Color base, int type) {- setColor(new Color(base.getRed(), (base.getGreen() + type) % 255, base.getBlue()));- }-- public void setColor(Color base, int type, int src) {- setColor(new Color(base.getRed(), (base.getGreen() + type * 8) % 255,- (base.getBlue() + src * 16) % 255));- }-public int getAddressPixelStart() {return pixAstart;}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewBoxType.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewBoxType.javaindex c0cdb8e3e8..502e6a78c6 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewBoxType.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewBoxType.java@@ -20,45 +20,29 @@ import java.awt.Color;import generic.theme.GColor;public enum MemviewBoxType {- INSTRUCTIONS,- PROCESS,- THREAD,- MODULE,- REGION,- IMAGE,- VIRTUAL_ALLOC,- HEAP_CREATE,- HEAP_ALLOC,- POOL,- STACK,- PERFINFO,- READ_MEMORY,- WRITE_MEMORY,- BREAKPOINT;+ INSTRUCTIONS(new GColor("color.debugger.plugin.memview.box.type.instructions")),+ PROCESS(new GColor("color.debugger.plugin.memview.box.type.process")),+ THREAD(new GColor("color.debugger.plugin.memview.box.type.thread")),+ MODULE(new GColor("color.debugger.plugin.memview.box.type.module")),+ REGION(new GColor("color.debugger.plugin.memview.box.type.region")),+ IMAGE(new GColor("color.debugger.plugin.memview.box.type.image")),+ VIRTUAL_ALLOC(new GColor("color.debugger.plugin.memview.box.type.virtual.alloc")),+ HEAP_CREATE(new GColor("color.debugger.plugin.memview.box.type.heap.create")),+ HEAP_ALLOC(new GColor("color.debugger.plugin.memview.box.type.heap.alloc")),+ POOL(new GColor("color.debugger.plugin.memview.box.type.pool")),+ STACK(new GColor("color.debugger.plugin.memview.box.type.stack")),+ PERFINFO(new GColor("color.debugger.plugin.memview.box.type.perfinfo")),+ READ_MEMORY(new GColor("color.debugger.plugin.memview.box.type.read.memory")),+ WRITE_MEMORY(new GColor("color.debugger.plugin.memview.box.type.write.memory")),+ BREAKPOINT(new GColor("color.debugger.plugin.memview.box.type.breakpoint"));- Color[] colors = { //- new GColor("color.debugger.plugin.memview.box.type.instructions"),- new GColor("color.debugger.plugin.memview.box.type.process"),- new GColor("color.debugger.plugin.memview.box.type.thread"),- new GColor("color.debugger.plugin.memview.box.type.module"),- new GColor("color.debugger.plugin.memview.box.type.region"),- new GColor("color.debugger.plugin.memview.box.type.image"),- new GColor("color.debugger.plugin.memview.box.type.virtual.alloc"),- new GColor("color.debugger.plugin.memview.box.type.heap.create"),- new GColor("color.debugger.plugin.memview.box.type.heap.alloc"),- new GColor("color.debugger.plugin.memview.box.type.pool"),- new GColor("color.debugger.plugin.memview.box.type.stack"),- new GColor("color.debugger.plugin.memview.box.type.perfinfo"),- new GColor("color.debugger.plugin.memview.box.type.read.memory"),- new GColor("color.debugger.plugin.memview.box.type.write.memory"),- new GColor("color.debugger.plugin.memview.box.type.breakpoint"),- };+ private final Color color;- public Color getColor() {- return colors[this.ordinal()];+ private MemviewBoxType(Color color) {+ this.color = color;}- public void setColor(Color color) {- colors[this.ordinal()] = color;+ public Color getColor() {+ return color;}}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.javaindex 12f4d1794e..a141efafe2 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.java@@ -30,7 +30,8 @@ import ghidra.program.model.address.AddressRange;public class MemviewPanel extends JPanel implements MouseListener, MouseMotionListener {private static final long serialVersionUID = 1L;- private Color ARROW_COLOR = new GColor("color.debugger.plugin.plugin.memview.arrow");+ private static final Color ARROW_COLOR =+ new GColor("color.debugger.plugin.plugin.memview.arrow");private MemviewProvider provider;private MemviewMap amap;diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/DebuggerModelProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/DebuggerModelProvider.javaindex bd16375cd7..e778cf287a 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/DebuggerModelProvider.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/DebuggerModelProvider.java@@ -15,7 +15,8 @@*/package ghidra.app.plugin.core.debug.gui.model;-import java.awt.*;+import java.awt.BorderLayout;+import java.awt.KeyboardFocusManager;import java.awt.event.*;import java.lang.invoke.MethodHandles;import java.util.List;@@ -41,9 +42,7 @@ import ghidra.app.plugin.core.debug.gui.model.ObjectTableModel.ValueRow;import ghidra.app.plugin.core.debug.gui.model.ObjectTreeModel.AbstractNode;import ghidra.app.plugin.core.debug.gui.model.PathTableModel.PathRow;import ghidra.app.services.DebuggerTraceManagerService;-import ghidra.framework.options.AutoOptions;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.*;import ghidra.framework.plugintool.AutoConfigState;import ghidra.framework.plugintool.AutoService;import ghidra.framework.plugintool.annotation.AutoConfigStateField;@@ -53,7 +52,8 @@ import ghidra.trace.model.target.*;import ghidra.util.Msg;public class DebuggerModelProvider extends ComponentProvider implements SaveableProvider {-+ private static final GColor COLOR_BORDER_DISCONNECTED =+ new GColor("color.border.provider.disconnected");private static final AutoConfigState.ClassHandler<DebuggerModelProvider> CONFIG_STATE_HANDLER =AutoConfigState.wireHandler(DebuggerModelProvider.class, MethodHandles.lookup());private static final String KEY_DEBUGGER_COORDINATES = "DebuggerCoordinates";@@ -78,15 +78,6 @@ public class DebuggerModelProvider extends ComponentProvider implements Saveable@SuppressWarnings("unused")private final AutoService.Wiring autoServiceWiring;- @AutoOptionDefined(description = "Text color for values that have just changed", name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED, help = @HelpInfo(anchor = "colors"))- private Color diffColor = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED;-- @AutoOptionDefined(description = "Select text color for values that have just changed", name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED_SEL, help = @HelpInfo(anchor = "colors"))- private Color diffColorSel = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED_SEL;-- @SuppressWarnings("unused")- private final AutoOptions.Wiring autoOptionsWiring;-@AutoConfigStateFieldprivate boolean limitToSnap = false;@AutoConfigStateField@@ -121,7 +112,6 @@ public class DebuggerModelProvider extends ComponentProvider implements Saveablepublic DebuggerModelProvider(DebuggerModelPlugin plugin, boolean isClone) {super(plugin.getTool(), DebuggerResources.TITLE_PROVIDER_MODEL, plugin.getName());this.autoServiceWiring = AutoService.wireServicesConsumed(plugin, this);- this.autoOptionsWiring = AutoOptions.wireOptions(plugin, this);this.plugin = plugin;this.isClone = isClone;@@ -138,8 +128,7 @@ public class DebuggerModelProvider extends ComponentProvider implements SaveablesetTitle("[" + DebuggerResources.TITLE_PROVIDER_MODEL + "]");setWindowGroup("Debugger.Core.disconnected");setIntraGroupPosition(WindowPosition.STACK);- mainPanel.setBorder(BorderFactory- .createLineBorder(new GColor("color.border.provider.disconnected"), 2));+ mainPanel.setBorder(BorderFactory.createLineBorder(COLOR_BORDER_DISCONNECTED, 2));setTransient();}else {@@ -638,28 +627,6 @@ public class DebuggerModelProvider extends ComponentProvider implements Saveablereturn showMethodsInTree;}- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED)- public void setDiffColor(Color diffColor) {- if (Objects.equals(this.diffColor, diffColor)) {- return;- }- this.diffColor = diffColor;- objectsTreePanel.setDiffColor(diffColor);- elementsTablePanel.setDiffColor(diffColor);- attributesTablePanel.setDiffColor(diffColor);- }-- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED_SEL)- public void setDiffColorSel(Color diffColorSel) {- if (Objects.equals(this.diffColorSel, diffColorSel)) {- return;- }- this.diffColorSel = diffColorSel;- objectsTreePanel.setDiffColorSel(diffColorSel);- elementsTablePanel.setDiffColorSel(diffColorSel);- attributesTablePanel.setDiffColorSel(diffColorSel);- }-protected void setTreeSelection(TraceObjectKeyPath path, EventOrigin origin) {objectsTreePanel.setSelectedKeyPaths(List.of(path), origin);}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/ObjectsTreePanel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/ObjectsTreePanel.javaindex e5903d4ab2..24672f538f 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/ObjectsTreePanel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/ObjectsTreePanel.java@@ -77,8 +77,8 @@ public class ObjectsTreePanel extends JPanel {protected boolean showPrimitives = false;protected boolean showMethods = false;- protected Color diffColor = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED;- protected Color diffColorSel = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED_SEL;+ protected Color diffColor = DebuggerResources.COLOR_VALUE_CHANGED;+ protected Color diffColorSel = DebuggerResources.COLOR_VALUE_CHANGED_SEL;public ObjectsTreePanel() {super(new BorderLayout());diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TracePathValueColumn.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TracePathValueColumn.javaindex a65e8259ff..ef743716f2 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TracePathValueColumn.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TracePathValueColumn.java@@ -64,8 +64,8 @@ public class TracePathValueColumn extends AbstractDynamicTableColumn<PathRow, Pa}}- private Color diffColor = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED;- private Color diffColorSel = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED_SEL;+ private Color diffColor = DebuggerResources.COLOR_VALUE_CHANGED;+ private Color diffColorSel = DebuggerResources.COLOR_VALUE_CHANGED_SEL;@Overridepublic String getColumnName() {diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueObjectPropertyColumn.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueObjectPropertyColumn.javaindex 689b7e5224..49fbfcd99c 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueObjectPropertyColumn.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueObjectPropertyColumn.java@@ -111,8 +111,8 @@ public abstract class TraceValueObjectPropertyColumn<T>private final GColumnRenderer<ValueProperty<T>> renderer;private final Comparator<ValueProperty<T>> comparator;- private Color diffColor = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED;- private Color diffColorSel = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED_SEL;+ private Color diffColor = DebuggerResources.COLOR_VALUE_CHANGED;+ private Color diffColorSel = DebuggerResources.COLOR_VALUE_CHANGED_SEL;public TraceValueObjectPropertyColumn(Class<T> propertyType) {this.propertyType = propertyType;diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueValColumn.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueValColumn.javaindex c192ac94d1..76fbf68a40 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueValColumn.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/model/columns/TraceValueValColumn.java@@ -75,8 +75,8 @@ public class TraceValueValColumn extends AbstractDynamicTableColumn<ValueRow, Va}}- private Color diffColor = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED;- private Color diffColorSel = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED_SEL;+ private Color diffColor = DebuggerResources.COLOR_VALUE_CHANGED;+ private Color diffColorSel = DebuggerResources.COLOR_VALUE_CHANGED_SEL;private final ValRenderer renderer = new ValRenderer();@Overridediff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.javaindex 615640aebd..e618bb83d5 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.java@@ -44,7 +44,6 @@ import docking.widgets.table.DefaultEnumeratedColumnTableModel;import docking.widgets.tree.GTree;import generic.jar.ResourceFile;import generic.theme.GColor;-import generic.theme.GThemeDefaults.Colors;import ghidra.app.plugin.core.debug.DebuggerCoordinates;import ghidra.app.plugin.core.debug.DebuggerPluginPackage;import ghidra.app.plugin.core.debug.gui.DebuggerResources;@@ -68,7 +67,7 @@ import ghidra.dbg.util.PathUtils;import ghidra.framework.model.Project;import ghidra.framework.options.AutoOptions;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.*;+import ghidra.framework.options.annotation.AutoOptionDefined;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoConfigStateField;import ghidra.framework.plugintool.annotation.AutoServiceConsumed;@@ -90,6 +89,29 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapterpublic static final String PATH_JOIN_CHAR = ".";//private static final String AUTOUPDATE_ATTRIBUTE_NAME = "autoupdate";+ public static final Color COLOR_FOREGROUND =+ new GColor("color.fg.debugger.plugin.objects.default");+ public static final Color COLOR_BACKGROUND =+ new GColor("color.bg.debugger.plugin.objects.default");+ public static final Color COLOR_FOREGROUND_INVISIBLE =+ new GColor("color.fg.debugger.plugin.objects.invisible");+ public static final Color COLOR_FOREGROUND_INVALIDATED =+ new GColor("color.fg.debugger.plugin.objects.invalidated");+ public static final Color COLOR_FOREGROUND_MODIFIED =+ new GColor("color.fg.debugger.plugin.objects.modified");+ public static final Color COLOR_FOREGROUND_SUBSCRIBED =+ new GColor("color.fg.debugger.plugin.objects.subscribed");+ public static final Color COLOR_FOREGROUND_ERROR =+ new GColor("color.fg.debugger.plugin.objects.error");+ public static final Color COLOR_FOREGROUND_INTRINSIC =+ new GColor("color.fg.debugger.plugin.objects.intrinsic");+ public static final Color COLOR_FOREGROUND_TARGET =+ new GColor("color.fg.debugger.plugin.objects.target");+ public static final Color COLOR_FOREGROUND_ACCESSOR =+ new GColor("color.fg.debugger.plugin.objects.accessor");+ public static final Color COLOR_FOREGROUND_LINK =+ new GColor("color.fg.debugger.plugin.objects.link");+private static final AutoConfigState.ClassHandler<DebuggerObjectsProvider> CONFIG_STATE_HANDLER =AutoConfigState.wireHandler(DebuggerObjectsProvider.class, MethodHandles.lookup());@@ -110,93 +132,9 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter@SuppressWarnings("unused")private final AutoService.Wiring autoServiceWiring;- public static final String OPTION_NAME_DEFAULT_FOREGROUND_COLOR = "Object Colors.Default";- public static final String OPTION_NAME_MODIFIED_FOREGROUND_COLOR = "Object Colors.Modifed";- public static final String OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR = "Object Colors.Subscribed";- public static final String OPTION_NAME_INVISIBLE_FOREGROUND_COLOR =- "Object Colors.Invisible (when toggled on)";- public static final String OPTION_NAME_INVALIDATED_FOREGROUND_COLOR =- "Object Colors.Invalidated";- public static final String OPTION_NAME_ERROR_FOREGROUND_COLOR = "Object Colors.Errors";- public static final String OPTION_NAME_INTRINSIC_FOREGROUND_COLOR = "Object Colors.Intrinsics";- public static final String OPTION_NAME_TARGET_FOREGROUND_COLOR = "Object Colors.Targets";- public static final String OPTION_NAME_ACCESSOR_FOREGROUND_COLOR = "Object Colors.Accessors";- public static final String OPTION_NAME_LINK_FOREGROUND_COLOR = "Object Colors.Links";- public static final String OPTION_NAME_DEFAULT_BACKGROUND_COLOR = "Object Colors.Background";-- @AutoOptionDefined( //- name = OPTION_NAME_DEFAULT_FOREGROUND_COLOR, //- description = "The default foreground color of items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color defaultForegroundColor = new GColor("color.fg.debugger.plugin.objects.default");- @AutoOptionDefined( //- name = OPTION_NAME_DEFAULT_BACKGROUND_COLOR, //- description = "The default background color of items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color defaultBackgroundColor = new GColor("color.bg.debugger.plugin.objects.default");-- @AutoOptionDefined( //- name = OPTION_NAME_INVISIBLE_FOREGROUND_COLOR, //- description = "The foreground color for items normally not visible (toggleable)", //- help = @HelpInfo(anchor = "colors") //- )- Color invisibleForegroundColor = new GColor("color.fg.debugger.plugin.objects.invisible");- @AutoOptionDefined( //- name = OPTION_NAME_INVALIDATED_FOREGROUND_COLOR, //- description = "The foreground color for items no longer valid", //- help = @HelpInfo(anchor = "colors") //- )- Color invalidatedForegroundColor = new GColor("color.fg.debugger.plugin.objects.invalidated");- @AutoOptionDefined( //- name = OPTION_NAME_MODIFIED_FOREGROUND_COLOR, //- description = "The foreground color for modified items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color modifiedForegroundColor = new GColor("color.fg.debugger.plugin.objects.modified");- @AutoOptionDefined( //- name = OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR, //- description = "The foreground color for subscribed items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color subscribedForegroundColor = new GColor("color.fg.debugger.plugin.objects.subscribed");- @AutoOptionDefined( //- name = OPTION_NAME_ERROR_FOREGROUND_COLOR, //- description = "The foreground color for items in error", //- help = @HelpInfo(anchor = "colors") //- )- Color errorForegroundColor = new GColor("color.fg.debugger.plugin.objects.error");- @AutoOptionDefined( //- name = OPTION_NAME_INTRINSIC_FOREGROUND_COLOR, //- description = "The foreground color for intrinsic items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color intrinsicForegroundColor = new GColor("color.fg.debugger.plugin.objects.intrinsic");- @AutoOptionDefined( //- name = OPTION_NAME_TARGET_FOREGROUND_COLOR, //- description = "The foreground color for target object items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color targetForegroundColor = new GColor("color.fg.debugger.plugin.objects.target");- @AutoOptionDefined( //- name = OPTION_NAME_ACCESSOR_FOREGROUND_COLOR, //- description = "The foreground color for property accessor items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color accessorForegroundColor = new GColor("color.fg.debugger.plugin.objects.accessor");- @AutoOptionDefined( //- name = OPTION_NAME_LINK_FOREGROUND_COLOR, //- description = "The foreground color for links to items in the objects tree", //- help = @HelpInfo(anchor = "colors") //- )- Color linkForegroundColor = new GColor("color.fg.debugger.plugin.objects.link");-- @AutoOptionDefined( //- name = "Default Extended Step", //- description = "The default string for the extended step command" //- //help = @HelpInfo(anchor = "colors") //- )+ @AutoOptionDefined(+ name = "Default Extended Step",+ description = "The default string for the extended step command")String extendedStep = "";@SuppressWarnings("unused")@@ -374,94 +312,6 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapterreturn pane == null ? null : pane.getPrincipalComponent();}- @AutoOptionConsumed(name = OPTION_NAME_DEFAULT_BACKGROUND_COLOR)- private void setDefaultBackgroundColor(Color color) {- defaultBackgroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_DEFAULT_FOREGROUND_COLOR)- private void setDefaultForegroundColor(Color color) {- defaultForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_ACCESSOR_FOREGROUND_COLOR)- private void setAccessorForegroundColor(Color color) {- accessorForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_ERROR_FOREGROUND_COLOR)- private void setErrorForegroundColor(Color color) {- errorForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_INTRINSIC_FOREGROUND_COLOR)- private void setIntrinsicForegroundColor(Color color) {- intrinsicForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_INVISIBLE_FOREGROUND_COLOR)- private void setInvisibleForegroundColor(Color color) {- invisibleForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_INVALIDATED_FOREGROUND_COLOR)- private void setInvalidatedForegroundColor(Color color) {- invalidatedForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_LINK_FOREGROUND_COLOR)- private void setLinkForegroundColor(Color color) {- linkForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_MODIFIED_FOREGROUND_COLOR)- private void setModifiedForegroundColor(Color color) {- modifiedForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR)- private void setSubscribedForegroundColor(Color color) {- subscribedForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-- @AutoOptionConsumed(name = OPTION_NAME_TARGET_FOREGROUND_COLOR)- private void setTargetForegroundColor(Color color) {- targetForegroundColor = color;- if (pane != null) {- pane.getComponent().repaint();- }- }-public void setProgram(Program program) {if (program == currentProgram) {return;@@ -2005,35 +1855,6 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapterthis.selectionOnly = localOnly;}- public Color getColor(String name) {- switch (name) {- case OPTION_NAME_ACCESSOR_FOREGROUND_COLOR:- return accessorForegroundColor;- case OPTION_NAME_DEFAULT_BACKGROUND_COLOR:- return defaultBackgroundColor;- case OPTION_NAME_DEFAULT_FOREGROUND_COLOR:- return defaultForegroundColor;- case OPTION_NAME_ERROR_FOREGROUND_COLOR:- return errorForegroundColor;- case OPTION_NAME_INTRINSIC_FOREGROUND_COLOR:- return intrinsicForegroundColor;- case OPTION_NAME_INVISIBLE_FOREGROUND_COLOR:- return invisibleForegroundColor;- case OPTION_NAME_INVALIDATED_FOREGROUND_COLOR:- return invalidatedForegroundColor;- case OPTION_NAME_MODIFIED_FOREGROUND_COLOR:- return modifiedForegroundColor;- case OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR:- return subscribedForegroundColor;- case OPTION_NAME_LINK_FOREGROUND_COLOR:- return linkForegroundColor;- case OPTION_NAME_TARGET_FOREGROUND_COLOR:- return targetForegroundColor;- default:- return Colors.FOREGROUND;- }- }-public boolean isAutorecord() {return autoRecord;}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.javaindex 6541145314..d173a407d5 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.java@@ -49,8 +49,7 @@ class ObjectTreeCellRenderer extends GTreeRenderer {ObjectNode node = (ObjectNode) value;ObjectContainer container = node.getContainer();setText(container.getDecoratedName());- component.setForeground(- provider.getColor(DebuggerObjectsProvider.OPTION_NAME_DEFAULT_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND);TargetObject targetObject = container.getTargetObject();if (targetObject != null) {Map<String, ?> attrs = targetObject.getCachedAttributes();@@ -63,28 +62,22 @@ class ObjectTreeCellRenderer extends GTreeRenderer {}}if (!node.isVisible() && !provider.isHideIntrinsics()) {- component.setForeground(provider- .getColor(DebuggerObjectsProvider.OPTION_NAME_INVISIBLE_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND_INVISIBLE);}if (container.getTargetObject() instanceof TargetExecutionStateful) {TargetExecutionStateful stateful = (TargetExecutionStateful) targetObject;if (stateful.getExecutionState().equals(TargetExecutionState.TERMINATED)) {- component.setForeground(provider- .getColor(- DebuggerObjectsProvider.OPTION_NAME_INVALIDATED_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND_INVALIDATED);}}if (container.isLink()) {- component.setForeground(- provider.getColor(DebuggerObjectsProvider.OPTION_NAME_LINK_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND_LINK);}if (container.isModified()) {- component.setForeground(provider- .getColor(DebuggerObjectsProvider.OPTION_NAME_MODIFIED_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND_MODIFIED);}if (container.isSubscribed()) {- Color color = provider- .getColor(DebuggerObjectsProvider.OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR);+ Color color = provider.COLOR_FOREGROUND_SUBSCRIBED;if (!color.equals(Tables.FG_UNSELECTED)) {component.setForeground(color);}@@ -111,20 +104,16 @@ class ObjectTreeCellRenderer extends GTreeRenderer {private void setColor(Component component, String kind) {switch (kind) {case "OBJECT_PROPERTY_ACCESSOR":- component.setForeground(provider- .getColor(DebuggerObjectsProvider.OPTION_NAME_ACCESSOR_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND);break;case "OBJECT_INTRINSIC":- component.setForeground(provider- .getColor(DebuggerObjectsProvider.OPTION_NAME_INTRINSIC_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND_INTRINSIC);break;case "OBJECT_TARGET_OBJECT":- component.setForeground(- provider.getColor(DebuggerObjectsProvider.OPTION_NAME_TARGET_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND_TARGET);break;case "OBJECT_ERROR":- component.setForeground(- provider.getColor(DebuggerObjectsProvider.OPTION_NAME_ERROR_FOREGROUND_COLOR));+ component.setForeground(provider.COLOR_FOREGROUND_ERROR);break;}}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.javaindex 28cec023c9..bbd79ea519 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.java@@ -71,6 +71,36 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {private static final FontRenderContext METRIC_FRC =new FontRenderContext(new AffineTransform(), false, false);+ private static final Color COLOR_BACKGROUND =+ new GColor("color.bg.listing");+ private static final Color COLOR_BACKGROUND_CURSOR =+ new GColor("color.bg.currentline.listing");+ private static final Color COLOR_BACKGROUND_COUNTER =+ new GColor("color.debugger.plugin.resources.pcode.counter");++ private static final Color COLOR_FOREGROUND_ADDRESS =+ new GColor("color.fg.listing.address");+ private static final Color COLOR_FOREGROUND_REGISTER =+ new GColor("color.fg.listing.register");+ private static final Color COLOR_FOREGROUND_SCALAR =+ new GColor("color.fg.listing.constant");+ private static final Color COLOR_FOREGROUND_LOCAL =+ new GColor("color.fg.listing.label.local");+ private static final Color COLOR_FOREGROUND_MNEMONIC =+ new GColor("color.fg.listing.mnemonic");+ private static final Color COLOR_FOREGROUND_UNIMPL =+ new GColor("color.fg.listing.mnemonic.unimplemented");+ private static final Color COLOR_FOREGROUND_SEPARATOR =+ new GColor("color.fg.listing.separator");+ private static final Color COLOR_FOREGROUND_LINE_LABEL =+ new GColor("color.fg.listing.pcode.label");+ private static final Color COLOR_FOREGROUND_SPACE =+ new GColor("color.fg.listing.pcode.address.space");+ private static final Color COLOR_FOREGROUND_RAW =+ new GColor("color.fg.listing.pcode.varnode");+ private static final Color COLOR_FOREGROUND_USEROP =+ new GColor("color.fg.listing.pcode.userop");+private static final String SPAN_ADDRESS = "addr";private static final String SPAN_REGISTER = "reg";private static final String SPAN_SCALAR = "scalar";@@ -228,7 +258,8 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {PcodeRow row = (PcodeRow) data.getRowObject();if (data.isSelected()) {if (row.isNext()) {- Color blend = ColorUtils.blend(counterColor, cursorColor, 0.5f);+ Color blend =+ ColorUtils.blend(COLOR_BACKGROUND_COUNTER, COLOR_BACKGROUND_CURSOR, 0.5f);if (blend != null) {setBackground(blend);}@@ -236,7 +267,7 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {// else background is already set. Leave it alone}else if (row.isNext()) {- setBackground(counterColor);+ setBackground(COLOR_BACKGROUND_COUNTER);}else {setBackground(pcodeTable.getBackground());@@ -531,23 +562,6 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {@SuppressWarnings("unused")private AutoService.Wiring autoServiceWiring;- private Color counterColor = DebuggerResources.DEFAULT_COLOR_PCODE_COUNTER;-- private Color backgroundColor = new GColor("color.bg.listing");- private Color cursorColor = new GColor("color.bg.currentline.listing");-- private Color addressColor = new GColor("color.fg.listing.address");- private Color registerColor = new GColor("color.fg.listing.register");- private Color scalarColor = new GColor("color.fg.listing.constant");- private Color localColor = new GColor("color.fg.listing.label.local");- private Color mnemonicColor = new GColor("color.fg.listing.mnemonic");- private Color unimplColor = new GColor("color.fg.listing.mnemonic.unimplemented");- private Color separatorColor = new GColor("color.fg.listing.separator");- private Color lineLabelColor = new GColor("color.fg.listing.pcode.label");- private Color spaceColor = new GColor("color.fg.listing.pcode.address.space");- private Color rawColor = new GColor("color.fg.listing.pcode.varnode");- private Color useropColor = new GColor("color.fg.listing.pcode.userop");-JSplitPane mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);final UniqueTableModel uniqueTableModel;@@ -586,17 +600,17 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {protected String computeStyle() {StringBuilder sb = new StringBuilder("<html><head><style>");- sb.append(createColoredStyle(SPAN_ADDRESS, addressColor));- sb.append(createColoredStyle(SPAN_REGISTER, registerColor));- sb.append(createColoredStyle(SPAN_SCALAR, scalarColor));- sb.append(createColoredStyle(SPAN_LOCAL, localColor));- sb.append(createColoredStyle(SPAN_MNEMONIC, mnemonicColor));- sb.append(createColoredStyle(SPAN_UNIMPL, unimplColor));- sb.append(createColoredStyle(SPAN_SEPARATOR, separatorColor));- sb.append(createColoredStyle(SPAN_LINE_LABEL, lineLabelColor));- sb.append(createColoredStyle(SPAN_SPACE, spaceColor));- sb.append(createColoredStyle(SPAN_RAW, rawColor));- sb.append(createColoredStyle(SPAN_USEROP, useropColor));+ sb.append(createColoredStyle(SPAN_ADDRESS, COLOR_FOREGROUND_ADDRESS));+ sb.append(createColoredStyle(SPAN_REGISTER, COLOR_FOREGROUND_REGISTER));+ sb.append(createColoredStyle(SPAN_SCALAR, COLOR_FOREGROUND_SCALAR));+ sb.append(createColoredStyle(SPAN_LOCAL, COLOR_FOREGROUND_LOCAL));+ sb.append(createColoredStyle(SPAN_MNEMONIC, COLOR_FOREGROUND_MNEMONIC));+ sb.append(createColoredStyle(SPAN_UNIMPL, COLOR_FOREGROUND_UNIMPL));+ sb.append(createColoredStyle(SPAN_SEPARATOR, COLOR_FOREGROUND_SEPARATOR));+ sb.append(createColoredStyle(SPAN_LINE_LABEL, COLOR_FOREGROUND_LINE_LABEL));+ sb.append(createColoredStyle(SPAN_SPACE, COLOR_FOREGROUND_SPACE));+ sb.append(createColoredStyle(SPAN_RAW, COLOR_FOREGROUND_RAW));+ sb.append(createColoredStyle(SPAN_USEROP, COLOR_FOREGROUND_USEROP));sb.append("</style></head>"); // NB. </html> should already be at endreturn sb.toString();}@@ -619,8 +633,8 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {JPanel pcodeTablePanel = new JPanel(new BorderLayout());pcodeTable = new GhidraTable(pcodeTableModel);pcodeTablePanel.add(pcodeTable, BorderLayout.CENTER);- pcodeTable.setBackground(backgroundColor);- pcodeTable.setSelectionBackground(cursorColor);+ pcodeTable.setBackground(COLOR_BACKGROUND);+ pcodeTable.setSelectionBackground(COLOR_BACKGROUND_CURSOR);JScrollPane pcodeScrollPane = new JScrollPane(pcodeTablePanel,ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,@@ -640,8 +654,8 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {mainPanel.setRightComponent(uniquePanel);pcodeTable.setTableHeader(null);- pcodeTable.setBackground(backgroundColor);- pcodeTable.setSelectionBackground(cursorColor);+ pcodeTable.setBackground(COLOR_BACKGROUND);+ pcodeTable.setSelectionBackground(COLOR_BACKGROUND_CURSOR);pcodeTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);pcodeTable.getSelectionModel().addListSelectionListener(evt -> {if (evt.getValueIsAdjusting()) {diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.javaindex ca8e4ec87a..cae61d45f6 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java@@ -58,7 +58,6 @@ import ghidra.framework.model.DomainObject;import ghidra.framework.model.DomainObjectChangeRecord;import ghidra.framework.options.AutoOptions;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.*;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoServiceConsumed;import ghidra.program.model.address.*;@@ -87,6 +86,17 @@ import ghidra.util.task.TaskMonitor;public class DebuggerRegistersProvider extends ComponentProviderAdapterimplements DebuggerProvider, PopupActionProvider {+ private static final GColor COLOR_BORDER_DISCONNECTED =+ new GColor("color.border.provider.disconnected");+ private static final Color COLOR_FOREGROUND_STALE =+ new GColor("color.debugger.plugin.resources.register.stale");+ private static final Color COLOR_FOREGROUND_STALE_SEL =+ new GColor("color.debugger.plugin.resources.register.stale.selected");+ private static final Color COLOR_FOREGROUND_CHANGED =+ new GColor("color.debugger.plugin.resources.register.changed");+ private static final Color COLOR_FOREGROUND_CHANGED_SEL =+ new GColor("color.debugger.plugin.resources.register.changed.selected");+private static final String KEY_DEBUGGER_COORDINATES = "DebuggerCoordinates";interface ClearRegisterType {@@ -398,18 +408,18 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapterRegisterRow row = (RegisterRow) data.getRowObject();if (!row.isKnown()) {if (data.isSelected()) {- setForeground(registerStaleSelColor);+ setForeground(COLOR_FOREGROUND_STALE_SEL);}else {- setForeground(registerStaleColor);+ setForeground(COLOR_FOREGROUND_STALE);}}else if (row.isChanged()) {if (data.isSelected()) {- setForeground(registerChangesSelColor);+ setForeground(COLOR_FOREGROUND_CHANGED_SEL);}else {- setForeground(registerChangesColor);+ setForeground(COLOR_FOREGROUND_CHANGED);}}return this;@@ -472,23 +482,6 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter@SuppressWarnings("unused")private final AutoService.Wiring autoServiceWiring;- @AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE, //- description = "Text color for registers whose value is not known", //- help = @HelpInfo(anchor = "colors"))- protected Color registerStaleColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE;- @AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE_SEL, //- description = "Selected text color for registers whose value is not known", //- help = @HelpInfo(anchor = "colors"))- protected Color registerStaleSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE_SEL;- @AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED, //- description = "Text color for registers whose value just changed", //- help = @HelpInfo(anchor = "colors"))- protected Color registerChangesColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED;- @AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED_SEL, //- description = "Selected text color for registers whose value just changed", //- help = @HelpInfo(anchor = "colors"))- protected Color registerChangesSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED_SEL;-@SuppressWarnings("unused")private final AutoOptions.Wiring autoOptionsWiring;@@ -546,8 +539,7 @@ public class DebuggerRegistersProvider extends ComponentProviderAdaptersetTitle("[" + DebuggerResources.TITLE_PROVIDER_REGISTERS + "]");setWindowGroup("Debugger.Core.disconnected");setIntraGroupPosition(WindowPosition.STACK);- mainPanel.setBorder(BorderFactory- .createLineBorder(new GColor("color.border.provider.disconnected"), 2));+ mainPanel.setBorder(BorderFactory.createLineBorder(COLOR_BORDER_DISCONNECTED, 2));setTransient();}else {@@ -1363,32 +1355,6 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter}).thenApply(__ -> null);}- private void repaintTable() {- if (regsTable != null) {- regsTable.repaint();- }- }-- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE)- private void setRegisterStaleColor(Color color) {- repaintTable();- }-- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE_SEL)- private void setRegisterStaleSelColor(Color color) {- repaintTable();- }-- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED)- private void setRegisterChangesColor(Color color) {- repaintTable();- }-- @AutoOptionConsumed(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED_SEL)- private void setRegisterChangesSelColor(Color color) {- repaintTable();- }-protected String formatAddressInfo(Address address) {return address.toString(); // TODO;// TODO: Examine static mapped programs, toodiff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.javaindex 75a32475bf..f39a8eedcc 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java@@ -38,6 +38,7 @@ import docking.action.ToggleDockingAction;import docking.action.builder.ActionBuilder;import docking.widgets.table.*;import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn;+import generic.theme.GColor;import ghidra.app.context.ListingActionContext;import ghidra.app.context.ProgramLocationActionContext;import ghidra.app.plugin.core.data.AbstractSettingsDialog;@@ -56,8 +57,6 @@ import ghidra.docking.settings.*;import ghidra.framework.model.DomainObject;import ghidra.framework.model.DomainObjectChangeRecord;import ghidra.framework.options.SaveState;-import ghidra.framework.options.annotation.AutoOptionDefined;-import ghidra.framework.options.annotation.HelpInfo;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoServiceConsumed;import ghidra.pcode.exec.DebuggerPcodeUtils;@@ -93,6 +92,15 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapterprivate static final String KEY_ROW_COUNT = "rowCount";private static final String PREFIX_ROW = "row";+ private static final Color COLOR_FOREGROUND_STALE =+ new GColor("color.debugger.plugin.resources.watch.stale");+ private static final Color COLOR_FOREGROUND_STALE_SEL =+ new GColor("color.debugger.plugin.resources.watch.stale.selected");+ private static final Color COLOR_FOREGROUND_CHANGED =+ new GColor("color.debugger.plugin.resources.watch.changed");+ private static final Color COLOR_FOREGROUND_CHANGED_SEL =+ new GColor("color.debugger.plugin.resources.watch.changed.selected");+interface WatchTypeSettings {String NAME = DebuggerResources.NAME_WATCH_TYPE_SETTINGS;String DESCRIPTION = DebuggerResources.DESCRIPTION_WATCH_TYPE_SETTINGS;@@ -286,18 +294,18 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapterWatchRow row = (WatchRow) data.getRowObject();if (!row.isKnown()) {if (data.isSelected()) {- setForeground(watchStaleSelColor);+ setForeground(COLOR_FOREGROUND_STALE_SEL);}else {- setForeground(watchStaleColor);+ setForeground(COLOR_FOREGROUND_STALE);}}else if (row.isChanged()) {if (data.isSelected()) {- setForeground(watchChangesSelColor);+ setForeground(COLOR_FOREGROUND_CHANGED_SEL);}else {- setForeground(watchChangesColor);+ setForeground(COLOR_FOREGROUND_CHANGED);}}return this;@@ -337,27 +345,6 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter@SuppressWarnings("unused")private final AutoService.Wiring autoServiceWiring;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_WATCH_STALE, //- description = "Text color for watches whose value is not known", //- help = @HelpInfo(anchor = "colors"))- protected Color watchStaleColor = DebuggerResources.DEFAULT_COLOR_WATCH_STALE;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_WATCH_STALE_SEL, //- description = "Selected text color for watches whose value is not known", //- help = @HelpInfo(anchor = "colors"))- protected Color watchStaleSelColor = DebuggerResources.DEFAULT_COLOR_WATCH_STALE_SEL;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_WATCH_CHANGED, //- description = "Text color for watches whose value just changed", //- help = @HelpInfo(anchor = "colors"))- protected Color watchChangesColor = DebuggerResources.DEFAULT_COLOR_WATCH_CHANGED;- @AutoOptionDefined(- name = DebuggerResources.OPTION_NAME_COLORS_WATCH_CHANGED_SEL, //- description = "Selected text color for watches whose value just changed", //- help = @HelpInfo(anchor = "colors"))- protected Color watchChangesSelColor = DebuggerResources.DEFAULT_COLOR_WATCH_CHANGED_SEL;-private final AddressSet changed = new AddressSet();private final AsyncDebouncer<Void> changeDebouncer =new AsyncDebouncer<>(AsyncTimer.DEFAULT_TIMER, 100);diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.javaindex 2b9480cb00..f19818d1e8 100644--- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.java+++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.java@@ -127,10 +127,10 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {IntRangeMap map =program.getIntRangeMap(PropertyBasedBackgroundColorModel.COLOR_PROPERTY_NAME);AddressSet staleSet =- map.getAddressSet(DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE.getRGB());+ map.getAddressSet(DebuggerResources.COLOR_BACKGROUND_STALE.getRGB());assertEquals(tb.set(tb.range(stSpace, 0x00401001, 0x0040ffff)), staleSet);AddressSet errorSet =- map.getAddressSet(DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR.getRGB());+ map.getAddressSet(DebuggerResources.COLOR_BACKGROUND_ERROR.getRGB());assertEquals(tb.set(tb.range(stSpace, 0x00401000, 0x00401000)), errorSet);}diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPluginTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPluginTest.javaindex 7522f2ed54..4a29f62436 100644--- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPluginTest.java+++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/diff/DebuggerTraceViewDiffPluginTest.java@@ -145,9 +145,9 @@ public class DebuggerTraceViewDiffPluginTest extends AbstractGhidraHeadedDebuggewaitOn(traceDiffPlugin.startComparison(TraceSchedule.snap(1)));- assertListingBackgroundAt(DebuggerTraceViewDiffPlugin.DEFAULT_DIFF_COLOR,+ assertListingBackgroundAt(DebuggerTraceViewDiffPlugin.COLOR_DIFF,traceDiffPlugin.altListingPanel, tb.addr(0x00400123), 0);- assertListingBackgroundAt(DebuggerTraceViewDiffPlugin.DEFAULT_DIFF_COLOR,+ assertListingBackgroundAt(DebuggerTraceViewDiffPlugin.COLOR_DIFF,listingProvider.getListingPanel(), tb.addr(0x00400123), 0);AddressSetView expected = tb.set(tb.range(0x00400123, 0x0040012a));diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.javaindex 40e428a591..66b42e87e6 100644--- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java+++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java@@ -596,7 +596,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUItraceManager.activateThread(thread);waitForSwing();- assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_REGISTER_MARKERS,+ assertListingBackgroundAt(DebuggerResources.COLOR_REGISTER_MARKERS,listingProvider.getListingPanel(), tb.addr(0x00401234), 0);}@@ -634,7 +634,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUItraceManager.activateThread(thread);waitForSwing();- assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_REGISTER_MARKERS,+ assertListingBackgroundAt(DebuggerResources.COLOR_REGISTER_MARKERS,codePlugin.getListingPanel(), ss.getAddress(0x00601234), 0);// For verifying static view didn't move@@ -781,11 +781,11 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUItraceManager.activateTrace(tb.trace);waitForSwing();- assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE,+ assertListingBackgroundAt(DebuggerResources.COLOR_BACKGROUND_STALE,listingProvider.getListingPanel(), tb.addr(0x00401233), 0);assertListingBackgroundAt(Colors.BACKGROUND, listingProvider.getListingPanel(),tb.addr(0x00401234), 0);- assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR,+ assertListingBackgroundAt(DebuggerResources.COLOR_BACKGROUND_ERROR,listingProvider.getListingPanel(), tb.addr(0x00401235), 0);}diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.javaindex 2e7d420145..90856c40c3 100644--- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.java+++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.java@@ -463,7 +463,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebuggetraceManager.activateThread(thread);waitForSwing();- assertViewerBackgroundAt(DebuggerResources.DEFAULT_COLOR_REGISTER_MARKERS,+ assertViewerBackgroundAt(DebuggerResources.COLOR_REGISTER_MARKERS,memBytesProvider.getByteViewerPanel(), tb.addr(0x00401234));}@@ -561,11 +561,11 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebuggewaitForSwing();// TODO: Colors should be blended with cursor color....- assertViewerBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE,+ assertViewerBackgroundAt(DebuggerResources.COLOR_BACKGROUND_STALE,memBytesProvider.getByteViewerPanel(), tb.addr(0x00401233));assertViewerBackgroundAt(GhidraOptions.DEFAULT_CURSOR_LINE_COLOR,memBytesProvider.getByteViewerPanel(), tb.addr(0x00401234));- assertViewerBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR,+ assertViewerBackgroundAt(DebuggerResources.COLOR_BACKGROUND_ERROR,memBytesProvider.getByteViewerPanel(), tb.addr(0x00401235));}