diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/RemoteMethodInvocationDialog.java b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/RemoteMethodInvocationDialog.java index 2e0f36bd5f..3c582a5dfc 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/RemoteMethodInvocationDialog.java +++ b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/RemoteMethodInvocationDialog.java @@ -15,13 +15,31 @@ */ package ghidra.app.plugin.core.debug.gui.tracermi; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Rectangle; import java.awt.event.ActionEvent; -import java.beans.*; -import java.util.*; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.PropertyEditor; +import java.beans.PropertyEditorManager; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.border.EmptyBorder; import org.apache.commons.collections4.BidiMap; @@ -32,6 +50,7 @@ import org.jdom.Element; import docking.DialogComponentProvider; import ghidra.app.plugin.core.debug.gui.DebuggerResources; +import ghidra.app.plugin.core.debug.service.tracermi.TraceRmiTarget; import ghidra.app.plugin.core.debug.utils.MiscellaneousUtils; import ghidra.dbg.target.schema.SchemaContext; import ghidra.debug.api.tracermi.RemoteParameter; @@ -289,13 +308,18 @@ public class RemoteMethodInvocationDialog extends DialogComponentProvider pairPanel.removeAll(); paramEditors.clear(); for (RemoteParameter param : parameters.values()) { - JLabel label = new JLabel(param.display()); + String text = param.display().equals("") ? param.name() : param.display(); + JLabel label = new JLabel(text); label.setToolTipText(param.description()); pairPanel.add(label); PropertyEditor editor = createEditor(param); Object val = computeMemorizedValue(param); - editor.setValue(val); + if (val == null || val.equals(TraceRmiTarget.Missing.MISSING)) { + editor.setValue(""); + } else { + editor.setValue(val); + } editor.addPropertyChangeListener(this); pairPanel.add(MiscellaneousUtils.getEditorComponent(editor)); paramEditors.put(param, editor); diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/service/tracermi/TraceRmiTarget.java b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/service/tracermi/TraceRmiTarget.java index 12de919f88..b255eb991e 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/service/tracermi/TraceRmiTarget.java +++ b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/service/tracermi/TraceRmiTarget.java @@ -232,7 +232,7 @@ public class TraceRmiTarget extends AbstractTarget { return null; } - private enum Missing { + public enum Missing { MISSING; // The argument requires a prompt } diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/DebuggerMethodActionsPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/DebuggerMethodActionsPlugin.java index 03cc35ec34..9a77a0c6a6 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/DebuggerMethodActionsPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/DebuggerMethodActionsPlugin.java @@ -135,7 +135,8 @@ public class DebuggerMethodActionsPlugin extends Plugin implements PopupActionPr List result = new ArrayList<>(); for (ActionEntry entry : target.collectActions(null, context).values()) { - if (entry.requiresPrompt() || entry.builtIn()) { + //if (entry.requiresPrompt() || entry.builtIn()) { + if (!entry.isEnabled() || entry.builtIn()) { continue; } result.add(new InvokeActionEntryAction(entry)); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java index 07d73ef958..24fda8c170 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java @@ -166,7 +166,7 @@ public class TargetActionTask extends Task { @Override public void run(TaskMonitor monitor) throws CancelledException { try { - entry.run(false); + entry.run(entry.requiresPrompt()); } catch (Throwable e) { reportError(e);