mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-1981 - Theming - Color conversion for Debugger modules
This commit is contained in:
parent
9a0d7892da
commit
abe31c5a95
21 changed files with 287 additions and 196 deletions
|
@ -6,6 +6,7 @@
|
||||||
##MODULE IP: Tango Icons - Public Domain
|
##MODULE IP: Tango Icons - Public Domain
|
||||||
Module.manifest||GHIDRA||||END|
|
Module.manifest||GHIDRA||||END|
|
||||||
data/ExtensionPoint.manifest||GHIDRA||||END|
|
data/ExtensionPoint.manifest||GHIDRA||||END|
|
||||||
|
data/debugger.theme.properties||GHIDRA||||END|
|
||||||
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
|
||||||
src/main/help/help/shared/arrow.gif||GHIDRA||||END|
|
src/main/help/help/shared/arrow.gif||GHIDRA||||END|
|
||||||
src/main/help/help/shared/close16.gif||GHIDRA||||END|
|
src/main/help/help/shared/close16.gif||GHIDRA||||END|
|
||||||
|
|
68
Ghidra/Debug/Debugger/data/debugger.theme.properties
Normal file
68
Ghidra/Debug/Debugger/data/debugger.theme.properties
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
[Defaults]
|
||||||
|
|
||||||
|
color.bg.debugger.diff.marker = moccasin
|
||||||
|
|
||||||
|
color.bg.debugger.listing.blended = color.bg
|
||||||
|
color.bg.debugger.memory.state = color.bg
|
||||||
|
|
||||||
|
color.debugger.plugin.plugin.memview.arrow = red
|
||||||
|
color.debugger.plugin.memview.box = blue
|
||||||
|
color.debugger.plugin.memview.box.type.instructions = rgb(128, 000, 000)
|
||||||
|
color.debugger.plugin.memview.box.type.process = rgb(200, 200, 255)
|
||||||
|
color.debugger.plugin.memview.box.type.thread = rgb(200, 255, 255)
|
||||||
|
color.debugger.plugin.memview.box.type.module = lime
|
||||||
|
color.debugger.plugin.memview.box.type.region = yellow
|
||||||
|
color.debugger.plugin.memview.box.type.image = magenta
|
||||||
|
color.debugger.plugin.memview.box.type.virtual.alloc = lightgray
|
||||||
|
color.debugger.plugin.memview.box.type.heap.create = blue
|
||||||
|
color.debugger.plugin.memview.box.type.heap.alloc = rgb(000, 100, 050)
|
||||||
|
color.debugger.plugin.memview.box.type.pool = rgb(100, 000, 150)
|
||||||
|
color.debugger.plugin.memview.box.type.stack = cyan
|
||||||
|
color.debugger.plugin.memview.box.type.perfinfo = lightgray
|
||||||
|
color.debugger.plugin.memview.box.type.read.memory = darkgray
|
||||||
|
color.debugger.plugin.memview.box.type.write.memory = blue
|
||||||
|
color.debugger.plugin.memview.box.type.breakpoint = red
|
||||||
|
|
||||||
|
|
||||||
|
color.bg.debugger.plugin.objects.default = color.bg
|
||||||
|
color.fg.debugger.plugin.objects.default = color.fg
|
||||||
|
color.fg.debugger.plugin.objects.invisible = lightgray
|
||||||
|
color.fg.debugger.plugin.objects.invalidated = lightgray
|
||||||
|
color.fg.debugger.plugin.objects.modified = red
|
||||||
|
color.fg.debugger.plugin.objects.subscribed = black
|
||||||
|
color.fg.debugger.plugin.objects.error = color.fg.error
|
||||||
|
color.fg.debugger.plugin.objects.intrinsic = blue
|
||||||
|
color.fg.debugger.plugin.objects.target = magenta
|
||||||
|
color.fg.debugger.plugin.objects.accessor = lightgray
|
||||||
|
color.fg.debugger.plugin.objects.link = green
|
||||||
|
|
||||||
|
color.bg.debugger.plugin.resources.stale = lightgray
|
||||||
|
color.bg.debugger.plugin.resources.error = lightpink
|
||||||
|
|
||||||
|
color.debugger.plugin.resources.register.marker = lightcoral
|
||||||
|
color.debugger.plugin.resources.register.stale = gray
|
||||||
|
color.debugger.plugin.resources.register.stale.selected = lightgray
|
||||||
|
color.debugger.plugin.resources.register.changed = red
|
||||||
|
color.debugger.plugin.resources.register.changed.selected = lightcoral
|
||||||
|
|
||||||
|
color.debugger.plugin.resources.watch.stale = gray
|
||||||
|
color.debugger.plugin.resources.watch.stale.selected = lightgray
|
||||||
|
color.debugger.plugin.resources.watch.changed = red
|
||||||
|
color.debugger.plugin.resources.watch.changed.selected = lightcoral
|
||||||
|
|
||||||
|
color.debugger.plugin.resources.value.changed = red
|
||||||
|
color.debugger.plugin.resources.value.changed.selected = lightcoral
|
||||||
|
|
||||||
|
color.debugger.plugin.resources.pcode.counter = lightgreen
|
||||||
|
|
||||||
|
color.debugger.plugin.resources.breakpoint.marker.enabled = lightsteelblue
|
||||||
|
color.debugger.plugin.resources.breakpoint.marker.disabled = color.debugger.plugin.resources.breakpoint.marker.enabled
|
||||||
|
color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective = silver
|
||||||
|
color.debugger.plugin.resources.breakpoint.marker.disabled.ineffective = color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[Dark Defaults]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import docking.action.ToggleDockingAction;
|
||||||
import docking.action.builder.*;
|
import docking.action.builder.*;
|
||||||
import docking.widgets.table.*;
|
import docking.widgets.table.*;
|
||||||
import docking.widgets.tree.GTreeNode;
|
import docking.widgets.tree.GTreeNode;
|
||||||
|
import generic.theme.GColor;
|
||||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||||
import ghidra.app.plugin.core.debug.gui.breakpoint.DebuggerBreakpointsPlugin;
|
import ghidra.app.plugin.core.debug.gui.breakpoint.DebuggerBreakpointsPlugin;
|
||||||
import ghidra.app.plugin.core.debug.gui.console.DebuggerConsolePlugin;
|
import ghidra.app.plugin.core.debug.gui.console.DebuggerConsolePlugin;
|
||||||
|
@ -54,7 +55,8 @@ import ghidra.framework.plugintool.Plugin;
|
||||||
import ghidra.framework.plugintool.util.PluginUtils;
|
import ghidra.framework.plugintool.util.PluginUtils;
|
||||||
import ghidra.program.database.ProgramContentHandler;
|
import ghidra.program.database.ProgramContentHandler;
|
||||||
import ghidra.trace.model.Trace;
|
import ghidra.trace.model.Trace;
|
||||||
import ghidra.util.*;
|
import ghidra.util.HelpLocation;
|
||||||
|
import ghidra.util.Msg;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import resources.MultiIcon;
|
import resources.MultiIcon;
|
||||||
import resources.ResourceManager;
|
import resources.ResourceManager;
|
||||||
|
@ -274,44 +276,51 @@ public interface DebuggerResources {
|
||||||
String BOOKMARK_CATEGORY_MEMORY_READ_ERROR = "Debugger Memory Read Error";
|
String BOOKMARK_CATEGORY_MEMORY_READ_ERROR = "Debugger Memory Read Error";
|
||||||
|
|
||||||
String OPTION_NAME_COLORS_STALE_MEMORY = "Colors.Stale Memory";
|
String OPTION_NAME_COLORS_STALE_MEMORY = "Colors.Stale Memory";
|
||||||
Color DEFAULT_COLOR_BACKGROUND_STALE = Color.LIGHT_GRAY;
|
Color DEFAULT_COLOR_BACKGROUND_STALE = new GColor("color.bg.debugger.plugin.resources.stale");
|
||||||
|
|
||||||
String OPTION_NAME_COLORS_ERROR_MEMORY = "Colors.Error Memory";
|
String OPTION_NAME_COLORS_ERROR_MEMORY = "Colors.Error Memory";
|
||||||
Color DEFAULT_COLOR_BACKGROUND_ERROR = new Color(1.0f, 0.75f, 0.75f);
|
Color DEFAULT_COLOR_BACKGROUND_ERROR = new GColor("color.bg.debugger.plugin.resources.error");
|
||||||
|
|
||||||
int PRIORITY_REGISTER_MARKER = 10;
|
int PRIORITY_REGISTER_MARKER = 10;
|
||||||
String OPTION_NAME_COLORS_TRACKING_MARKERS = "Colors.Tracking Markers";
|
String OPTION_NAME_COLORS_TRACKING_MARKERS = "Colors.Tracking Markers";
|
||||||
Color DEFAULT_COLOR_REGISTER_MARKERS = new Color(0.75f, 0.875f, 0.75f);
|
Color DEFAULT_COLOR_REGISTER_MARKERS =
|
||||||
|
new GColor("color.debugger.plugin.resources.register.marker");
|
||||||
ImageIcon ICON_REGISTER_MARKER = ResourceManager.loadImage("images/register-marker.png");
|
ImageIcon ICON_REGISTER_MARKER = ResourceManager.loadImage("images/register-marker.png");
|
||||||
|
|
||||||
ImageIcon ICON_EVENT_MARKER = ICON_REGISTER_MARKER; // TODO: Another icon?
|
ImageIcon ICON_EVENT_MARKER = ICON_REGISTER_MARKER; // TODO: Another icon?
|
||||||
// At least rename to "marker-arrow", and then have both ref it.
|
// At least rename to "marker-arrow", and then have both ref it.
|
||||||
|
|
||||||
|
//@formatter:off
|
||||||
String OPTION_NAME_COLORS_REGISTER_STALE = "Colors.Stale Registers";
|
String OPTION_NAME_COLORS_REGISTER_STALE = "Colors.Stale Registers";
|
||||||
Color DEFAULT_COLOR_REGISTER_STALE = Color.GRAY;
|
Color DEFAULT_COLOR_REGISTER_STALE = new GColor("color.debugger.plugin.resources.register.stale");
|
||||||
String OPTION_NAME_COLORS_REGISTER_STALE_SEL = "Colors.Stale Registers (selected)";
|
String OPTION_NAME_COLORS_REGISTER_STALE_SEL = "Colors.Stale Registers (selected)";
|
||||||
Color DEFAULT_COLOR_REGISTER_STALE_SEL = Color.LIGHT_GRAY;
|
Color DEFAULT_COLOR_REGISTER_STALE_SEL = new GColor("color.debugger.plugin.resources.register.stale.selected");
|
||||||
String OPTION_NAME_COLORS_REGISTER_CHANGED = "Colors.Changed Registers";
|
String OPTION_NAME_COLORS_REGISTER_CHANGED = "Colors.Changed Registers";
|
||||||
Color DEFAULT_COLOR_REGISTER_CHANGED = Color.RED;
|
Color DEFAULT_COLOR_REGISTER_CHANGED = new GColor("color.debugger.plugin.resources.register.changed");
|
||||||
String OPTION_NAME_COLORS_REGISTER_CHANGED_SEL = "Colors.Changed Registers (selected)";
|
String OPTION_NAME_COLORS_REGISTER_CHANGED_SEL = "Colors.Changed Registers (selected)";
|
||||||
Color DEFAULT_COLOR_REGISTER_CHANGED_SEL = ColorUtils.blend(Color.RED, Color.WHITE, 0.5f);
|
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";
|
String OPTION_NAME_COLORS_WATCH_STALE = "Colors.Stale Watches";
|
||||||
Color DEFAULT_COLOR_WATCH_STALE = Color.GRAY;
|
Color DEFAULT_COLOR_WATCH_STALE = new GColor("color.debugger.plugin.resources.watch.stale");
|
||||||
String OPTION_NAME_COLORS_WATCH_STALE_SEL = "Colors.Stale Watches (selected)";
|
String OPTION_NAME_COLORS_WATCH_STALE_SEL = "Colors.Stale Watches (selected)";
|
||||||
Color DEFAULT_COLOR_WATCH_STALE_SEL = Color.LIGHT_GRAY;
|
Color DEFAULT_COLOR_WATCH_STALE_SEL = new GColor("color.debugger.plugin.resources.watch.stale.selected");
|
||||||
String OPTION_NAME_COLORS_WATCH_CHANGED = "Colors.Changed Watches";
|
String OPTION_NAME_COLORS_WATCH_CHANGED = "Colors.Changed Watches";
|
||||||
Color DEFAULT_COLOR_WATCH_CHANGED = Color.RED;
|
Color DEFAULT_COLOR_WATCH_CHANGED = new GColor("color.debugger.plugin.resources.watch.changed");
|
||||||
String OPTION_NAME_COLORS_WATCH_CHANGED_SEL = "Colors.Changed Watches (selected)";
|
String OPTION_NAME_COLORS_WATCH_CHANGED_SEL = "Colors.Changed Watches (selected)";
|
||||||
Color DEFAULT_COLOR_WATCH_CHANGED_SEL = ColorUtils.blend(Color.RED, Color.WHITE, 0.5f);
|
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";
|
String OPTION_NAME_COLORS_VALUE_CHANGED = "Colors.Changed Values";
|
||||||
Color DEFAULT_COLOR_VALUE_CHANGED = Color.RED;
|
Color DEFAULT_COLOR_VALUE_CHANGED = new GColor("color.debugger.plugin.resources.value.changed");
|
||||||
String OPTION_NAME_COLORS_VALUE_CHANGED_SEL = "Colors.Changed Values (selected)";
|
String OPTION_NAME_COLORS_VALUE_CHANGED_SEL = "Colors.Changed Values (selected)";
|
||||||
Color DEFAULT_COLOR_VALUE_CHANGED_SEL = ColorUtils.blend(Color.RED, Color.WHITE, 0.5f);
|
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";
|
String OPTION_NAME_COLORS_PCODE_COUNTER = "Colors.Pcode Counter";
|
||||||
Color DEFAULT_COLOR_PCODE_COUNTER = new Color(0.75f, 0.875f, 0.75f);
|
Color DEFAULT_COLOR_PCODE_COUNTER = new GColor("color.debugger.plugin.resources.pcode.counter");
|
||||||
|
|
||||||
String NAME_BREAKPOINT_MARKER_ENABLED = "Enabled Breakpoint";
|
String NAME_BREAKPOINT_MARKER_ENABLED = "Enabled Breakpoint";
|
||||||
String NAME_BREAKPOINT_MARKER_DISABLED = "Disabled Breakpoint";
|
String NAME_BREAKPOINT_MARKER_DISABLED = "Disabled Breakpoint";
|
||||||
|
@ -349,17 +358,16 @@ public interface DebuggerResources {
|
||||||
ImageIcon ICON_UNIQUE_REF_WRITE = ResourceManager.loadImage("images/cursor_arrow.gif"); // TODO
|
ImageIcon ICON_UNIQUE_REF_WRITE = ResourceManager.loadImage("images/cursor_arrow.gif"); // TODO
|
||||||
Icon ICON_UNIQUE_REF_RW = new MultiIcon(ICON_UNIQUE_REF_READ, ICON_UNIQUE_REF_WRITE); // TODO
|
Icon 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";
|
String OPTION_NAME_COLORS_ENABLED_BREAKPOINT_MARKERS = "Colors.Enabled Breakpoint Markers";
|
||||||
Color DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS = new Color(0.75f, 0.75f, 0.875f);
|
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";
|
String OPTION_NAME_COLORS_DISABLED_BREAKPOINT_MARKERS = "Colors.Disabled Breakpoint Markers";
|
||||||
Color DEFAULT_COLOR_DISABLED_BREAKPOINT_MARKERS = DEFAULT_COLOR_ENABLED_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 =
|
String OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_MARKERS = "Colors.Ineffective Enabled Breakpoint Markers";
|
||||||
"Colors.Ineffective Enabled Breakpoint Markers";
|
Color DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective");
|
||||||
Color DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS = new Color(0.75f, 0.75f, 0.75f);
|
String OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_MARKERS = "Colors.Ineffective Disabled Breakpoint Markers";
|
||||||
String OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_MARKERS =
|
Color DEFAULT_COLOR_INEFF_DIS_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.disabled.ineffective");
|
||||||
"Colors.Ineffective Disabled Breakpoint Markers";
|
//@formatter:on
|
||||||
Color DEFAULT_COLOR_INEFF_DIS_BREAKPOINT_MARKERS =
|
|
||||||
DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS;
|
|
||||||
|
|
||||||
String OPTION_NAME_COLORS_ENABLED_BREAKPOINT_COLORING_BACKGROUND =
|
String OPTION_NAME_COLORS_ENABLED_BREAKPOINT_COLORING_BACKGROUND =
|
||||||
"Colors.Enabled Breakpoint Markers Have Background";
|
"Colors.Enabled Breakpoint Markers Have Background";
|
||||||
|
|
|
@ -28,6 +28,7 @@ import javax.swing.event.ChangeListener;
|
||||||
import docking.ActionContext;
|
import docking.ActionContext;
|
||||||
import docking.action.DockingAction;
|
import docking.action.DockingAction;
|
||||||
import docking.action.ToggleDockingAction;
|
import docking.action.ToggleDockingAction;
|
||||||
|
import generic.theme.GColor;
|
||||||
import ghidra.app.plugin.PluginCategoryNames;
|
import ghidra.app.plugin.PluginCategoryNames;
|
||||||
import ghidra.app.plugin.core.codebrowser.MarkerServiceBackgroundColorModel;
|
import ghidra.app.plugin.core.codebrowser.MarkerServiceBackgroundColorModel;
|
||||||
import ghidra.app.plugin.core.debug.*;
|
import ghidra.app.plugin.core.debug.*;
|
||||||
|
@ -57,28 +58,19 @@ import ghidra.trace.model.program.TraceProgramView;
|
||||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
|
|
||||||
@PluginInfo(
|
@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 " +
|
||||||
shortDescription = "Compare memory state between times in a trace",
|
"trace. The comparison is limited to raw bytes.", category = PluginCategoryNames.DEBUGGER, packageName = DebuggerPluginPackage.NAME, status = PluginStatus.RELEASED, eventsConsumed = {
|
||||||
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,
|
TraceClosedPluginEvent.class,
|
||||||
},
|
}, eventsProduced = {}, servicesRequired = {
|
||||||
eventsProduced = {},
|
|
||||||
servicesRequired = {
|
|
||||||
DebuggerListingService.class,
|
DebuggerListingService.class,
|
||||||
},
|
}, servicesProvided = {})
|
||||||
servicesProvided = {})
|
|
||||||
public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {
|
public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {
|
||||||
protected static final String MARKER_NAME = "Trace Diff";
|
protected static final String MARKER_NAME = "Trace Diff";
|
||||||
protected static final String MARKER_DESCRIPTION = "Difference between snapshots in this trace";
|
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_CATEGORY = "Listing Fields";
|
||||||
public static final String DIFF_COLOR_NAME = "Selection Colors.Difference Color";
|
public static final String DIFF_COLOR_NAME = "Selection Colors.Difference Color";
|
||||||
public static final Color DEFAULT_DIFF_COLOR = new Color(255, 230, 180); // light orange
|
public static final Color DEFAULT_DIFF_COLOR = new GColor("color.bg.debugger.diff.marker");
|
||||||
|
|
||||||
protected class ListingCoordinationListener implements CoordinatedListingPanelListener {
|
protected class ListingCoordinationListener implements CoordinatedListingPanelListener {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,6 +19,7 @@ import java.awt.Color;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import generic.theme.GColor;
|
||||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||||
import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;
|
import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;
|
||||||
import ghidra.app.util.viewer.listingpanel.ListingPanel;
|
import ghidra.app.util.viewer.listingpanel.ListingPanel;
|
||||||
|
@ -34,7 +35,7 @@ import ghidra.trace.model.program.TraceProgramView;
|
||||||
import ghidra.util.ColorUtils;
|
import ghidra.util.ColorUtils;
|
||||||
|
|
||||||
public class MemoryStateListingBackgroundColorModel implements ListingBackgroundColorModel {
|
public class MemoryStateListingBackgroundColorModel implements ListingBackgroundColorModel {
|
||||||
private Color defaultBackgroundColor = Color.WHITE;
|
private Color defaultBackgroundColor = new GColor("color.bg.debugger.memory.state");
|
||||||
|
|
||||||
private AddressIndexMap addressIndexMap;
|
private AddressIndexMap addressIndexMap;
|
||||||
private TraceProgramView view;
|
private TraceProgramView view;
|
||||||
|
|
|
@ -21,11 +21,14 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import docking.widgets.fieldpanel.support.BackgroundColorModel;
|
import docking.widgets.fieldpanel.support.BackgroundColorModel;
|
||||||
|
import generic.theme.GColor;
|
||||||
import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;
|
import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;
|
||||||
import ghidra.app.util.viewer.listingpanel.ListingPanel;
|
import ghidra.app.util.viewer.listingpanel.ListingPanel;
|
||||||
import ghidra.util.ColorUtils.ColorBlender;
|
import ghidra.util.ColorUtils.ColorBlender;
|
||||||
|
|
||||||
public class MultiBlendedListingBackgroundColorModel implements ListingBackgroundColorModel {
|
public class MultiBlendedListingBackgroundColorModel implements ListingBackgroundColorModel {
|
||||||
|
private static final Color BG_COLOR_EMPTY = new GColor("color.bg.debugger.listing.blended");
|
||||||
|
|
||||||
private final List<BackgroundColorModel> models = new ArrayList<>();
|
private final List<BackgroundColorModel> models = new ArrayList<>();
|
||||||
|
|
||||||
private final ColorBlender blender = new ColorBlender();
|
private final ColorBlender blender = new ColorBlender();
|
||||||
|
@ -60,7 +63,7 @@ public class MultiBlendedListingBackgroundColorModel implements ListingBackgroun
|
||||||
@Override
|
@Override
|
||||||
public Color getDefaultBackgroundColor() {
|
public Color getDefaultBackgroundColor() {
|
||||||
if (models.isEmpty()) {
|
if (models.isEmpty()) {
|
||||||
return Color.WHITE;
|
return BG_COLOR_EMPTY;
|
||||||
}
|
}
|
||||||
return models.get(0).getDefaultBackgroundColor();
|
return models.get(0).getDefaultBackgroundColor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ import java.awt.Graphics;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import generic.theme.GColor;
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Java;
|
||||||
import ghidra.program.model.address.AddressRange;
|
import ghidra.program.model.address.AddressRange;
|
||||||
import ghidra.trace.model.Lifespan;
|
import ghidra.trace.model.Lifespan;
|
||||||
|
|
||||||
|
@ -34,7 +36,7 @@ public class MemoryBox {
|
||||||
protected long stopAddr = -1;
|
protected long stopAddr = -1;
|
||||||
protected long startTime;
|
protected long startTime;
|
||||||
protected long stopTime = -1;
|
protected long stopTime = -1;
|
||||||
protected Color color = Color.BLUE;
|
protected Color color = new GColor("color.bg.debugger.memview.box");
|
||||||
|
|
||||||
protected int pixAstart;
|
protected int pixAstart;
|
||||||
protected int pixAend;
|
protected int pixAend;
|
||||||
|
@ -108,8 +110,9 @@ public class MemoryBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAddressPixelWidth() {
|
public int getAddressPixelWidth() {
|
||||||
if (pixAend - pixAstart <= 0)
|
if (pixAend - pixAstart <= 0) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
return pixAend - pixAstart;
|
return pixAend - pixAstart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,8 +124,9 @@ public class MemoryBox {
|
||||||
if (pixTend < pixTstart) {
|
if (pixTend < pixTstart) {
|
||||||
pixTend = boundT;
|
pixTend = boundT;
|
||||||
}
|
}
|
||||||
if (pixTend - pixTstart == 0)
|
if (pixTend - pixTstart == 0) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
return pixTend - pixTstart;
|
return pixTend - pixTstart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +151,7 @@ public class MemoryBox {
|
||||||
int w = vertical ? getTimePixelWidth() : getAddressPixelWidth();
|
int w = vertical ? getTimePixelWidth() : getAddressPixelWidth();
|
||||||
int y = vertical ? getAddressPixelStart() : getTimePixelStart();
|
int y = vertical ? getAddressPixelStart() : getTimePixelStart();
|
||||||
int h = vertical ? getAddressPixelWidth() : getTimePixelWidth();
|
int h = vertical ? getAddressPixelWidth() : getTimePixelWidth();
|
||||||
g.setColor(Color.BLACK);
|
g.setColor(Java.BORDER);
|
||||||
g.fillRect(x - 1, y - 1, w + 2, h + 2);
|
g.fillRect(x - 1, y - 1, w + 2, h + 2);
|
||||||
g.setColor(color);
|
g.setColor(color);
|
||||||
g.fillRect(x, y, w, h);
|
g.fillRect(x, y, w, h);
|
||||||
|
@ -158,7 +162,7 @@ public class MemoryBox {
|
||||||
int w = vertical ? sz : getAddressPixelWidth();
|
int w = vertical ? sz : getAddressPixelWidth();
|
||||||
int y = vertical ? getAddressPixelStart() : 0;
|
int y = vertical ? getAddressPixelStart() : 0;
|
||||||
int h = vertical ? getAddressPixelWidth() : sz;
|
int h = vertical ? getAddressPixelWidth() : sz;
|
||||||
g.setColor(Color.BLACK);
|
g.setColor(Java.BORDER);
|
||||||
g.fillRect(x - 1, y - 1, w + 2, h + 2);
|
g.fillRect(x - 1, y - 1, w + 2, h + 2);
|
||||||
g.setColor(color);
|
g.setColor(color);
|
||||||
g.fillRect(x, y, w, h);
|
g.fillRect(x, y, w, h);
|
||||||
|
@ -169,7 +173,7 @@ public class MemoryBox {
|
||||||
int w = vertical ? 1 : sz;
|
int w = vertical ? 1 : sz;
|
||||||
int y = vertical ? 0 : getTimePixelStart();
|
int y = vertical ? 0 : getTimePixelStart();
|
||||||
int h = vertical ? sz : 1;
|
int h = vertical ? sz : 1;
|
||||||
g.setColor(Color.BLACK);
|
g.setColor(Java.BORDER);
|
||||||
g.fillRect(x - 1, y - 1, w + 2, h + 2);
|
g.fillRect(x - 1, y - 1, w + 2, h + 2);
|
||||||
g.setColor(color);
|
g.setColor(color);
|
||||||
g.fillRect(x, y, w, h);
|
g.fillRect(x, y, w, h);
|
||||||
|
@ -227,10 +231,12 @@ public class MemoryBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean inPixelRange(long pos) {
|
public boolean inPixelRange(long pos) {
|
||||||
if (pos < pixTstart)
|
if (pos < pixTstart) {
|
||||||
return false;
|
return false;
|
||||||
if (pixTend <= 0)
|
}
|
||||||
|
if (pixTend <= 0) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
return pos <= pixTend;
|
return pos <= pixTend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@ package ghidra.app.plugin.core.debug.gui.memview;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
|
||||||
|
import generic.theme.GColor;
|
||||||
|
|
||||||
public enum MemviewBoxType {
|
public enum MemviewBoxType {
|
||||||
INSTRUCTIONS,
|
INSTRUCTIONS,
|
||||||
PROCESS,
|
PROCESS,
|
||||||
|
@ -35,21 +37,21 @@ public enum MemviewBoxType {
|
||||||
BREAKPOINT;
|
BREAKPOINT;
|
||||||
|
|
||||||
Color[] colors = { //
|
Color[] colors = { //
|
||||||
new Color(128, 000, 000), // INSTRUCTIONS
|
new GColor("color.debugger.plugin.memview.box.type.instructions"),
|
||||||
new Color(200, 200, 255), // PROCESS
|
new GColor("color.debugger.plugin.memview.box.type.process"),
|
||||||
new Color(200, 255, 255), // THREAD
|
new GColor("color.debugger.plugin.memview.box.type.thread"),
|
||||||
Color.GREEN, //new Color(000, 150, 200), // MODULE
|
new GColor("color.debugger.plugin.memview.box.type.module"),
|
||||||
Color.YELLOW, //new Color(000, 150, 200), // REGION
|
new GColor("color.debugger.plugin.memview.box.type.region"),
|
||||||
Color.MAGENTA, //new Color(050, 100, 255), // IMAGE
|
new GColor("color.debugger.plugin.memview.box.type.image"),
|
||||||
Color.LIGHT_GRAY, // VIRTUAL_ALLOC
|
new GColor("color.debugger.plugin.memview.box.type.virtual.alloc"),
|
||||||
Color.BLUE, // HEAP_CREATE
|
new GColor("color.debugger.plugin.memview.box.type.heap.create"),
|
||||||
new Color(000, 100, 050), // HEAP_ALLOC
|
new GColor("color.debugger.plugin.memview.box.type.heap.alloc"),
|
||||||
new Color(100, 000, 150), // POOL
|
new GColor("color.debugger.plugin.memview.box.type.pool"),
|
||||||
Color.CYAN, // STACK
|
new GColor("color.debugger.plugin.memview.box.type.stack"),
|
||||||
Color.LIGHT_GRAY, // PERFINFO
|
new GColor("color.debugger.plugin.memview.box.type.perfinfo"),
|
||||||
Color.DARK_GRAY, // READ_MEMORY
|
new GColor("color.debugger.plugin.memview.box.type.read.memory"),
|
||||||
Color.BLUE, // WRITE_MEMORY
|
new GColor("color.debugger.plugin.memview.box.type.write.memory"),
|
||||||
Color.RED, // WRITE_MEMORY
|
new GColor("color.debugger.plugin.memview.box.type.breakpoint"),
|
||||||
};
|
};
|
||||||
|
|
||||||
public Color getColor() {
|
public Color getColor() {
|
||||||
|
|
|
@ -22,16 +22,20 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import generic.theme.GColor;
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Java;
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
import ghidra.program.model.address.AddressRange;
|
import ghidra.program.model.address.AddressRange;
|
||||||
|
|
||||||
public class MemviewPanel extends JPanel implements MouseListener, MouseMotionListener {
|
public class MemviewPanel extends JPanel implements MouseListener, MouseMotionListener {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Color ARROW_COLOR = new GColor("color.debugger.memview.arrow");
|
||||||
|
|
||||||
private MemviewProvider provider;
|
private MemviewProvider provider;
|
||||||
private MemviewMap amap;
|
private MemviewMap amap;
|
||||||
private MemviewMap tmap;
|
private MemviewMap tmap;
|
||||||
private List<MemoryBox> boxList = new ArrayList<MemoryBox>();
|
private List<MemoryBox> boxList = new ArrayList<>();
|
||||||
|
|
||||||
private int pressedX;
|
private int pressedX;
|
||||||
private int pressedY;
|
private int pressedY;
|
||||||
|
@ -60,7 +64,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
setPreferredSize(new Dimension(barWidth, barHeight));
|
setPreferredSize(new Dimension(barWidth, barHeight));
|
||||||
setSize(getPreferredSize());
|
setSize(getPreferredSize());
|
||||||
setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
|
setBorder(BorderFactory.createLineBorder(Java.BORDER, 1));
|
||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
|
|
||||||
addMouseListener(this);
|
addMouseListener(this);
|
||||||
|
@ -129,7 +133,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
g.translate(currentPixelAddr, currentPixelTime);
|
g.translate(currentPixelAddr, currentPixelTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
g.setColor(Color.RED);
|
g.setColor(ARROW_COLOR);
|
||||||
g.fillPolygon(locXs, locYs, locXs.length);
|
g.fillPolygon(locXs, locYs, locXs.length);
|
||||||
|
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
|
@ -149,7 +153,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
int y = currentRectangle.y;
|
int y = currentRectangle.y;
|
||||||
int w = currentRectangle.width;
|
int w = currentRectangle.width;
|
||||||
int h = currentRectangle.height;
|
int h = currentRectangle.height;
|
||||||
g.setColor(Color.RED);
|
g.setColor(ARROW_COLOR);
|
||||||
g.fillRect(x - 1, y - 1, 1, h + 2);
|
g.fillRect(x - 1, y - 1, 1, h + 2);
|
||||||
g.fillRect(x - 1, y - 1, w + 2, 1);
|
g.fillRect(x - 1, y - 1, w + 2, 1);
|
||||||
g.fillRect(x + w + 1, y - 1, 1, h + 2);
|
g.fillRect(x + w + 1, y - 1, 1, h + 2);
|
||||||
|
@ -180,17 +184,19 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateBoxes() {
|
void updateBoxes() {
|
||||||
if (!this.isShowing())
|
if (!this.isShowing()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
boxList = new ArrayList<MemoryBox>();
|
boxList = new ArrayList<>();
|
||||||
Collection<MemoryBox> boxes = getBoxes();
|
Collection<MemoryBox> boxes = getBoxes();
|
||||||
if (boxes == null) {
|
if (boxes == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (MemoryBox box : boxes) {
|
for (MemoryBox box : boxes) {
|
||||||
if (box == null)
|
if (box == null) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
int bound = vertical ? getHeight() - 1 : getWidth() - 1;
|
int bound = vertical ? getHeight() - 1 : getWidth() - 1;
|
||||||
box.setAddressBounds(amap, bound);
|
box.setAddressBounds(amap, bound);
|
||||||
|
@ -374,26 +380,26 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
|
|
||||||
Set<MemoryBox> mboxes = addr2box.get(box.getStartAddress());
|
Set<MemoryBox> mboxes = addr2box.get(box.getStartAddress());
|
||||||
if (mboxes == null) {
|
if (mboxes == null) {
|
||||||
mboxes = new HashSet<MemoryBox>();
|
mboxes = new HashSet<>();
|
||||||
}
|
}
|
||||||
mboxes.add(box);
|
mboxes.add(box);
|
||||||
addr2box.put(box.getStartAddress(), mboxes);
|
addr2box.put(box.getStartAddress(), mboxes);
|
||||||
mboxes = addr2box.get(box.getStopAddress());
|
mboxes = addr2box.get(box.getStopAddress());
|
||||||
if (mboxes == null) {
|
if (mboxes == null) {
|
||||||
mboxes = new HashSet<MemoryBox>();
|
mboxes = new HashSet<>();
|
||||||
}
|
}
|
||||||
mboxes.add(box);
|
mboxes.add(box);
|
||||||
addr2box.put(box.getStopAddress(), mboxes);
|
addr2box.put(box.getStopAddress(), mboxes);
|
||||||
|
|
||||||
mboxes = time2box.get(box.getStartTime());
|
mboxes = time2box.get(box.getStartTime());
|
||||||
if (mboxes == null) {
|
if (mboxes == null) {
|
||||||
mboxes = new HashSet<MemoryBox>();
|
mboxes = new HashSet<>();
|
||||||
}
|
}
|
||||||
mboxes.add(box);
|
mboxes.add(box);
|
||||||
time2box.put(box.getStartTime(), mboxes);
|
time2box.put(box.getStartTime(), mboxes);
|
||||||
mboxes = time2box.get(box.getStopTime());
|
mboxes = time2box.get(box.getStopTime());
|
||||||
if (mboxes == null) {
|
if (mboxes == null) {
|
||||||
mboxes = new HashSet<MemoryBox>();
|
mboxes = new HashSet<>();
|
||||||
}
|
}
|
||||||
mboxes.add(box);
|
mboxes.add(box);
|
||||||
time2box.put(box.getStopTime(), mboxes);
|
time2box.put(box.getStopTime(), mboxes);
|
||||||
|
@ -415,7 +421,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
|
|
||||||
public void addBoxes(List<MemoryBox> boxes) {
|
public void addBoxes(List<MemoryBox> boxes) {
|
||||||
if (blist == null) {
|
if (blist == null) {
|
||||||
blist = new ArrayList<MemoryBox>();
|
blist = new ArrayList<>();
|
||||||
}
|
}
|
||||||
for (MemoryBox b : boxes) {
|
for (MemoryBox b : boxes) {
|
||||||
if (bmap.containsKey(b.getId())) {
|
if (bmap.containsKey(b.getId())) {
|
||||||
|
@ -429,7 +435,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset() {
|
public void reset() {
|
||||||
blist = new ArrayList<MemoryBox>();
|
blist = new ArrayList<>();
|
||||||
bmap.clear();
|
bmap.clear();
|
||||||
parseBoxes(blist);
|
parseBoxes(blist);
|
||||||
}
|
}
|
||||||
|
@ -451,14 +457,16 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getAddr(int x, int y) {
|
public long getAddr(int x, int y) {
|
||||||
if (amap == null)
|
if (amap == null) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
return vertical ? amap.getOffset(y) : amap.getOffset(x);
|
return vertical ? amap.getOffset(y) : amap.getOffset(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTick(int x, int y) {
|
public long getTick(int x, int y) {
|
||||||
if (tmap == null)
|
if (tmap == null) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
return vertical ? tmap.getOffset(x) : tmap.getOffset(y);
|
return vertical ? tmap.getOffset(x) : tmap.getOffset(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import docking.action.DockingAction;
|
||||||
import docking.action.ToggleDockingAction;
|
import docking.action.ToggleDockingAction;
|
||||||
import docking.widgets.table.RangeCursorTableHeaderRenderer.SeekListener;
|
import docking.widgets.table.RangeCursorTableHeaderRenderer.SeekListener;
|
||||||
import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin;
|
import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin;
|
||||||
|
import generic.theme.GColor;
|
||||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||||
|
@ -77,16 +78,10 @@ public class DebuggerModelProvider extends ComponentProvider implements Saveable
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final AutoService.Wiring autoServiceWiring;
|
private final AutoService.Wiring autoServiceWiring;
|
||||||
|
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(description = "Text color for values that have just changed", name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED, help = @HelpInfo(anchor = "colors"))
|
||||||
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;
|
private Color diffColor = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED;
|
||||||
|
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(description = "Select text color for values that have just changed", name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED_SEL, help = @HelpInfo(anchor = "colors"))
|
||||||
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;
|
private Color diffColorSel = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED_SEL;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -143,7 +138,8 @@ public class DebuggerModelProvider extends ComponentProvider implements Saveable
|
||||||
setTitle("[" + DebuggerResources.TITLE_PROVIDER_MODEL + "]");
|
setTitle("[" + DebuggerResources.TITLE_PROVIDER_MODEL + "]");
|
||||||
setWindowGroup("Debugger.Core.disconnected");
|
setWindowGroup("Debugger.Core.disconnected");
|
||||||
setIntraGroupPosition(WindowPosition.STACK);
|
setIntraGroupPosition(WindowPosition.STACK);
|
||||||
mainPanel.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 2));
|
mainPanel.setBorder(BorderFactory
|
||||||
|
.createLineBorder(new GColor("color.border.provider.disconnected"), 2));
|
||||||
setTransient();
|
setTransient();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -43,6 +43,8 @@ import docking.widgets.OptionDialog;
|
||||||
import docking.widgets.table.DefaultEnumeratedColumnTableModel;
|
import docking.widgets.table.DefaultEnumeratedColumnTableModel;
|
||||||
import docking.widgets.tree.GTree;
|
import docking.widgets.tree.GTree;
|
||||||
import generic.jar.ResourceFile;
|
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.DebuggerCoordinates;
|
||||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||||
|
@ -127,68 +129,68 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
description = "The default foreground color of items in the objects tree", //
|
description = "The default foreground color of items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color defaultForegroundColor = Color.BLACK;
|
Color defaultForegroundColor = new GColor("color.fg.debugger.plugin.objects.default");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_DEFAULT_BACKGROUND_COLOR, //
|
name = OPTION_NAME_DEFAULT_BACKGROUND_COLOR, //
|
||||||
description = "The default background color of items in the objects tree", //
|
description = "The default background color of items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color defaultBackgroundColor = Color.WHITE;
|
Color defaultBackgroundColor = new GColor("color.bg.debugger.plugin.objects.default");
|
||||||
|
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_INVISIBLE_FOREGROUND_COLOR, //
|
name = OPTION_NAME_INVISIBLE_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for items normally not visible (toggleable)", //
|
description = "The foreground color for items normally not visible (toggleable)", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color invisibleForegroundColor = Color.LIGHT_GRAY;
|
Color invisibleForegroundColor = new GColor("color.fg.debugger.plugin.objects.invisible");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_INVALIDATED_FOREGROUND_COLOR, //
|
name = OPTION_NAME_INVALIDATED_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for items no longer valid", //
|
description = "The foreground color for items no longer valid", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color invalidatedForegroundColor = Color.LIGHT_GRAY;
|
Color invalidatedForegroundColor = new GColor("color.fg.debugger.plugin.objects.invalidated");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_MODIFIED_FOREGROUND_COLOR, //
|
name = OPTION_NAME_MODIFIED_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for modified items in the objects tree", //
|
description = "The foreground color for modified items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color modifiedForegroundColor = Color.RED;
|
Color modifiedForegroundColor = new GColor("color.fg.debugger.plugin.objects.modified");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR, //
|
name = OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for subscribed items in the objects tree", //
|
description = "The foreground color for subscribed items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color subscribedForegroundColor = Color.BLACK;
|
Color subscribedForegroundColor = new GColor("color.fg.debugger.plugin.objects.subscribed");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_ERROR_FOREGROUND_COLOR, //
|
name = OPTION_NAME_ERROR_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for items in error", //
|
description = "The foreground color for items in error", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color errorForegroundColor = Color.RED;
|
Color errorForegroundColor = new GColor("color.fg.debugger.plugin.objects.error");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_INTRINSIC_FOREGROUND_COLOR, //
|
name = OPTION_NAME_INTRINSIC_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for intrinsic items in the objects tree", //
|
description = "The foreground color for intrinsic items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color intrinsicForegroundColor = Color.BLUE;
|
Color intrinsicForegroundColor = new GColor("color.fg.debugger.plugin.objects.intrinsic");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_TARGET_FOREGROUND_COLOR, //
|
name = OPTION_NAME_TARGET_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for target object items in the objects tree", //
|
description = "The foreground color for target object items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color targetForegroundColor = Color.MAGENTA;
|
Color targetForegroundColor = new GColor("color.fg.debugger.plugin.objects.target");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_ACCESSOR_FOREGROUND_COLOR, //
|
name = OPTION_NAME_ACCESSOR_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for property accessor items in the objects tree", //
|
description = "The foreground color for property accessor items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color accessorForegroundColor = Color.LIGHT_GRAY;
|
Color accessorForegroundColor = new GColor("color.fg.debugger.plugin.objects.accessor");
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = OPTION_NAME_LINK_FOREGROUND_COLOR, //
|
name = OPTION_NAME_LINK_FOREGROUND_COLOR, //
|
||||||
description = "The foreground color for links to items in the objects tree", //
|
description = "The foreground color for links to items in the objects tree", //
|
||||||
help = @HelpInfo(anchor = "colors") //
|
help = @HelpInfo(anchor = "colors") //
|
||||||
)
|
)
|
||||||
Color linkForegroundColor = Color.GREEN.darker();
|
Color linkForegroundColor = new GColor("color.fg.debugger.plugin.objects.link");
|
||||||
|
|
||||||
@AutoOptionDefined( //
|
@AutoOptionDefined( //
|
||||||
name = "Default Extended Step", //
|
name = "Default Extended Step", //
|
||||||
|
@ -281,7 +283,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
this.asTree = asTree;
|
this.asTree = asTree;
|
||||||
setIcon(asTree ? ObjectTree.ICON_TREE : ObjectTable.ICON_TABLE);
|
setIcon(asTree ? ObjectTree.ICON_TREE : ObjectTable.ICON_TABLE);
|
||||||
|
|
||||||
targetMap = new LinkedMap<String, ObjectContainer>();
|
targetMap = new LinkedMap<>();
|
||||||
refSet = new HashSet<>();
|
refSet = new HashSet<>();
|
||||||
getRoot().propagateProvider(this);
|
getRoot().propagateProvider(this);
|
||||||
|
|
||||||
|
@ -658,7 +660,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAll(list);
|
model.addAll(list);
|
||||||
return new ObjectTable<ObjectAttributeRow>(container, ObjectAttributeRow.class, model);
|
return new ObjectTable<>(container, ObjectAttributeRow.class, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ObjectTable<ObjectElementRow> buildTableFromElements(ObjectContainer container) {
|
private ObjectTable<ObjectElementRow> buildTableFromElements(ObjectContainer container) {
|
||||||
|
@ -678,7 +680,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
new ObjectEnumeratedColumnTableModel<>(name, cols);
|
new ObjectEnumeratedColumnTableModel<>(name, cols);
|
||||||
model.addAll(list);
|
model.addAll(list);
|
||||||
ObjectTable<ObjectElementRow> table =
|
ObjectTable<ObjectElementRow> table =
|
||||||
new ObjectTable<ObjectElementRow>(container, ObjectElementRow.class, model);
|
new ObjectTable<>(container, ObjectElementRow.class, model);
|
||||||
for (Object obj : map.values()) {
|
for (Object obj : map.values()) {
|
||||||
if (obj instanceof TargetObject) {
|
if (obj instanceof TargetObject) {
|
||||||
TargetObject ref = (TargetObject) obj;
|
TargetObject ref = (TargetObject) obj;
|
||||||
|
@ -744,7 +746,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
|
|
||||||
static List<ObjectContainer> getContainersFromObjects(Map<String, ?> objectMap,
|
static List<ObjectContainer> getContainersFromObjects(Map<String, ?> objectMap,
|
||||||
TargetObject parent, boolean usingAttributes) {
|
TargetObject parent, boolean usingAttributes) {
|
||||||
List<ObjectContainer> result = new ArrayList<ObjectContainer>();
|
List<ObjectContainer> result = new ArrayList<>();
|
||||||
if (parent == null || parent instanceof DummyTargetObject) {
|
if (parent == null || parent instanceof DummyTargetObject) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -826,7 +828,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
|
|
||||||
public ObjectContainer getParent(ObjectContainer container) {
|
public ObjectContainer getParent(ObjectContainer container) {
|
||||||
List<String> path = container.getTargetObject().getPath();
|
List<String> path = container.getTargetObject().getPath();
|
||||||
List<String> ppath = new ArrayList<String>();
|
List<String> ppath = new ArrayList<>();
|
||||||
for (String link : path) {
|
for (String link : path) {
|
||||||
ppath.add(link);
|
ppath.add(link);
|
||||||
}
|
}
|
||||||
|
@ -2028,7 +2030,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||||
case OPTION_NAME_TARGET_FOREGROUND_COLOR:
|
case OPTION_NAME_TARGET_FOREGROUND_COLOR:
|
||||||
return targetForegroundColor;
|
return targetForegroundColor;
|
||||||
default:
|
default:
|
||||||
return Color.BLACK;
|
return Colors.FOREGROUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,14 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.debug.gui.objects.components;
|
package ghidra.app.plugin.core.debug.gui.objects.components;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.*;
|
||||||
import java.awt.Component;
|
|
||||||
import java.awt.Font;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.swing.JTree;
|
import javax.swing.JTree;
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
import docking.widgets.tree.support.GTreeRenderer;
|
import docking.widgets.tree.support.GTreeRenderer;
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Tables;
|
||||||
import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider;
|
import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider;
|
||||||
import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer;
|
import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer;
|
||||||
import ghidra.dbg.target.TargetExecutionStateful;
|
import ghidra.dbg.target.TargetExecutionStateful;
|
||||||
|
@ -35,12 +34,11 @@ import ghidra.util.SystemUtilities;
|
||||||
class ObjectTreeCellRenderer extends GTreeRenderer {
|
class ObjectTreeCellRenderer extends GTreeRenderer {
|
||||||
|
|
||||||
private final DebuggerObjectsProvider provider;
|
private final DebuggerObjectsProvider provider;
|
||||||
private Font defaultFont = SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.PLAIN, 11));
|
private Font defaultFont =
|
||||||
private Font unsubscribedFont = SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.ITALIC, 11));
|
SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.PLAIN, 11));
|
||||||
|
private Font unsubscribedFont =
|
||||||
|
SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.ITALIC, 11));
|
||||||
|
|
||||||
/**
|
|
||||||
* @param provider
|
|
||||||
*/
|
|
||||||
public ObjectTreeCellRenderer(DebuggerObjectsProvider provider) {
|
public ObjectTreeCellRenderer(DebuggerObjectsProvider provider) {
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +88,7 @@ class ObjectTreeCellRenderer extends GTreeRenderer {
|
||||||
if (container.isSubscribed()) {
|
if (container.isSubscribed()) {
|
||||||
Color color = provider
|
Color color = provider
|
||||||
.getColor(DebuggerObjectsProvider.OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR);
|
.getColor(DebuggerObjectsProvider.OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR);
|
||||||
if (!color.equals(Color.BLACK)) {
|
if (!color.equals(Tables.FG_UNSELECTED)) {
|
||||||
component.setForeground(color);
|
component.setForeground(color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +98,7 @@ class ObjectTreeCellRenderer extends GTreeRenderer {
|
||||||
if (last instanceof ObjectNode) {
|
if (last instanceof ObjectNode) {
|
||||||
ObjectContainer selection = ((ObjectNode) last).getContainer();
|
ObjectContainer selection = ((ObjectNode) last).getContainer();
|
||||||
if (container.equals(selection)) {
|
if (container.equals(selection)) {
|
||||||
component.setForeground(Color.WHITE);
|
component.setForeground(Tables.FG_SELECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ import docking.actions.PopupActionProvider;
|
||||||
import docking.widgets.table.*;
|
import docking.widgets.table.*;
|
||||||
import docking.widgets.table.ColumnSortState.SortDirection;
|
import docking.widgets.table.ColumnSortState.SortDirection;
|
||||||
import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn;
|
import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn;
|
||||||
|
import generic.theme.GColor;
|
||||||
import ghidra.app.plugin.core.data.DataSettingsDialog;
|
import ghidra.app.plugin.core.data.DataSettingsDialog;
|
||||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||||
|
@ -472,23 +473,19 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final AutoService.Wiring autoServiceWiring;
|
private final AutoService.Wiring autoServiceWiring;
|
||||||
|
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE, //
|
||||||
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE, //
|
|
||||||
description = "Text color for registers whose value is not known", //
|
description = "Text color for registers whose value is not known", //
|
||||||
help = @HelpInfo(anchor = "colors"))
|
help = @HelpInfo(anchor = "colors"))
|
||||||
protected Color registerStaleColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE;
|
protected Color registerStaleColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE;
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE_SEL, //
|
||||||
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE_SEL, //
|
|
||||||
description = "Selected text color for registers whose value is not known", //
|
description = "Selected text color for registers whose value is not known", //
|
||||||
help = @HelpInfo(anchor = "colors"))
|
help = @HelpInfo(anchor = "colors"))
|
||||||
protected Color registerStaleSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE_SEL;
|
protected Color registerStaleSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE_SEL;
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED, //
|
||||||
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED, //
|
|
||||||
description = "Text color for registers whose value just changed", //
|
description = "Text color for registers whose value just changed", //
|
||||||
help = @HelpInfo(anchor = "colors"))
|
help = @HelpInfo(anchor = "colors"))
|
||||||
protected Color registerChangesColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED;
|
protected Color registerChangesColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED;
|
||||||
@AutoOptionDefined(
|
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED_SEL, //
|
||||||
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED_SEL, //
|
|
||||||
description = "Selected text color for registers whose value just changed", //
|
description = "Selected text color for registers whose value just changed", //
|
||||||
help = @HelpInfo(anchor = "colors"))
|
help = @HelpInfo(anchor = "colors"))
|
||||||
protected Color registerChangesSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED_SEL;
|
protected Color registerChangesSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED_SEL;
|
||||||
|
@ -550,7 +547,8 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||||
setTitle("[" + DebuggerResources.TITLE_PROVIDER_REGISTERS + "]");
|
setTitle("[" + DebuggerResources.TITLE_PROVIDER_REGISTERS + "]");
|
||||||
setWindowGroup("Debugger.Core.disconnected");
|
setWindowGroup("Debugger.Core.disconnected");
|
||||||
setIntraGroupPosition(WindowPosition.STACK);
|
setIntraGroupPosition(WindowPosition.STACK);
|
||||||
mainPanel.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 2));
|
mainPanel.setBorder(BorderFactory
|
||||||
|
.createLineBorder(new GColor("color.border.provider.disconnected"), 2));
|
||||||
setTransient();
|
setTransient();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -441,7 +441,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||||
assertNotNull("Cannot get cursor bounds", cursor);
|
assertNotNull("Cannot get cursor bounds", cursor);
|
||||||
Color actual = new Color(image.getRGB(locFP.x + cursor.x - 1,
|
Color actual = new Color(image.getRGB(locFP.x + cursor.x - 1,
|
||||||
locFP.y + cursor.y + cursor.height * 3 / 2 + yAdjust));
|
locFP.y + cursor.y + cursor.height * 3 / 2 + yAdjust));
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected.getRGB(), actual.getRGB());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ package ghidra.app.plugin.core.debug.gui.copying;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -26,6 +25,7 @@ import javax.swing.JCheckBox;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Palette;
|
||||||
import ghidra.app.plugin.assembler.Assembler;
|
import ghidra.app.plugin.assembler.Assembler;
|
||||||
import ghidra.app.plugin.assembler.Assemblers;
|
import ghidra.app.plugin.assembler.Assemblers;
|
||||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||||
|
@ -615,7 +615,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||||
|
|
||||||
BookmarkManager bookmarks = view.getBookmarkManager();
|
BookmarkManager bookmarks = view.getBookmarkManager();
|
||||||
bookmarks.defineType("TestType", DebuggerResources.ICON_DEBUGGER, Color.BLUE, 1);
|
bookmarks.defineType("TestType", DebuggerResources.ICON_DEBUGGER, Palette.BLUE, 1);
|
||||||
bookmarks.setBookmark(tb.addr(0x55550123), "TestType", "TestCategory", "Test Comment");
|
bookmarks.setBookmark(tb.addr(0x55550123), "TestType", "TestCategory", "Test Comment");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,7 +644,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||||
assertEquals("Test Comment", bm.getComment());
|
assertEquals("Test Comment", bm.getComment());
|
||||||
|
|
||||||
assertEquals(DebuggerResources.ICON_DEBUGGER, type.getIcon());
|
assertEquals(DebuggerResources.ICON_DEBUGGER, type.getIcon());
|
||||||
assertEquals(Color.BLUE, type.getMarkerColor());
|
assertEquals(Palette.BLUE, type.getMarkerColor());
|
||||||
assertEquals(1, type.getMarkerPriority());
|
assertEquals(1, type.getMarkerPriority());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ package ghidra.app.plugin.core.debug.gui.listing;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
@ -31,6 +30,7 @@ import docking.menu.ActionState;
|
||||||
import docking.menu.MultiStateDockingAction;
|
import docking.menu.MultiStateDockingAction;
|
||||||
import docking.widgets.EventTrigger;
|
import docking.widgets.EventTrigger;
|
||||||
import generic.test.category.NightlyCategory;
|
import generic.test.category.NightlyCategory;
|
||||||
|
import generic.theme.GThemeDefaults.Colors;
|
||||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||||
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
||||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||||
|
@ -637,7 +637,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||||
|
|
||||||
// While we're here, ensure static view didn't track anywhere
|
// While we're here, ensure static view didn't track anywhere
|
||||||
assertEquals(cur, codePlugin.getCurrentLocation().getAddress());
|
assertEquals(cur, codePlugin.getCurrentLocation().getAddress());
|
||||||
assertListingBackgroundAt(Color.WHITE, codePlugin.getListingPanel(),
|
assertListingBackgroundAt(Colors.BACKGROUND, codePlugin.getListingPanel(),
|
||||||
ss.getAddress(0x00601234), 0);
|
ss.getAddress(0x00601234), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -774,7 +774,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||||
|
|
||||||
assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE,
|
assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE,
|
||||||
listingProvider.getListingPanel(), tb.addr(0x00401233), 0);
|
listingProvider.getListingPanel(), tb.addr(0x00401233), 0);
|
||||||
assertListingBackgroundAt(Color.WHITE, listingProvider.getListingPanel(),
|
assertListingBackgroundAt(Colors.BACKGROUND, listingProvider.getListingPanel(),
|
||||||
tb.addr(0x00401234), 0);
|
tb.addr(0x00401234), 0);
|
||||||
assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR,
|
assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR,
|
||||||
listingProvider.getListingPanel(), tb.addr(0x00401235), 0);
|
listingProvider.getListingPanel(), tb.addr(0x00401235), 0);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.debug.gui.memory;
|
package ghidra.app.plugin.core.debug.gui.memory;
|
||||||
|
|
||||||
import static ghidra.lifecycle.Unfinished.TODO;
|
import static ghidra.lifecycle.Unfinished.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
@ -434,7 +434,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||||
}
|
}
|
||||||
Rectangle cursor = component.getCursorBounds();
|
Rectangle cursor = component.getCursorBounds();
|
||||||
Color actual = new Color(image.getRGB(cursor.x + 8, cursor.y));
|
Color actual = new Color(image.getRGB(cursor.x + 8, cursor.y));
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected.getRGB(), actual.getRGB());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.apache.logging.log4j.core.Appender;
|
||||||
import org.apache.logging.log4j.core.LoggerContext;
|
import org.apache.logging.log4j.core.LoggerContext;
|
||||||
import org.apache.logging.log4j.core.config.Configuration;
|
import org.apache.logging.log4j.core.config.Configuration;
|
||||||
|
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.framework.LoggingInitialization;
|
import ghidra.framework.LoggingInitialization;
|
||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
import ghidra.util.Swing;
|
import ghidra.util.Swing;
|
||||||
|
@ -73,6 +74,11 @@ public class AgentWindow extends JFrame implements WindowListener, LogListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void messageLogged(String message, boolean isError) {
|
public void messageLogged(String message, boolean isError) {
|
||||||
|
<<<<<<< Upstream, based on origin/master
|
||||||
|
=======
|
||||||
|
String fMessage =
|
||||||
|
isError ? "<font color=\"" + Messages.ERROR + "\">" + message + "</font>" : message;
|
||||||
|
>>>>>>> 1e5309a GP-1981 - Theming - Color conversion for Debugger modules
|
||||||
Swing.runIfSwingOrRunLater(() -> {
|
Swing.runIfSwingOrRunLater(() -> {
|
||||||
MutableAttributeSet attributes = new SimpleAttributeSet();
|
MutableAttributeSet attributes = new SimpleAttributeSet();
|
||||||
if (isError) {
|
if (isError) {
|
||||||
|
|
|
@ -17,7 +17,6 @@ package ghidra.trace.database;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
@ -29,6 +28,7 @@ import java.nio.file.Path;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import db.DBHandle;
|
import db.DBHandle;
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.app.plugin.processors.sleigh.SleighLanguage;
|
import ghidra.app.plugin.processors.sleigh.SleighLanguage;
|
||||||
import ghidra.pcode.exec.*;
|
import ghidra.pcode.exec.*;
|
||||||
import ghidra.pcode.exec.trace.TraceSleighUtils;
|
import ghidra.pcode.exec.trace.TraceSleighUtils;
|
||||||
|
@ -168,7 +168,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
/**
|
/**
|
||||||
* Get the named register
|
* Get the named register
|
||||||
*
|
*
|
||||||
* @param the platform
|
* @param platform the platform
|
||||||
* @param name the name
|
* @param name the name
|
||||||
* @return the register or null if it doesn't exist
|
* @return the register or null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
|
@ -190,7 +190,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
/**
|
/**
|
||||||
* Create an address in the given language's default space
|
* Create an address in the given language's default space
|
||||||
*
|
*
|
||||||
* @param lang the langauge
|
* @param lang the language
|
||||||
* @param offset the offset
|
* @param offset the offset
|
||||||
* @return the address
|
* @return the address
|
||||||
*/
|
*/
|
||||||
|
@ -252,7 +252,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an address range: shortcut for {@link new AddressRangeImpl(start, end)}
|
* Create an address range: shortcut for {@link AddressRangeImpl}
|
||||||
*
|
*
|
||||||
* @param start the start address
|
* @param start the start address
|
||||||
* @param end the end address
|
* @param end the end address
|
||||||
|
@ -444,7 +444,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
*/
|
*/
|
||||||
public DBTraceBookmarkType getOrAddBookmarkType(String name) {
|
public DBTraceBookmarkType getOrAddBookmarkType(String name) {
|
||||||
DBTraceBookmarkManager manager = trace.getBookmarkManager();
|
DBTraceBookmarkManager manager = trace.getBookmarkManager();
|
||||||
return manager.defineBookmarkType(name, null, Color.red, 1);
|
return manager.defineBookmarkType(name, null, Messages.ERROR, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -477,7 +477,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
*
|
*
|
||||||
* @param snap the starting snap
|
* @param snap the starting snap
|
||||||
* @param threadName the name of the thread
|
* @param threadName the name of the thread
|
||||||
* @param registerName the name of the regsiter
|
* @param registerName the name of the register
|
||||||
* @param typeName the name of its type
|
* @param typeName the name of its type
|
||||||
* @param category the category
|
* @param category the category
|
||||||
* @param comment an optional comment
|
* @param comment an optional comment
|
||||||
|
@ -549,11 +549,12 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
public DBTraceInstruction addInstruction(long snap, Address start,
|
public DBTraceInstruction addInstruction(long snap, Address start,
|
||||||
TracePlatform platform) throws CodeUnitInsertionException {
|
TracePlatform platform) throws CodeUnitInsertionException {
|
||||||
DBTraceCodeManager code = trace.getCodeManager();
|
DBTraceCodeManager code = trace.getCodeManager();
|
||||||
Language language = platform.getLanguage();
|
Language platformLanguage = platform.getLanguage();
|
||||||
Disassembler dis = Disassembler.getDisassembler(language, language.getAddressFactory(),
|
Disassembler dis =
|
||||||
|
Disassembler.getDisassembler(platformLanguage, platformLanguage.getAddressFactory(),
|
||||||
new ConsoleTaskMonitor(), msg -> Msg.info(this, "Listener: " + msg));
|
new ConsoleTaskMonitor(), msg -> Msg.info(this, "Listener: " + msg));
|
||||||
RegisterValue defaultContextValue = trace.getRegisterContextManager()
|
RegisterValue defaultContextValue = trace.getRegisterContextManager()
|
||||||
.getDefaultContext(language)
|
.getDefaultContext(platformLanguage)
|
||||||
.getDefaultDisassemblyContext();
|
.getDefaultDisassemblyContext();
|
||||||
|
|
||||||
MemBuffer memBuf = platform.getMappedMemBuffer(snap, platform.mapHostToGuest(start));
|
MemBuffer memBuf = platform.getMappedMemBuffer(snap, platform.mapHostToGuest(start));
|
||||||
|
@ -725,10 +726,10 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the language with the given ID, as in {@link LangaugeID}
|
* Get the language with the given ID, as in {@link LanguageID}
|
||||||
*
|
*
|
||||||
* @param id the ID
|
* @param id the ID
|
||||||
* @return the langauge
|
* @return the language
|
||||||
* @throws LanguageNotFoundException if the language does not exist
|
* @throws LanguageNotFoundException if the language does not exist
|
||||||
*/
|
*/
|
||||||
public Language getLanguage(String id) throws LanguageNotFoundException {
|
public Language getLanguage(String id) throws LanguageNotFoundException {
|
||||||
|
@ -742,7 +743,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
|
||||||
* @param compID the compiler ID as in {@link CompilerSpecID}
|
* @param compID the compiler ID as in {@link CompilerSpecID}
|
||||||
* @return the compiler spec
|
* @return the compiler spec
|
||||||
* @throws CompilerSpecNotFoundException if the compiler spec does not exist
|
* @throws CompilerSpecNotFoundException if the compiler spec does not exist
|
||||||
* @throws LanguageNotFoundException if the langauge does not exist
|
* @throws LanguageNotFoundException if the language does not exist
|
||||||
*/
|
*/
|
||||||
public CompilerSpec getCompiler(String langID, String compID)
|
public CompilerSpec getCompiler(String langID, String compID)
|
||||||
throws CompilerSpecNotFoundException, LanguageNotFoundException {
|
throws CompilerSpecNotFoundException, LanguageNotFoundException {
|
||||||
|
|
|
@ -17,7 +17,6 @@ package ghidra.util.database.spatial;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
|
@ -41,6 +40,8 @@ import com.google.common.collect.Iterators;
|
||||||
|
|
||||||
import db.DBHandle;
|
import db.DBHandle;
|
||||||
import db.DBRecord;
|
import db.DBRecord;
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Palette;
|
||||||
|
import generic.theme.TempColorUtils;
|
||||||
import ghidra.util.LockHold;
|
import ghidra.util.LockHold;
|
||||||
import ghidra.util.database.*;
|
import ghidra.util.database.*;
|
||||||
import ghidra.util.database.annot.*;
|
import ghidra.util.database.annot.*;
|
||||||
|
@ -565,13 +566,13 @@ public class RStarTreeMapTest {
|
||||||
|
|
||||||
public void selectColor(Graphics g, NodeType type) {
|
public void selectColor(Graphics g, NodeType type) {
|
||||||
if (type.isLeaf()) {
|
if (type.isLeaf()) {
|
||||||
g.setColor(new Color(1, 0, 0, 0.5f).darker());
|
g.setColor(TempColorUtils.fromRgba(179, 0, 0, 128));
|
||||||
}
|
}
|
||||||
else if (type.isLeafParent()) {
|
else if (type.isLeafParent()) {
|
||||||
g.setColor(new Color(0, 1, 0, 0.5f).darker());
|
g.setColor(TempColorUtils.fromRgba(0, 179, 0, 128));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.setColor(new Color(0, 0, 1, 0.5f).darker());
|
g.setColor(TempColorUtils.fromRgba(0, 0, 179, 128));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -581,14 +582,14 @@ public class RStarTreeMapTest {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
drawPath(g, getParentOf(nr));
|
drawPath(g, getParentOf(nr));
|
||||||
g.setColor(Color.BLACK);
|
g.setColor(Palette.BLACK);
|
||||||
drawRect(g, nr.getShape(), false);
|
drawRect(g, nr.getShape(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawPath(Graphics g, DBIntRectStringDataRecord dr) {
|
public void drawPath(Graphics g, DBIntRectStringDataRecord dr) {
|
||||||
System.out.println("Selected: " + dr);
|
System.out.println("Selected: " + dr);
|
||||||
drawPath(g, getParentOf(dr));
|
drawPath(g, getParentOf(dr));
|
||||||
g.setColor(Color.BLACK);
|
g.setColor(Palette.BLACK);
|
||||||
drawRect(g, dr.getBounds(), false);
|
drawRect(g, dr.getBounds(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,7 +610,7 @@ public class RStarTreeMapTest {
|
||||||
@Override
|
@Override
|
||||||
protected VisitResult visitData(DBIntRectNodeRecord parent,
|
protected VisitResult visitData(DBIntRectNodeRecord parent,
|
||||||
DBIntRectStringDataRecord d, boolean included) {
|
DBIntRectStringDataRecord d, boolean included) {
|
||||||
g.setColor(new Color(0, 0, 0, 0.5f));
|
g.setColor(TempColorUtils.fromRgba(0, 0, 0, 128));
|
||||||
drawRect(g, d.getShape(), true);
|
drawRect(g, d.getShape(), true);
|
||||||
return VisitResult.NEXT;
|
return VisitResult.NEXT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ color.fg.plugin.python.syntax.method = teal
|
||||||
color.fg.plugin.python.syntax.null = red
|
color.fg.plugin.python.syntax.null = red
|
||||||
color.fg.plugin.python.syntax.number = darkgray
|
color.fg.plugin.python.syntax.number = darkgray
|
||||||
color.fg.plugin.python.syntax.package = darkred
|
color.fg.plugin.python.syntax.package = darkred
|
||||||
color.fg.plugin.python.syntax.sequence = rbg(128, 96, 64)
|
color.fg.plugin.python.syntax.sequence = rgb(128, 96, 64)
|
||||||
color.fg.plugin.python.syntax.special = darkgreen
|
color.fg.plugin.python.syntax.special = darkgreen
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue