GP-2437: Change DBAddressFieldCodec to use FixedField10

This commit is contained in:
Dan 2022-08-15 14:02:22 -04:00
parent b289708a00
commit c0c25e3805
114 changed files with 2354 additions and 652 deletions

View file

@ -34,7 +34,7 @@ import ghidra.util.database.UndoableTransaction;
import ghidra.util.exception.DuplicateNameException;
/**
* This script populates a trace database with memory derived from "!address". This is particularly
* This script populates a trace database with memory derived from "!address". This is particularly
* useful for dump files and other cases where QueryVirtual fails.
*
* <p>
@ -64,7 +64,6 @@ public class BangAddressToMemory extends GhidraScript {
private AddressSpace defaultSpace;
private DebuggerModelService modelService;
private DebuggerTraceManagerService managerService;
@ -96,7 +95,7 @@ public class BangAddressToMemory extends GhidraScript {
if (modelService == null) {
throw new RuntimeException("Unable to find DebuggerMemviewPlugin");
}
DebuggerObjectModel model = modelService.getCurrentModel();
if (!(model instanceof AbstractDbgModel)) {
throw new RuntimeException("Current model must be an AbstractDbgModel");
@ -111,7 +110,7 @@ public class BangAddressToMemory extends GhidraScript {
throw new RuntimeException("Script requires an active trace");
}
memory = trace.getMemoryManager();
lang = currentProgram.getLanguage();
defaultSpace = lang.getAddressFactory().getDefaultAddressSpace();
@ -121,7 +120,7 @@ public class BangAddressToMemory extends GhidraScript {
}
private void parse(String result) {
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Populate memory", true);
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Populate memory");
LockHold hold = trace.lockWrite();) {
//Pattern pattern = Pattern.compile("\\s+(*)\\s+(*)\\s+");
//Matcher matcher = pattern.matcher(fullclassname);
@ -149,7 +148,7 @@ public class BangAddressToMemory extends GhidraScript {
try {
TraceMemoryRegion region =
memory.addRegion(startStr, Range.atLeast(0L), rng, TraceMemoryFlag.READ,
TraceMemoryFlag.WRITE, TraceMemoryFlag.EXECUTE);
TraceMemoryFlag.WRITE, TraceMemoryFlag.EXECUTE);
region.setName(name);
}
catch (TraceOverlappedRegionException | DuplicateNameException e) {

View file

@ -191,7 +191,7 @@ public class PopulateTraceLocal extends GhidraScript {
control.waitForEvent();
try (UndoableTransaction tid =
UndoableTransaction.start(trace, "Populate Events", true)) {
UndoableTransaction.start(trace, "Populate Events")) {
List<ModelObject> children =
util.getElements(List.of("Debugger", "State", "DebuggerVariables", "curprocess",
@ -284,7 +284,7 @@ public class PopulateTraceLocal extends GhidraScript {
}
try (UndoableTransaction tid =
UndoableTransaction.start(trace, "Populate Registers", true)) {
UndoableTransaction.start(trace, "Populate Registers")) {
//for (Long tick : tickManager.getAllTicks()) {
for (Long snap : eventSnaps) {
control.execute("!tt " + Long.toHexString(snap) + ":0");

View file

@ -151,7 +151,7 @@ public class PopulateTraceRemote extends GhidraScript {
manager = tool.getService(DebuggerTraceManagerService.class);
targets = tool.getService(DebuggerModelService.class);
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Populate Events", true)) {
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Populate Events")) {
timeManager = trace.getTimeManager();
timeManager.createSnapshot("init");
}