Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/patch'

Ryan Kurtz98ff131dbd74
diff --cc Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointMarkerPlugin.java
index 7e309a8998,37cc710e33..f6bfaef5ce
--- 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
@@@ -49,11 -47,8 +50,10 @@@ import ghidra.framework.options.annotat
import ghidra.framework.plugintool.*;
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
import ghidra.framework.plugintool.util.PluginStatus;
- import ghidra.program.model.address.Address;
- import ghidra.program.model.address.AddressRange;
+ import ghidra.program.model.address.*;
import ghidra.program.model.listing.*;
+import ghidra.program.model.pcode.PcodeOp;
+import ghidra.program.model.pcode.Varnode;
import ghidra.program.util.*;
import ghidra.trace.model.Trace;
import ghidra.trace.model.TraceLocation;
@@@ -299,15 -237,77 +299,68 @@@ public class DebuggerBreakpointMarkerPl
}
protected boolean stateColorsBackground(State state) {
- if (state.isEnabled()) {
- if (state.isEffective()) {
- return breakpointEnabledColoringBackground;
- }
- else {
- return breakpointIneffEnColoringBackground;
- }
- }
- else {
- if (state.isEffective()) {
- return breakpointDisabledColoringBackground;
- }
- else {
- return breakpointIneffDisColoringBackground;
- }
- }
+ return state.isEnabled()
+ ? state.isEffective()
+ ? breakpointEnabledColoringBackground
+ : breakpointIneffEnColoringBackground
+ : state.isEffective()
+ ? breakpointDisabledColoringBackground
+ : breakpointIneffDisColoringBackground;
}
+ protected static class DualMarkerSet {
+ private static final String SUFFIX = " (Point)";
+ final MarkerSet area;
+ final MarkerSet point;
+
+ public DualMarkerSet(MarkerService service, String name, String description,
+ Program program,
+ int priority, boolean showMarks, boolean showNavigation, boolean colorBackground,
+ Color color, Icon icon, boolean preferred) {
+ MarkerSet areaExisting = service.getMarkerSet(name, program);
+ if (areaExisting != null) {
+ area = areaExisting;
+ }
+ else {
+ area = service.createAreaMarker(name, description, program, priority - 1, showMarks,
+ showNavigation, colorBackground, color, preferred);
+ }
+ MarkerSet pointExisting = service.getMarkerSet(name + SUFFIX, program);
+ if (pointExisting != null) {
+ point = pointExisting;
+ }
+ else {
+ point = service.createPointMarker(name + SUFFIX, description, program, priority,
+ showMarks, showNavigation, false, color, icon, preferred);
+ }
+ }
+
+ public void add(Address start, Address end) {
+ area.add(start, end);
+ point.add(start);
+ }
+
+ public void clearAll() {
+ area.clearAll();
+ point.clearAll();
+ }
+
+ public void setMarkerColor(Color color) {
+ area.setMarkerColor(color);
+ point.setMarkerColor(color);
+ }
+
+ public void setColoringBackground(boolean coloringBackground) {
+ area.setColoringBackground(coloringBackground);
+ // point never colors background
+ }
+
+ public void remove(MarkerService service, Program program) {
+ service.removeMarker(area, program);
+ service.removeMarker(point, program);
+ }
+ }
+
/**
* A variety of marker sets (one for each logical state) attached to a program or trace view
*/