Ghidra is a software reverse engineering (SRE) framework
GP-5265: Move schedule display from Threads to Listing tabs
Dan273dfba1ac67
diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/images/DebuggerListingPlugin.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/images/DebuggerListingPlugin.pngindex d8d7e04dc7..dd87b11ced 100644Binary files a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/images/DebuggerListingPlugin.png and b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/images/DebuggerListingPlugin.png differdiff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerThreadsPlugin/images/DebuggerThreadsPlugin.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerThreadsPlugin/images/DebuggerThreadsPlugin.pngindex 65b3572ee6..7a10f049ff 100644Binary files a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerThreadsPlugin/images/DebuggerThreadsPlugin.png and b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerThreadsPlugin/images/DebuggerThreadsPlugin.png differdiff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTimePlugin/DebuggerTimePlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTimePlugin/DebuggerTimePlugin.htmlindex 0f74f6c0bc..46a9d5e5aa 100644--- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTimePlugin/DebuggerTimePlugin.html+++ b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTimePlugin/DebuggerTimePlugin.html@@ -61,18 +61,16 @@<H3><A name="goto_time"></A>Go To Time</H3>- <P>This action is available when a trace is active. It prompts for a <EM>time schedule</EM>.- This is the same form as the notation in the sub-title of the <A href=- "help/topics/DebuggerThreadsPlugin/DebuggerThreadsPlugin.html">Threads</A> window. In many- cases, it is simply the snapshot number, e.g., <CODE>3</CODE>, which will go to the snapshot- with key 3. It may optionally include an emulation schedule. For example, <CODE>3:10</CODE>- will use snapshot 3 for an emulator's initial state and step 10 machine instructions on- snapshot 3's event thread. If the snapshot does not give an event thread, then the thread must- be specified in the expression, e.g., <CODE>3:t1-10</CODE>. That expression will start at- snapshot 3, get the thread with key 1, and step it 10 machine instructions. The stepping- commands can be repeated any number of times, separated by semicolons, to step threads in a- specified sequence. For example, <CODE>3:t1-10;t2-5</CODE> will do the same as before, then get- thread 2 and step it 5 times.</P>+ <P>This action is available when a trace is active. It prompts for a <EM>time schedule</EM>. In+ many cases, it is simply the snapshot number, e.g., <CODE>3</CODE>, which will go to the+ snapshot with key 3. It may optionally include an emulation schedule. For example,+ <CODE>3:10</CODE> will use snapshot 3 for an emulator's initial state and step 10 machine+ instructions on snapshot 3's event thread. If the snapshot does not give an event thread, then+ the thread must be specified in the expression, e.g., <CODE>3:t1-10</CODE>. That expression+ will start at snapshot 3, get the thread with key 1, and step it 10 machine instructions. The+ stepping commands can be repeated any number of times, separated by semicolons, to step threads+ in a specified sequence. For example, <CODE>3:t1-10;t2-5</CODE> will do the same as before,+ then get thread 2 and step it 5 times.</P><P>The emulator's state can also be patched by the schedule. Instead of specifying the numberof steps, write a <EM>Sleigh</EM> statement, e.g., <CODE>3:t1-{r0=0x1234};10</CODE>. This willdiff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTraceViewDiffPlugin/images/DebuggerTraceViewDiffPlugin.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTraceViewDiffPlugin/images/DebuggerTraceViewDiffPlugin.pngindex a8839668b2..b4dff232d2 100644Binary files a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTraceViewDiffPlugin/images/DebuggerTraceViewDiffPlugin.png and b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTraceViewDiffPlugin/images/DebuggerTraceViewDiffPlugin.png differdiff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/thread/DebuggerThreadsProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/thread/DebuggerThreadsProvider.javaindex d83043533c..3334d69385 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/thread/DebuggerThreadsProvider.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/thread/DebuggerThreadsProvider.java@@ -4,9 +4,9 @@* 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.@@ -165,7 +165,6 @@ public class DebuggerThreadsProvider extends ComponentProviderAdapter {forSnapsListener.setTrace(coordinates.getTrace());- setSubTitle(coordinates.getTime().toString());contextChanged();}diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanel.javaindex 46f66b1f3f..a83ee6ab40 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanel.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanel.java@@ -4,9 +4,9 @@* 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.@@ -25,11 +25,11 @@ import ghidra.app.plugin.core.debug.event.*;import ghidra.app.plugin.core.debug.gui.DebuggerResources;import ghidra.app.plugin.core.debug.gui.DebuggerResources.*;import ghidra.app.plugin.core.debug.gui.thread.DebuggerTraceFileActionContext;-import ghidra.app.plugin.core.progmgr.MultiTabPlugin;import ghidra.app.services.DebuggerTargetService;import ghidra.app.services.DebuggerTraceManagerService;import ghidra.debug.api.target.Target;import ghidra.debug.api.target.TargetPublicationListener;+import ghidra.debug.api.tracemgr.DebuggerCoordinates;import ghidra.framework.model.*;import ghidra.framework.plugintool.*;import ghidra.framework.plugintool.annotation.AutoServiceConsumed;@@ -117,7 +117,17 @@ public class DebuggerTraceTabPanel extends GTabPanel<Trace>}private String getNameForTrace(Trace trace) {- return DomainObjectDisplayUtils.getTabText(trace);+ String name = DomainObjectDisplayUtils.getTabText(trace);+ DebuggerCoordinates current = traceManager.getCurrentFor(trace);+ if (current == DebuggerCoordinates.NOWHERE) {+ // TODO: Could use view's snap and time table's schedule+ return name + " (?)";+ }+ String schedule = current.getTime().toString();+ if (schedule.length() > 15) {+ schedule = "..." + schedule.substring(schedule.length() - 12);+ }+ return name + " (" + schedule + ")";}private Icon getIconForTrace(Trace trace) {@@ -179,6 +189,7 @@ public class DebuggerTraceTabPanel extends GTabPanel<Trace>Trace trace = evt.getActiveCoordinates().getTrace();try (Suppression supp = cbCoordinateActivation.suppress(null)) {selectTab(trace);+ refreshTab(trace);}}else if (event instanceof TraceClosedPluginEvent evt) {diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.javaindex 28d89edaab..39a7e36455 100644--- a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java+++ b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java@@ -309,6 +309,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGeneratorpublic void testGettingStarted_DisassemblyAfterLaunch() throws Throwable {launchProgramInGdb();+ Thread.sleep(7000);captureToolWindow(1920, 1080);}@@ -354,7 +355,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGeneratorlaunchProgramInGdb();placeBreakpointsSRandRand();- tool.setSize(1920, 1080);+ runSwing(() -> tool.setSize(1920, 1080));captureProvider(DebuggerBreakpointsProvider.class);}diff --git a/GhidraDocs/GhidraClass/Debugger/B2-Emulation.html b/GhidraDocs/GhidraClass/Debugger/B2-Emulation.htmlindex 2d5a708ed3..d178d2273d 100644--- a/GhidraDocs/GhidraClass/Debugger/B2-Emulation.html+++ b/GhidraDocs/GhidraClass/Debugger/B2-Emulation.html@@ -238,16 +238,16 @@ snapshot, Ghidra will read that variable from the live target, captureit, and provide its value to the emulator.</p><section id="stepping-schedules" class="level3"><h3>Stepping Schedules</h3>-<p>If you had not noticed before, the subtitle of the Threads window-gives the current snapshot number. If you have stepped in the emulator,-it will also contain the sequence of steps emulated. Recall the-<em>time</em> element of the Debugger’s <em>coordinates</em>. (See the-<a href="A5-Navigation.html">Navigation</a> module if you need a+<p>If you had not noticed before, the trace tabs include the current+snapshot number. If you have stepped in the emulator, it will also+contain the sequence of steps emulated. Recall the <em>time</em> element+of the Debugger’s <em>coordinates</em>. (See the <a+href="A5-Navigation.html">Navigation</a> module if you need arefresher.) The time element, called the <em>schedule</em>, consists of-both the current snapshot and the sequence of steps to emulate. The-subtitle displays that schedule. If you have done any patching of the-emulator’s state, you may notice some more complicated “steps” in the-schedule. The syntax is:</p>+both the current snapshot and the sequence of steps to emulate. The tab+displays that schedule. If you have done any patching of the emulator’s+state, you may notice some more complicated “steps” in the schedule. The+syntax is:</p><ul><li><em>Schedule</em> → <em>Snapshot</em> [ <code>:</code> [<em>Step</em> ( <code>;</code> <em>Step</em> ) * ] [ <code>.</code>diff --git a/GhidraDocs/GhidraClass/Debugger/B2-Emulation.md b/GhidraDocs/GhidraClass/Debugger/B2-Emulation.mdindex f44332df2b..a2062cd75c 100644--- a/GhidraDocs/GhidraClass/Debugger/B2-Emulation.md+++ b/GhidraDocs/GhidraClass/Debugger/B2-Emulation.md@@ -73,12 +73,12 @@ If the emulated target reads a variable that Ghidra has not yet captured into th### Stepping Schedules-If you had not noticed before, the subtitle of the Threads window gives the current snapshot number.+If you had not noticed before, the trace tabs include the current snapshot number.If you have stepped in the emulator, it will also contain the sequence of steps emulated.Recall the *time* element of the Debugger's *coordinates*.(See the [Navigation](A5-Navigation.md) module if you need a refresher.)The time element, called the *schedule*, consists of both the current snapshot and the sequence of steps to emulate.-The subtitle displays that schedule.+The tab displays that schedule.If you have done any patching of the emulator's state, you may notice some more complicated "steps" in the schedule.The syntax is:diff --git a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.png b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.pngindex 79b1d06403..856c2a4e5e 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.png and b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/Emulation_InitialListing.png b/GhidraDocs/GhidraClass/Debugger/images/Emulation_InitialListing.pngindex 6a639d7179..450a17bc7b 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/Emulation_InitialListing.png and b/GhidraDocs/GhidraClass/Debugger/images/Emulation_InitialListing.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingAfterResume.png b/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingAfterResume.pngindex 94d901867b..4d1a1b6e59 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingAfterResume.png and b/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingAfterResume.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingForCmdlineSet.png b/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingForCmdlineSet.pngindex b787ef7cdd..1fc49cdef6 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingForCmdlineSet.png and b/GhidraDocs/GhidraClass/Debugger/images/Emulation_ListingForCmdlineSet.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.png b/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.pngindex 73022b83b2..252c733b3e 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.png and b/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/Navigation_CompareTimes.png b/GhidraDocs/GhidraClass/Debugger/images/Navigation_CompareTimes.pngindex 6ce0e54c9d..d6e7729a9d 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/Navigation_CompareTimes.png and b/GhidraDocs/GhidraClass/Debugger/images/Navigation_CompareTimes.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/Navigation_ThreadsInCallRand.png b/GhidraDocs/GhidraClass/Debugger/images/Navigation_ThreadsInCallRand.pngindex 5267e23be2..1978683aff 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/Navigation_ThreadsInCallRand.png and b/GhidraDocs/GhidraClass/Debugger/images/Navigation_ThreadsInCallRand.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/State_ListingAfterCallRand.png b/GhidraDocs/GhidraClass/Debugger/images/State_ListingAfterCallRand.pngindex 3b1299adfd..25ebaaa859 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/State_ListingAfterCallRand.png and b/GhidraDocs/GhidraClass/Debugger/images/State_ListingAfterCallRand.png differdiff --git a/GhidraDocs/GhidraClass/Debugger/images/State_ListingStackAfterCallRand.png b/GhidraDocs/GhidraClass/Debugger/images/State_ListingStackAfterCallRand.pngindex 110fc06e04..b128831e1b 100644Binary files a/GhidraDocs/GhidraClass/Debugger/images/State_ListingStackAfterCallRand.png and b/GhidraDocs/GhidraClass/Debugger/images/State_ListingStackAfterCallRand.png differ