mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-24 03:09:36 +08:00
GP-2502: add option to set timeout
This commit is contained in:
+4
@@ -347,6 +347,10 @@
|
||||
resulting changes in the GUI may be distracting for some. To disable updates to the Objects
|
||||
Viewer, toggle "Updates While Running" off.</P>
|
||||
|
||||
<H3><A name="set_node_timout">Set Node Timeout</A></H3>
|
||||
|
||||
<P>Set the default value for the timeout used when expanding a node, i.e. populating its children.</P>
|
||||
|
||||
<H2><A name="color"></A>Color Options</H2>
|
||||
|
||||
<P>The debugger represents different types of objects with different colors. Bear in mind these
|
||||
|
||||
+14
-1
@@ -182,6 +182,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
ImportFromXMLAction importFromXMLAction;
|
||||
ImportFromFactsAction importFromFactsAction;
|
||||
OpenWinDbgTraceAction openTraceAction;
|
||||
SetTimeoutAction setTimeoutAction;
|
||||
|
||||
private ToggleDockingAction actionToggleBase;
|
||||
private ToggleDockingAction actionToggleSubscribe;
|
||||
@@ -204,6 +205,8 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
private boolean updateWhileRunning = true;
|
||||
@AutoConfigStateField
|
||||
private boolean suppressDescent = false;
|
||||
@AutoConfigStateField
|
||||
private int nodeTimeout = 60;
|
||||
|
||||
Set<TargetConfigurable> configurables = new HashSet<>();
|
||||
private String lastMethod = "";
|
||||
@@ -857,7 +860,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
groupTargetIndex++;
|
||||
|
||||
|
||||
/*
|
||||
actionSuppressDescent = new ToggleActionBuilder("Automatically populate containers", plugin.getName())
|
||||
.menuPath("Maintenance","&Auto-populate")
|
||||
@@ -1222,6 +1225,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
importFromXMLAction = new ImportFromXMLAction(tool, plugin.getName(), this);
|
||||
importFromFactsAction = new ImportFromFactsAction(tool, plugin.getName(), this);
|
||||
openTraceAction = new OpenWinDbgTraceAction(tool, plugin.getName(), this);
|
||||
setTimeoutAction = new SetTimeoutAction(tool, plugin.getName(), this);
|
||||
}
|
||||
|
||||
//@formatter:on
|
||||
@@ -1858,6 +1862,14 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
this.autoRecord = autorecord;
|
||||
}
|
||||
|
||||
public int getNodeTimeout() {
|
||||
return nodeTimeout;
|
||||
}
|
||||
|
||||
public void setNodeTimeout(int timeout) {
|
||||
this.nodeTimeout = timeout;
|
||||
}
|
||||
|
||||
public void updateActions(ObjectContainer providerContainer) {
|
||||
TargetObject obj = getSelectedObject();
|
||||
if (obj != null) {
|
||||
@@ -1889,6 +1901,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
actionToggleAutoRecord.setSelected(autoRecord);
|
||||
actionToggleHideIntrinsics.setSelected(hideIntrinsics);
|
||||
actionToggleSelectionOnly.setSelected(selectionOnly);
|
||||
setTimeoutAction.setNodeTimeout(nodeTimeout);
|
||||
|
||||
methodDialog.readConfigState(saveState);
|
||||
}
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.objects.actions;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider;
|
||||
import ghidra.app.script.AskDialog;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
public class SetTimeoutAction extends DockingAction {
|
||||
|
||||
DebuggerObjectsProvider provider;
|
||||
int timeout = 0;
|
||||
|
||||
public SetTimeoutAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) {
|
||||
super("SetTimeout", owner);
|
||||
setMenuBarData(
|
||||
new MenuData(new String[] { "Maintenance", "&Set Node Timeout" }, null, "M100"));
|
||||
setHelpLocation(new HelpLocation(owner, "set_node_timeout"));
|
||||
this.provider = provider;
|
||||
provider.addLocalAction(this);
|
||||
this.timeout = provider.getNodeTimeout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledForContext(ActionContext context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionContext context) {
|
||||
AskDialog<String> dialog =
|
||||
new AskDialog<String>("Set Node Timeout", "Seconds", AskDialog.INT, timeout);
|
||||
if (dialog.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
timeout = Integer.parseInt(dialog.getValueAsString());
|
||||
provider.setNodeTimeout(timeout);
|
||||
}
|
||||
|
||||
public void setNodeTimeout(int timeout) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -85,7 +85,8 @@ public class ObjectNode extends GTreeSlowLoadingNode { //extends GTreeNode
|
||||
if (cf != null) {
|
||||
// NB: We're allowed to do this because we're guaranteed to be
|
||||
// in our own thread by the GTreeSlowLoadingNode
|
||||
ObjectContainer oc = cf.get(60, TimeUnit.SECONDS);
|
||||
ObjectContainer oc =
|
||||
cf.get(tree.getProvider().getNodeTimeout(), TimeUnit.SECONDS);
|
||||
return tree.update(oc);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user