diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerMissingModuleActionContext.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/modules/DebuggerMissingModuleActionContext.java
similarity index 86%
rename from Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerMissingModuleActionContext.java
rename to Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/modules/DebuggerMissingModuleActionContext.java
index ae0191a0f22..345fbc6ebcf 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/modules/DebuggerMissingModuleActionContext.java
+++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/modules/DebuggerMissingModuleActionContext.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package ghidra.app.plugin.core.debug.gui.modules;
+package ghidra.debug.api.modules;
import java.util.Objects;
@@ -43,10 +43,9 @@ public boolean equals(Object obj) {
if (this == obj) {
return true;
}
- if (!(obj instanceof DebuggerMissingModuleActionContext)) {
+ if (!(obj instanceof DebuggerMissingModuleActionContext that)) {
return false;
}
- DebuggerMissingModuleActionContext that = (DebuggerMissingModuleActionContext) obj;
if (!this.module.equals(that.module)) {
return false;
}
diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/modules/DebuggerMissingProgramActionContext.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/modules/DebuggerMissingProgramActionContext.java
new file mode 100644
index 00000000000..85a7ae72ac1
--- /dev/null
+++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/modules/DebuggerMissingProgramActionContext.java
@@ -0,0 +1,98 @@
+/* ###
+ * 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.debug.api.modules;
+
+import java.util.Objects;
+
+import docking.DefaultActionContext;
+import ghidra.program.model.address.*;
+import ghidra.program.model.listing.InstructionIterator;
+import ghidra.program.model.listing.Program;
+import ghidra.trace.model.Trace;
+
+public class DebuggerMissingProgramActionContext extends DefaultActionContext {
+
+ public static Address getMappingProbeAddress(Program program) {
+ if (program == null) {
+ return null;
+ }
+ AddressIterator eepi = program.getSymbolTable().getExternalEntryPointIterator();
+ if (eepi.hasNext()) {
+ return eepi.next();
+ }
+ InstructionIterator ii = program.getListing().getInstructions(true);
+ if (ii.hasNext()) {
+ return ii.next().getAddress();
+ }
+ AddressSetView es = program.getMemory().getExecuteSet();
+ if (!es.isEmpty()) {
+ return es.getMinAddress();
+ }
+ if (!program.getMemory().isEmpty()) {
+ return program.getMinAddress();
+ }
+ return null;
+ }
+
+ private final Trace trace;
+ private final Program program;
+ private final int hashCode;
+
+ private Address probe;
+
+ public DebuggerMissingProgramActionContext(Trace trace, Program program) {
+ this.trace = Objects.requireNonNull(trace);
+ this.program = Objects.requireNonNull(program);
+ this.hashCode = Objects.hash(getClass(), trace, program);
+ }
+
+ public Trace getTrace() {
+ return trace;
+ }
+
+ public Program getProgram() {
+ return program;
+ }
+
+ @Override
+ public int hashCode() {
+ return hashCode;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof DebuggerMissingProgramActionContext that)) {
+ return false;
+ }
+ if (!this.trace.equals(that.trace)) {
+ return false;
+ }
+ if (!this.program.equals(that.program)) {
+ return false;
+ }
+ return true;
+ }
+
+ public Address getMappingProbeAddress() {
+ if (probe == null) {
+ probe = getMappingProbeAddress(program);
+ }
+ return probe;
+ }
+}
diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java
index 2478d173e01..310b51f42cd 100644
--- a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java
+++ b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java
@@ -43,16 +43,14 @@
import ghidra.framework.options.SaveState;
import ghidra.framework.plugintool.AutoConfigState.ConfigStateField;
import ghidra.framework.plugintool.PluginTool;
-import ghidra.program.model.address.*;
-import ghidra.program.model.listing.InstructionIterator;
+import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Program;
import ghidra.program.util.ProgramLocation;
import ghidra.pty.*;
import ghidra.trace.model.Trace;
import ghidra.trace.model.TraceLocation;
import ghidra.trace.model.modules.TraceModule;
-import ghidra.util.MessageType;
-import ghidra.util.Msg;
+import ghidra.util.*;
import ghidra.util.exception.CancelledException;
import ghidra.util.task.Task;
import ghidra.util.task.TaskMonitor;
@@ -169,25 +167,8 @@ public Icon getIcon() {
}
protected Address getMappingProbeAddress() {
- if (program == null) {
- return null;
- }
- AddressIterator eepi = program.getSymbolTable().getExternalEntryPointIterator();
- if (eepi.hasNext()) {
- return eepi.next();
- }
- InstructionIterator ii = program.getListing().getInstructions(true);
- if (ii.hasNext()) {
- return ii.next().getAddress();
- }
- AddressSetView es = program.getMemory().getExecuteSet();
- if (!es.isEmpty()) {
- return es.getMinAddress();
- }
- if (!program.getMemory().isEmpty()) {
- return program.getMinAddress();
- }
- return null; // I guess we won't wait for a mapping, then
+ // May be null, in which case, we won't wait for a mapping
+ return DebuggerMissingProgramActionContext.getMappingProbeAddress(program);
}
protected CompletableFuture This action is offered to resolve a "missing module" console message. It is equivalent to Import From File System on the missing module. This action is offered to resolve a "missing module" console message. Such a message is
+ reported in the Debug
+ Console when the cursor in the Dynamic Listing cannot be
+ synchronized to the static listing for lack of a module mapping. This action is equivalent to
+ Import From File System on the missing module. This action is offered to resolve a "missing module" console message. It is equivalent to Map Module To on the missing module. This action is offered to resolve a "missing module" console message. Such a message is
+ reported in the Debug
+ Console when the cursor in the Dynamic Listing cannot be
+ synchronized to the static listing for lack of a module mapping. This action is equivalent to
+ Map Module To on the missing module. This action is offered to resolve a "missing program" console message. Such a message is
+ reported in the Debug
+ Console when the launcher fails to map the current program database to the launched trace.
+ This action is equivalent to Map Modules, but considering only the
+ missing program and launched trace. This action is offered to resolve a "missing program" console message. Such a message is
+ reported in the Debug
+ Console when the launcher fails to map the current program database to the launched trace.
+ This action is only available when the current trace is the launched trace. It finds the module
+ containing the cursor in the Dynamic Listing and proposes
+ to map it to the missing program. This action is offered to resolve a "missing program" console message. Such a message is
+ reported in the Debug
+ Console when the launcher fails to map the current program database to the launched trace.
+ This action is equivalent to Map Identically, but for the
+ missing program and launched trace.Map Section to Current Block
- Import Missing
Module
- Map Missing
Module
+
+ Retry Map
+ Missing Program
+
+ Map
+ Missing Program to Current Module
+
+ Map Missing Program Identically
@@ -179,12 +216,15 @@
Show Sections Table
Dynamic
+ Listing contained by the selected modules or sections.
This action is available when the dynamic listing's cursor is at a valid location. It - selects the module and section, if applicable, containing that cursor. If the dynamic listing - has a selection, it selects all modules and sections intersecting that selection.
+This action is available when the Dynamic Listing's cursor is + at a valid location. It selects the module and section, if applicable, containing that cursor. + If the dynamic listing has a selection, it selects all modules and sections intersecting that + selection.