Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/GP-1978_Dan_torchFrameworkDebugging-pt1--SQUASHED'

Ryan Kurtz293f5bdb0a6a
diff --cc Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/LoadEmulatorAutoReadMemorySpec.java
index 23bf5ed247,e9d86acc22..539fc0c322
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/LoadEmulatorAutoReadMemorySpec.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/LoadEmulatorAutoReadMemorySpec.java
@@@ -21,8 -21,8 +21,7 @@@ import java.util.concurrent.Completable
import javax.swing.Icon;
import db.Transaction;
-import ghidra.app.plugin.core.debug.gui.DebuggerResources.AutoReadMemoryAction;
import ghidra.app.plugin.core.debug.service.emulation.ProgramEmulationUtils;
- import ghidra.app.plugin.core.debug.service.model.record.RecorderUtils;
import ghidra.app.plugin.core.debug.utils.AbstractMappedMemoryBytesVisitor;
import ghidra.app.services.DebuggerStaticMappingService;
import ghidra.debug.api.tracemgr.DebuggerCoordinates;
@@@ -49,9 -54,25 +48,25 @@@ enum LoadEmulatorAutoReadMemorySpec imp
@Override
public Icon getMenuIcon() {
- return AutoReadMemoryAction.ICON_LOAD_EMU;
+ return null;
}
+ protected AddressSetView quantize(int blockBits, AddressSetView set) {
+ if (blockBits == 1) {
+ return set;
+ }
+ long blockMask = -1L << blockBits;
+ AddressSet result = new AddressSet();
+ // Not terribly efficient, but this is one range most of the time
+ for (AddressRange range : set) {
+ AddressSpace space = range.getAddressSpace();
+ Address min = space.getAddress(range.getMinAddress().getOffset() & blockMask);
+ Address max = space.getAddress(range.getMaxAddress().getOffset() | ~blockMask);
+ result.add(new AddressRangeImpl(min, max));
+ }
+ return result;
+ }
+
@Override
public CompletableFuture<Boolean> readMemory(PluginTool tool, DebuggerCoordinates coordinates,
AddressSetView visible) {