mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
4b2bc8985b
4 changed files with 39 additions and 6 deletions
|
@ -59,6 +59,7 @@ import ghidra.trace.model.Trace.TraceObjectChangeType;
|
||||||
import ghidra.trace.model.target.TraceObject;
|
import ghidra.trace.model.target.TraceObject;
|
||||||
import ghidra.trace.model.target.TraceObjectValue;
|
import ghidra.trace.model.target.TraceObjectValue;
|
||||||
import ghidra.trace.model.time.schedule.Scheduler;
|
import ghidra.trace.model.time.schedule.Scheduler;
|
||||||
|
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||||
import ghidra.util.*;
|
import ghidra.util.*;
|
||||||
|
|
||||||
@PluginInfo(
|
@PluginInfo(
|
||||||
|
@ -878,7 +879,8 @@ public class DebuggerControlPlugin extends AbstractDebuggerPlugin
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DebuggerCoordinates current = this.current;
|
DebuggerCoordinates current = this.current;
|
||||||
emulationService.backgroundRun(current.getPlatform(), current.getTime(),
|
TraceSchedule time = current.getTime();
|
||||||
|
emulationService.backgroundRun(current.getPlatform(), time.steppedForward(null, 0),
|
||||||
Scheduler.oneThread(current.getThread())).thenAcceptAsync(r -> {
|
Scheduler.oneThread(current.getThread())).thenAcceptAsync(r -> {
|
||||||
traceManager.activate(current.time(r.schedule()), ActivationCause.USER);
|
traceManager.activate(current.time(r.schedule()), ActivationCause.USER);
|
||||||
}, AsyncUtils.SWING_EXECUTOR).exceptionally(ex -> {
|
}, AsyncUtils.SWING_EXECUTOR).exceptionally(ex -> {
|
||||||
|
|
|
@ -308,6 +308,28 @@ public class DebuggerControlPluginTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||||
assertTrue(controlPlugin.actionEmulateResume.isEnabled());
|
assertTrue(controlPlugin.actionEmulateResume.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the UI so it does not error when the user presses resume
|
||||||
|
* after already stepped into a pcode instruction.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testEmulateResumeActionAfterPcodeStep() throws Throwable {
|
||||||
|
TraceThread thread = createToyLoopTrace();
|
||||||
|
controlService.setCurrentMode(tb.trace, ControlMode.RW_EMULATOR);
|
||||||
|
|
||||||
|
traceManager.activateThread(thread);
|
||||||
|
traceManager.activateTime(TraceSchedule.parse("0:.t0-2"));
|
||||||
|
waitForSwing();
|
||||||
|
|
||||||
|
performEnabledAction(null, controlPlugin.actionEmulateResume, true);
|
||||||
|
waitForPass(() -> assertFalse(controlPlugin.actionEmulateResume.isEnabled()));
|
||||||
|
|
||||||
|
CachedEmulator ce = Unique.assertOne(emulationService.getBusyEmulators());
|
||||||
|
ce.emulator().setSuspended(true);
|
||||||
|
waitForTasks();
|
||||||
|
assertTrue(controlPlugin.actionEmulateResume.isEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEmulateInterruptAction() throws Throwable {
|
public void testEmulateInterruptAction() throws Throwable {
|
||||||
TraceThread thread = createToyLoopTrace();
|
TraceThread thread = createToyLoopTrace();
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.beans.PropertyChangeEvent;
|
||||||
import docking.DockingWindowManager;
|
import docking.DockingWindowManager;
|
||||||
import docking.EmptyBorderToggleButton;
|
import docking.EmptyBorderToggleButton;
|
||||||
import docking.action.*;
|
import docking.action.*;
|
||||||
|
import ghidra.util.Swing;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toolbar buttons for Dialogs.
|
* Toolbar buttons for Dialogs.
|
||||||
|
@ -52,11 +53,18 @@ public class DialogToolbarButton extends EmptyBorderToggleButton {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doActionPerformed(ActionEvent e) {
|
protected void doActionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
|
// The help is pointing to the toolbar button that triggered this call. Reset the help so
|
||||||
|
// that it is correct for any widgets triggered by the actionPeformed call below.
|
||||||
|
DockingWindowManager.clearMouseOverHelp();
|
||||||
|
|
||||||
if (dockingAction instanceof ToggleDockingActionIf) {
|
if (dockingAction instanceof ToggleDockingActionIf) {
|
||||||
ToggleDockingActionIf toggleAction = (ToggleDockingActionIf) dockingAction;
|
ToggleDockingActionIf toggleAction = (ToggleDockingActionIf) dockingAction;
|
||||||
toggleAction.setSelected(!toggleAction.isSelected());
|
toggleAction.setSelected(!toggleAction.isSelected());
|
||||||
}
|
}
|
||||||
dockingAction.actionPerformed(contextProvider.getActionContext(null));
|
|
||||||
|
// Give the Swing thread a chance to repaint
|
||||||
|
Swing.runLater(() -> dockingAction.actionPerformed(contextProvider.getActionContext(null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,4 +7,5 @@ DevGuide.md||GHIDRA||||END|
|
||||||
LICENSE||GHIDRA||||END|
|
LICENSE||GHIDRA||||END|
|
||||||
NOTICE||GHIDRA||||END|
|
NOTICE||GHIDRA||||END|
|
||||||
README.md||GHIDRA||||END|
|
README.md||GHIDRA||||END|
|
||||||
|
ghidra.repos.config||GHIDRA||||END|
|
||||||
gradle.properties||GHIDRA||||END|
|
gradle.properties||GHIDRA||||END|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue