From aeb8dc5b02a18586ee1febf91094b5cd9f51c1bd Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Fri, 21 Apr 2023 16:35:31 -0400 Subject: [PATCH] GP-3074: Create separate Emulator.tool --- Ghidra/Debug/Debugger/certification.manifest | 2 + .../breakpoint/DebuggerBreakpointsPlugin.java | 1 - .../gui/listing/DebuggerListingPlugin.java | 1 - .../gui/memory/DebuggerMemoryBytesPlugin.java | 1 - .../gui/memory/DebuggerRegionsPlugin.java | 1 - .../gui/modules/DebuggerModulesPlugin.java | 1 - .../gui/register/DebuggerRegistersPlugin.java | 1 - .../register/DebuggerRegistersProvider.java | 2 - .../gui/watch/DebuggerWatchesPlugin.java | 1 - ...ebuggerLogicalBreakpointServicePlugin.java | 11 +- .../main/resources/defaultTools/Emulator.tool | 1275 +++++++++++++++++ .../src/main/resources/images/process32.png | Bin 0 -> 1408 bytes 12 files changed, 1283 insertions(+), 14 deletions(-) create mode 100644 Ghidra/Debug/Debugger/src/main/resources/defaultTools/Emulator.tool create mode 100644 Ghidra/Debug/Debugger/src/main/resources/images/process32.png diff --git a/Ghidra/Debug/Debugger/certification.manifest b/Ghidra/Debug/Debugger/certification.manifest index 308d6003c7..9f3c7f66f3 100644 --- a/Ghidra/Debug/Debugger/certification.manifest +++ b/Ghidra/Debug/Debugger/certification.manifest @@ -89,6 +89,7 @@ src/main/help/help/topics/VariableValueHoverPlugin/images/VariableValueHoverPlug src/main/help/help/topics/VariableValueHoverPlugin/images/VariableValueHoverPluginDecompiler.png||GHIDRA||||END| src/main/help/help/topics/VariableValueHoverPlugin/images/VariableValueHoverPluginListing.png||GHIDRA||||END| src/main/resources/defaultTools/Debugger.tool||GHIDRA||||END| +src/main/resources/defaultTools/Emulator.tool||GHIDRA||||END| src/main/resources/images/add.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/attach.png||GHIDRA||||END| src/main/resources/images/autoread.png||GHIDRA||||END| @@ -122,6 +123,7 @@ src/main/resources/images/object-running.png||GHIDRA||||END| src/main/resources/images/object-terminated.png||GHIDRA||||END| src/main/resources/images/object-unpopulated.png||GHIDRA||||END| src/main/resources/images/process.png||GHIDRA||||END| +src/main/resources/images/process32.png||GHIDRA||||END| src/main/resources/images/record.png||GHIDRA||||END| src/main/resources/images/register-marker.png||GHIDRA||||END| src/main/resources/images/registers.png||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPlugin.java index 39f44e02bb..f640eb7a37 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPlugin.java @@ -32,7 +32,6 @@ import ghidra.framework.plugintool.util.PluginStatus; status = PluginStatus.RELEASED, servicesRequired = { DebuggerLogicalBreakpointService.class, - DebuggerModelService.class, }, eventsConsumed = { TraceOpenedPluginEvent.class, diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.java index 232eefae44..491ee98ce6 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingPlugin.java @@ -76,7 +76,6 @@ import utilities.util.SuppressableCallback.Suppression; TraceSelectionPluginEvent.class }, servicesRequired = { - DebuggerModelService.class, // For memory capture DebuggerStaticMappingService.class, // For static listing sync. TODO: Optional? DebuggerEmulationService.class, // TODO: Optional? ProgramManager.class, // For static listing sync diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.java index e9bbda7298..1e7032fb40 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesPlugin.java @@ -59,7 +59,6 @@ import ghidra.program.util.ProgramSelection; TraceSelectionPluginEvent.class, }, servicesRequired = { - DebuggerModelService.class, // For memory capture ClipboardService.class, }) public class DebuggerMemoryBytesPlugin diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerRegionsPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerRegionsPlugin.java index f67605e963..934fcd56a1 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerRegionsPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerRegionsPlugin.java @@ -38,7 +38,6 @@ import ghidra.framework.plugintool.util.PluginStatus; TraceActivatedPluginEvent.class, }, servicesRequired = { - DebuggerModelService.class, DebuggerStaticMappingService.class, DebuggerTraceManagerService.class, ProgramManager.class, diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesPlugin.java index c0566398e9..450f4de9d3 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerModulesPlugin.java @@ -37,7 +37,6 @@ import ghidra.framework.plugintool.util.PluginStatus; TraceActivatedPluginEvent.class, }, servicesRequired = { - DebuggerModelService.class, DebuggerStaticMappingService.class, DebuggerTraceManagerService.class, ProgramManager.class, diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersPlugin.java index be87b48e45..2c003a71d7 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersPlugin.java @@ -46,7 +46,6 @@ import ghidra.util.Msg; TraceClosedPluginEvent.class, }, servicesRequired = { - DebuggerModelService.class, DebuggerTraceManagerService.class, MarkerService.class, // TODO DataTypeManagerService.class, // For DataType selection field diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java index aa5cf54fc9..152a28cf66 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java @@ -468,8 +468,6 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter private Trace currentTrace; // Copy for transition private TraceRecorder currentRecorder; // Copy for transition - @AutoServiceConsumed - private DebuggerModelService modelService; @AutoServiceConsumed private DebuggerTraceManagerService traceManager; @AutoServiceConsumed diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesPlugin.java index bf5401e353..56aef1615c 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesPlugin.java @@ -37,7 +37,6 @@ import ghidra.framework.plugintool.util.PluginStatus; DebuggerWatchesService.class, }, servicesRequired = { - DebuggerModelService.class, DebuggerTraceManagerService.class, DataTypeManagerService.class, // For DataType selection field }) diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServicePlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServicePlugin.java index ce851fdf12..5a9f934331 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServicePlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServicePlugin.java @@ -41,7 +41,8 @@ import ghidra.framework.model.*; import ghidra.framework.plugintool.*; import ghidra.framework.plugintool.annotation.AutoServiceConsumed; import ghidra.framework.plugintool.util.PluginStatus; -import ghidra.program.model.address.*; +import ghidra.program.model.address.Address; +import ghidra.program.model.address.AddressRange; import ghidra.program.model.listing.*; import ghidra.program.util.*; import ghidra.trace.model.*; @@ -70,7 +71,6 @@ import ghidra.util.datastruct.ListenerSet; }, servicesRequired = { DebuggerTraceManagerService.class, - DebuggerModelService.class, DebuggerStaticMappingService.class, }, servicesProvided = { @@ -1006,7 +1006,7 @@ public class DebuggerLogicalBreakpointServicePlugin extends Plugin private void traceOpened(Trace trace) { processChange(c -> { - TraceRecorder recorder = modelService.getRecorder(trace); + TraceRecorder recorder = modelService == null ? null : modelService.getRecorder(trace); long snap = traceManager.getCurrentFor(trace).getSnap(); doTrackTrace(c, trace, recorder, snap); }, "traceOpened"); @@ -1171,7 +1171,7 @@ public class DebuggerLogicalBreakpointServicePlugin extends Plugin public CompletableFuture placeBreakpointAt(Trace trace, Address address, long length, Collection kinds, String name) { long snap = traceManager.getCurrentFor(trace).getSnap(); - TraceRecorder recorder = modelService.getRecorder(trace); + TraceRecorder recorder = modelService == null ? null : modelService.getRecorder(trace); ProgramLocation staticLocation = mappingService.getOpenMappedLocation( new DefaultTraceLocation(trace, null, Lifespan.at(snap), address)); @@ -1268,7 +1268,8 @@ public class DebuggerLogicalBreakpointServicePlugin extends Plugin private void planActOnLocTarget(BreakpointActionSet actions, TraceBreakpoint tb, BiConsumer targetLocConsumer) { - TraceRecorder recorder = modelService.getRecorder(tb.getTrace()); + TraceRecorder recorder = + modelService == null ? null : modelService.getRecorder(tb.getTrace()); if (recorder == null) { return; } diff --git a/Ghidra/Debug/Debugger/src/main/resources/defaultTools/Emulator.tool b/Ghidra/Debug/Debugger/src/main/resources/defaultTools/Emulator.tool new file mode 100644 index 0000000000..e5502b6c61 --- /dev/null +++ b/Ghidra/Debug/Debugger/src/main/resources/defaultTools/Emulator.tool @@ -0,0 +1,1275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ghidra/Debug/Debugger/src/main/resources/images/process32.png b/Ghidra/Debug/Debugger/src/main/resources/images/process32.png new file mode 100644 index 0000000000000000000000000000000000000000..139ac4a07df9aa3e1cb47f21e8197f56b1e81df8 GIT binary patch literal 1408 zcmV-`1%LX9P)|VGjv~Owq!0d*`kRWjo_BS3J8Ai3kVlqwrHIZGl!WmqbiiQ z@?u%*=-CHo*YeuSvM0Go&pFTkdH(nIob&$+DWwGH>+9pdfdd4CL9~Prg7WfmQd3hy zQ`>|Pr(?zILO+_Dn>9BFkW!+mYUGq%3tsHpxl_)Rke!{4!{IPSt6_ z>wp1(l#~<-3kx+9C@Lxs&6^ zs_N=$`uh5CI2`Occ0Y>ow;#SpWo0Esqmkm`Vr(|sEg^(m2=Qk`Ej_T$@ArSCs%m0E zK><2l^ob7!gETfa5*Ilsgb-G%6^q4!s;cDX=E4L5Hk*w=AV6MT9tjBvlRoMAi`2SY zuGc~@5+5H=etv#bUTbSBRaI4paZoyNjfiWsqicxjrgl!%N8kNB?Ag4tehKO3#K>tk zum%vowfg${w1$R;@S>t9m`o{U$%NbOo|S+Y z9(g)w-(QpH>G#c=JX0ha^)!4{%6$Di&Ye3)b8~Y{INeW8?fFJ@R zr6p!uoTG3VNy=&7Hv(R9u#d^>b_hNc9TZ(oZ!N#VIg3I}(roifMm z8J@8@Oz*7z4@aaa!UWRI^QTNWbm9tKeLgySpYYkqt5fE@5Pd048Pho{F*+KQ&P(?= z^8F2ld~@4`3k>n>eQ#_N*4EZ&a#qh|t=V$u^D{pacse?#<^cYuqcq=ilW2(Nt=C_r zsi`SutZvi#rGw@qW%kTjBH5^C*oR5oK+lf#BR$fb$fXIsp1&Oh*j{X5%bPEgW{NsB9Yo7<`b0T4o6U50cO#_?OS8}C zBgzp0HNfh~%GqUSq6plse1GCg+ypj+9MQNTsd2ent0SG&1nW*qOAD2imH#>-A;cpo z