Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-5653: Add button to toggle lower panel in breakpoints window.

ghidra-gazer38c401627eb3
diff --git a/Ghidra/Debug/Debugger/certification.manifest b/Ghidra/Debug/Debugger/certification.manifest
index 1103faf45a..9abaf91495 100644
--- a/Ghidra/Debug/Debugger/certification.manifest
+++ b/Ghidra/Debug/Debugger/certification.manifest
@@ -9,7 +9,6 @@ README.md||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/topics/BentoServicePlugin/BentoServicePlugin.html||GHIDRA||||END|
src/main/help/help/topics/BreakpointTimelinePlugin/BreakpointTimelinePlugin.html||GHIDRA||||END|
src/main/help/help/topics/BreakpointTimelinePlugin/images/BreakpointTimelinePlugin.png||GHIDRA||||END|
src/main/help/help/topics/BreakpointTimelinePlugin/images/BreakpointTimelinePluginNoGrid.png||GHIDRA||||END|
@@ -140,6 +139,7 @@ src/main/resources/images/stepover.png||GHIDRA||||END|
src/main/resources/images/system-switch-user.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END|
src/main/resources/images/table-a.png||FAMFAMFAM Icons - CC 2.5||||END|
src/main/resources/images/table-e.png||FAMFAMFAM Icons - CC 2.5||||END|
+src/main/resources/images/table-l.png||FAMFAMFAM Icons - CC 2.5||||END|
src/main/resources/images/table-s.png||FAMFAMFAM Icons - CC 2.5||||END|
src/main/resources/images/thread.png||GHIDRA||||END|
src/main/resources/images/time.png||FAMFAMFAM Icons - CC 2.5||||END|
@@ -196,6 +196,7 @@ src/main/svg/stepout.svg||GHIDRA||||END|
src/main/svg/stepover.svg||GHIDRA||||END|
src/main/svg/table-a.svg||FAMFAMFAM Icons - CC 2.5||||END|
src/main/svg/table-e.svg||FAMFAMFAM Icons - CC 2.5||||END|
+src/main/svg/table-l.svg||FAMFAMFAM Icons - CC 2.5||||END|
src/main/svg/table-s.svg||FAMFAMFAM Icons - CC 2.5||||END|
src/main/svg/thread.svg||GHIDRA||||END|
src/main/svg/write-disabled.svg||GHIDRA||||END|
diff --git a/Ghidra/Debug/Debugger/data/debugger.theme.properties b/Ghidra/Debug/Debugger/data/debugger.theme.properties
index 819376d34b..0985d47562 100644
--- a/Ghidra/Debug/Debugger/data/debugger.theme.properties
+++ b/Ghidra/Debug/Debugger/data/debugger.theme.properties
@@ -167,6 +167,7 @@ icon.debugger.breakpoint.disable = breakpoint-disable.png
icon.debugger.breakpoint.disable.all = breakpoints-disable-all.png
icon.debugger.breakpoint.clear.all = breakpoints-clear-all.png
icon.debugger.breakpoint.make.effective = breakpoints-make-effective.png
+icon.debugger.breakpoint.table.location = table-l.png
icon.debugger.provider.listing = Browser.gif
icon.debugger.provider.memory.bytes = binaryData.gif
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java
index cca3d31bb4..0808b1af2b 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java
@@ -27,8 +27,10 @@ import javax.swing.table.TableCellEditor;
import docking.*;
import docking.action.*;
import docking.action.builder.ActionBuilder;
+import docking.action.builder.ToggleActionBuilder;
import docking.menu.MultiActionDockingAction;
import docking.widgets.table.*;
+import generic.theme.GIcon;
import ghidra.app.context.ProgramLocationActionContext;
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
@@ -47,6 +49,7 @@ import ghidra.debug.api.target.Target.ObjectArgumentPolicy;
import ghidra.debug.api.tracemgr.DebuggerCoordinates;
import ghidra.framework.model.DomainObjectEvent;
import ghidra.framework.plugintool.*;
+import ghidra.framework.plugintool.annotation.AutoConfigStateField;
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
import ghidra.pcode.exec.SleighUtils;
import ghidra.program.model.address.Address;
@@ -751,6 +754,24 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
.helpLocation(new HelpLocation(ownerName, HELP_ANCHOR));
}
}
+
+ interface ShowLocationTableAction {
+ String NAME = "Show Location Table";
+ Icon ICON = new GIcon("icon.debugger.breakpoint.table.location");
+ String DESCRIPTION = "Toggle display for the Location Table pane";
+ String GROUP = DebuggerResources.FilterAction.GROUP;
+ String ORDER = "1";
+ String HELP_ANCHOR = "show_location_table";
+
+ static ToggleActionBuilder builder(Plugin owner) {
+ String ownerName = owner.getName();
+ return new ToggleActionBuilder(NAME, ownerName)
+ .description(DESCRIPTION)
+ .toolBarIcon(ICON)
+ .toolBarGroup(GROUP, ORDER)
+ .helpLocation(new HelpLocation(ownerName, HELP_ANCHOR));
+ }
+ }
interface SetEmulatedBreakpointInjectionAction {
String NAME = "Set Injection (Emulator)";
@@ -875,6 +896,9 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
private GoToService goToService;
@SuppressWarnings("unused")
private AutoService.Wiring autoServiceWiring;
+
+ @AutoConfigStateField
+ boolean showLocationTable = true;
private final Map<Trace, ForBreakpointLocationsTraceListener> listenersByTrace =
new HashMap<>();
@@ -882,6 +906,7 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
Trace currentTrace;
private final JSplitPane mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+ private final int defaultDividerSize = mainPanel.getDividerSize();
LogicalBreakpointTableModel breakpointTableModel = new LogicalBreakpointTableModel(this);
GhidraTable breakpointTable;
@@ -910,6 +935,7 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
MakeBreakpointsEffectiveResolutionAction actionMakeBreakpointsEffectiveResolution;
ToggleDockingAction actionFilterByCurrentTrace;
ToggleDockingAction actionFilterLocationsByBreakpoints;
+ ToggleDockingAction actionShowLocationTable;
DockingAction actionSetCondition;
DockingAction actionSetInjection;
@@ -1318,6 +1344,10 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
.popupWhen(this::isPopupSetInjection)
.onAction(this::activatedSetInjection)
.buildAndInstall(tool);
+ actionShowLocationTable = ShowLocationTableAction.builder(plugin)
+ .onAction(this::toggledShowLocationTable)
+ .selected(showLocationTable)
+ .buildAndInstallLocal(this);
actionMakeBreakpointsEffectiveResolution = new MakeBreakpointsEffectiveResolutionAction();
}
@@ -1468,6 +1498,25 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter
private void toggledFilterLocationsByBreakpoints(ActionContext ignored) {
locationTableModel.fireTableDataChanged();
}
+
+ private void toggledShowLocationTable(ActionContext ignored) {
+ setShowLocationTable(actionShowLocationTable.isSelected());
+ }
+
+ public void setShowLocationTable(boolean showLocationTable) {
+ if (this.showLocationTable == showLocationTable) {
+ return;
+ }
+ doSetShowLocationTable(showLocationTable);
+ }
+
+ protected void doSetShowLocationTable(boolean showLocationTable) {
+ this.showLocationTable = showLocationTable;
+ actionShowLocationTable.setSelected(showLocationTable);
+ mainPanel.setDividerSize(showLocationTable ? defaultDividerSize : 0);
+ mainPanel.getBottomComponent().setVisible(showLocationTable);
+ mainPanel.resetToPreferredSizes();
+ }
public boolean isFilterLocationsByBreakpoints() {
return actionFilterLocationsByBreakpoints.isSelected();
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesProvider.java
index 30ff9073b4..eee3b6b392 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesProvider.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesProvider.java
@@ -322,7 +322,7 @@ public class DebuggerModulesProvider extends ComponentProviderAdapter
interface ShowSectionsTableAction {
String NAME = "Show Sections Table";
Icon ICON = new GIcon("icon.debugger.modules.table.sections");
- String DESCRIPTION = "Toggle display fo the Sections Table pane";
+ String DESCRIPTION = "Toggle display for the Sections Table pane";
String GROUP = DebuggerResources.FilterAction.GROUP;
String ORDER = "1";
String HELP_ANCHOR = "show_sections_table";
diff --git a/Ghidra/Debug/Debugger/src/main/resources/images/table-l.png b/Ghidra/Debug/Debugger/src/main/resources/images/table-l.png
new file mode 100644
index 0000000000..e149efcd33
Binary files /dev/null and b/Ghidra/Debug/Debugger/src/main/resources/images/table-l.png differ
diff --git a/Ghidra/Debug/Debugger/src/main/svg/table-l.svg b/Ghidra/Debug/Debugger/src/main/svg/table-l.svg
new file mode 100644
index 0000000000..09314e276d
--- /dev/null
+++ b/Ghidra/Debug/Debugger/src/main/svg/table-l.svg
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ version="1.1"
+ id="svg2"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs6" />
+ <g
+ id="g8">
+ <image
+ width="16"
+ height="16"
+ preserveAspectRatio="none"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0 U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHISURBVDjLpVPNK0RRFP+9D98syMwUspHk m9I0YkFZWBFKkZ0s7a3Ewh+ilChK7FgoZCJFKYlYKB8zk2+Z5t0P577He29kQU7dd+6575zf+d1z ztWklPiPmOozt/U4SThjXIoyIQS4AJjSXO0lGGlvcXAm6Vzsz4xUhm0AIeX4QLig+C+ZpxbOG1wG hGYHr1zMUmZGWRgs0ha3PE1nX/8mWmdgWTzLB+DUYbhm9FfZ35IEyrhXA3VXJfPbsV8B9LQUIeUH YJ8ASobag1jcucNgW8g9W4reYSDi2YnnZDoDiwCokDANct6NwTB0LEdj0HRA/wxa2SN25JNBEdWl uUhZ366gqmAaGvrCAXKOozccTGPgt8+vn8GYSGcgyTYp3dpBnBg42nbQPRBTo5bTvqYkmxL6AQhN TWQGBXY3B7BxlEBXozcW64dxRKoKUZBju+P06gl5WaaviMJBM3TNDlbypemIZgHYOnlwASsCmW7n HADGnBoQ3c76YmweJ9BR5zFYjsbRHwm4tmJg6PhWA7pCXXk+bu7fURHKweXtq/sWaksz7SC/CCGF rwtyZ3r+rCnFRZ7qr1qc6mLZj4f9OEyPL8lVpbX/PucPv5QPKHB1TdEAAAAASUVORK5CYII= "
+ id="image10" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.6667px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#000000;fill-opacity:1;stroke:none"
+ x="4.533843"
+ y="11.888033"
+ id="text4435"><tspan
+ id="tspan4433"
+ x="4.533843"
+ y="11.888033">L</tspan></text>
+ </g>
+</svg>