mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-21 20:42:20 +08:00
GP-2437: Change DBAddressFieldCodec to use FixedField10
This commit is contained in:
+5
-6
@@ -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) {
|
||||
|
||||
+2
-2
@@ -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");
|
||||
|
||||
+1
-1
@@ -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");
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DebuggerEmuExampleScript extends GhidraScript {
|
||||
.getProjectData()
|
||||
.getRootFolder()
|
||||
.createFile("emu_example", program, monitor);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
AddressSpace space = program.getAddressFactory().getDefaultAddressSpace();
|
||||
entry = space.getAddress(0x00400000);
|
||||
Address dataEntry = space.getAddress(0x00600000);
|
||||
@@ -163,7 +163,7 @@ public class DebuggerEmuExampleScript extends GhidraScript {
|
||||
*/
|
||||
TraceTimeManager time = trace.getTimeManager();
|
||||
TraceSnapshot snapshot = time.getSnapshot(0, true);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate")) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
println("Executing: " + thread.getCounter());
|
||||
thread.stepInstruction();
|
||||
|
||||
@@ -295,7 +295,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
* object.
|
||||
*/
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Populate First Snapshot", true)) {
|
||||
UndoableTransaction.start(trace, "Populate First Snapshot")) {
|
||||
/**
|
||||
* While not strictly required, each tick should be explicitly added to the database and
|
||||
* given a description. Some things may mis-behave if there does not exist at least one
|
||||
@@ -439,7 +439,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Just hand emulate the stepping
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap = trace.getTimeManager().createSnapshot("Stepped: PUSH RBP").getKey();
|
||||
|
||||
stack1offset -= 8;
|
||||
@@ -466,7 +466,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* More hand emulation
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap = trace.getTimeManager().createSnapshot("Stepped: MOV RBP,RSP").getKey();
|
||||
|
||||
putRIP(snap, regs1, mainInstructions.get(++pc1));
|
||||
@@ -482,7 +482,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
* While this is a complicated call, there is nothing new to demonstrate in its
|
||||
* implementation. As an exercise, see if you can follow what is happening within.
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap = trace.getTimeManager()
|
||||
.createSnapshot("Stepped Thread 1: CALL clone -> Thread 2")
|
||||
.getKey();
|
||||
@@ -520,7 +520,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Hand emulate thread1 a few steps
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: RET from clone").getKey();
|
||||
|
||||
@@ -535,7 +535,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* ...
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: TEST EAX,EAX").getKey();
|
||||
|
||||
@@ -545,7 +545,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: JNZ child").getKey();
|
||||
|
||||
@@ -557,7 +557,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Switch to thread2
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: RET from clone").getKey();
|
||||
|
||||
@@ -569,7 +569,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: TEST EAX,EAX").getKey();
|
||||
|
||||
@@ -579,7 +579,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: JNZ child").getKey();
|
||||
|
||||
@@ -591,7 +591,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Switch to thread1
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: SUB RSP,0x10").getKey();
|
||||
|
||||
@@ -603,7 +603,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(1)").getKey();
|
||||
|
||||
@@ -614,7 +614,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(2)").getKey();
|
||||
|
||||
@@ -625,7 +625,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(3)").getKey();
|
||||
|
||||
@@ -636,7 +636,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(4)").getKey();
|
||||
|
||||
@@ -650,7 +650,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Switch to thread2
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: SUB RSP,0x10").getKey();
|
||||
|
||||
@@ -662,7 +662,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: MOV...(1)").getKey();
|
||||
|
||||
@@ -673,7 +673,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: MOV...(2)").getKey();
|
||||
|
||||
@@ -684,7 +684,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: MOV...(3)").getKey();
|
||||
|
||||
@@ -698,7 +698,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Let thread2 exit first
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: CALL exit").getKey();
|
||||
|
||||
@@ -708,7 +708,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Terminate
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: CALL exit").getKey();
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class StandAloneSyscallEmuExampleScript extends GhidraScript {
|
||||
program =
|
||||
new ProgramDB("syscall_example", language,
|
||||
language.getCompilerSpecByID(new CompilerSpecID("gcc")), this);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
AddressSpace space = program.getAddressFactory().getDefaultAddressSpace();
|
||||
entry = space.getAddress(0x00400000);
|
||||
Address dataEntry = space.getAddress(0x00600000);
|
||||
|
||||
+2
-2
@@ -74,7 +74,7 @@ public class BreakpointLocationRow {
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint name", true)) {
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint name")) {
|
||||
loc.setName(name);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class BreakpointLocationRow {
|
||||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint comment", true)) {
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint comment")) {
|
||||
loc.setComment(comment);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -830,7 +830,7 @@ public class DebuggerCopyIntoProgramDialog extends DialogComponentProvider {
|
||||
Program dest = getDestination().getOrCreateProgram(source, this);
|
||||
boolean doRelease = !Arrays.asList(programManager.getAllOpenPrograms()).contains(dest);
|
||||
TraceRecorder recorder = getRecorderIfEnabledAndReadsPresent();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(dest, "Copy From Trace", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(dest, "Copy From Trace")) {
|
||||
monitor.initialize(tableModel.getRowCount());
|
||||
for (RangeEntry entry : tableModel.getModelData()) {
|
||||
monitor.setMessage("Copying into " + entry.getDstRange());
|
||||
|
||||
+5
-6
@@ -35,9 +35,8 @@ public class RegionRow {
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Renamed region", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Rename region")) {
|
||||
region.setName(name);
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ public class RegionRow {
|
||||
|
||||
public void setRead(boolean read) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region read flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region read flag")) {
|
||||
region.setRead(read);
|
||||
}
|
||||
}
|
||||
@@ -87,7 +86,7 @@ public class RegionRow {
|
||||
|
||||
public void setWrite(boolean write) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region write flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region write flag")) {
|
||||
region.setWrite(write);
|
||||
}
|
||||
}
|
||||
@@ -98,7 +97,7 @@ public class RegionRow {
|
||||
|
||||
public void setExecute(boolean execute) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region execute flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region execute flag")) {
|
||||
region.setExecute(execute);
|
||||
}
|
||||
}
|
||||
@@ -109,7 +108,7 @@ public class RegionRow {
|
||||
|
||||
public void setVolatile(boolean vol) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region volatile flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region volatile flag")) {
|
||||
region.setVolatile(vol);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -303,12 +303,10 @@ public class DebuggerStaticMappingProvider extends ComponentProviderAdapter
|
||||
// TODO: Action to adjust life span?
|
||||
// Note: provider displays mappings for all time, so delete means delete, not truncate
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Remove Static Mappings", false)) {
|
||||
UndoableTransaction.start(currentTrace, "Remove Static Mappings")) {
|
||||
for (StaticMappingRow mapping : ctx.getSelectedMappings()) {
|
||||
mapping.getMapping().delete();
|
||||
}
|
||||
// TODO: Do I want all-or-nothing among all transactions?
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class ModuleRow {
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(module.getTrace(), "Renamed module", true)) {
|
||||
UndoableTransaction.start(module.getTrace(), "Renamed module")) {
|
||||
module.setName(name);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class SectionRow {
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(section.getTrace(), "Renamed section", true)) {
|
||||
UndoableTransaction.start(section.getTrace(), "Rename section")) {
|
||||
section.setName(name);
|
||||
}
|
||||
catch (DuplicateNameException e) {
|
||||
|
||||
+1
-1
@@ -229,7 +229,7 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {
|
||||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Resolve DataType", true)) {
|
||||
UndoableTransaction.start(current.getTrace(), "Resolve DataType")) {
|
||||
return current.getTrace().getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -367,7 +367,7 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType", true)) {
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType")) {
|
||||
return currentTrace.getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
@@ -832,14 +832,13 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||
*/
|
||||
void writeRegisterDataType(Register register, DataType dataType) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Edit Register Type", false)) {
|
||||
UndoableTransaction.start(current.getTrace(), "Edit Register Type")) {
|
||||
TraceCodeRegisterSpace space = getRegisterMemorySpace(true).getCodeSpace(true);
|
||||
long snap = current.getViewSnap();
|
||||
space.definedUnits().clear(Range.closed(snap, snap), register, TaskMonitor.DUMMY);
|
||||
if (dataType != null) {
|
||||
space.definedData().create(Range.atLeast(snap), register, dataType);
|
||||
}
|
||||
tid.commit();
|
||||
}
|
||||
catch (CodeUnitInsertionException | CancelledException e) {
|
||||
throw new AssertionError(e);
|
||||
|
||||
+2
-2
@@ -79,8 +79,8 @@ public class StackFrameRow {
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid = UndoableTransaction
|
||||
.start(frame.getStack().getThread().getTrace(), "Frame comment", true)) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(frame.getStack().getThread().getTrace(), "Frame comment")) {
|
||||
frame.setComment(getSnap(), comment);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ public class ThreadRow {
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Renamed thread", true)) {
|
||||
UndoableTransaction.start(thread.getTrace(), "Rename thread")) {
|
||||
thread.setName(name);
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class ThreadRow {
|
||||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Renamed thread", true)) {
|
||||
UndoableTransaction.start(thread.getTrace(), "Rename thread")) {
|
||||
thread.setComment(comment);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public class DebuggerTimePlugin extends AbstractDebuggerPlugin {
|
||||
if (dialog.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Rename Snapshot", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Rename Snapshot")) {
|
||||
if (snapshot == null) {
|
||||
snapshot = manager.getSnapshot(snap, true);
|
||||
}
|
||||
|
||||
+1
-2
@@ -61,9 +61,8 @@ public class SnapshotRow {
|
||||
|
||||
public void setDescription(String description) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Modify snapshot description", false)) {
|
||||
UndoableTransaction.start(trace, "Modify snapshot description")) {
|
||||
snapshot.setDescription(description);
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -208,7 +208,7 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter {
|
||||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType", true)) {
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType")) {
|
||||
return currentTrace.getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
@@ -523,7 +523,7 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter {
|
||||
}
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Apply Watch Data Type", true)) {
|
||||
UndoableTransaction.start(current.getTrace(), "Apply Watch Data Type")) {
|
||||
try {
|
||||
listing.clearCodeUnits(row.getAddress(), row.getRange().getMaxAddress(), false);
|
||||
listing.createData(address, dataType, size);
|
||||
|
||||
+3
-3
@@ -55,9 +55,9 @@ public class DefaultDebuggerPlatformMapper extends AbstractDebuggerPlatformMappe
|
||||
|
||||
@Override
|
||||
public void addToTrace(long snap) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add guest " +
|
||||
cSpec.getLanguage().getLanguageDescription() + "/" + cSpec.getCompilerSpecDescription(),
|
||||
true)) {
|
||||
String description = "Add guest " + cSpec.getLanguage().getLanguageDescription() + "/" +
|
||||
cSpec.getCompilerSpecDescription();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, description)) {
|
||||
TracePlatformManager platformManager = trace.getPlatformManager();
|
||||
TraceGuestPlatform platform = platformManager.getOrAddGuestPlatform(cSpec);
|
||||
if (platform == null) {
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class ObjectBasedDebuggerMemoryMapper implements DebuggerMemoryMapper {
|
||||
|
||||
protected AddressSpace createSpace(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Create space for mapping", true)) {
|
||||
UndoableTransaction.start(trace, "Create space for mapping")) {
|
||||
AddressFactory factory = trace.getBaseAddressFactory();
|
||||
AddressSpace space = factory.getAddressSpace(name);
|
||||
if (space == null) {
|
||||
|
||||
+3
-6
@@ -128,9 +128,8 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
||||
throw new IllegalStateException("Must save breakpoint to program before naming it");
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Rename breakpoint", false)) {
|
||||
UndoableTransaction.start(program, "Rename breakpoint")) {
|
||||
bookmark.set(bookmark.getCategory(), name);
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,8 +153,7 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
||||
// volatile reads
|
||||
Bookmark eBookmark = this.eBookmark;
|
||||
Bookmark dBookmark = this.dBookmark;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Clear breakpoint", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Clear breakpoint")) {
|
||||
BookmarkManager bookmarkManager = program.getBookmarkManager();
|
||||
if (eBookmark != null) {
|
||||
bookmarkManager.removeBookmark(eBookmark);
|
||||
@@ -165,7 +163,6 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
||||
}
|
||||
// (e,d)Bookmark Gets nulled on program change callback
|
||||
// If null here, logical breakpoint manager will get confused
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +247,7 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
||||
String delType =
|
||||
enabled ? BREAKPOINT_DISABLED_BOOKMARK_TYPE : BREAKPOINT_ENABLED_BOOKMARK_TYPE;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Enable breakpoint", true)) {
|
||||
UndoableTransaction.start(program, "Enable breakpoint")) {
|
||||
BookmarkManager manager = program.getBookmarkManager();
|
||||
String catStr = computeCategory();
|
||||
manager.setBookmark(address, addType, catStr, comment);
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ public class DebuggerStateEditingServicePlugin extends AbstractDebuggerPlugin
|
||||
long snap = coordinates.getViewSnap();
|
||||
TraceMemoryOperations memOrRegs;
|
||||
try (UndoableTransaction txid =
|
||||
UndoableTransaction.start(trace, "Edit Variable", true)) {
|
||||
UndoableTransaction.start(trace, "Edit Variable")) {
|
||||
if (address.isRegisterAddress()) {
|
||||
TraceThread thread = coordinates.getThread();
|
||||
if (thread == null) {
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ public abstract class AbstractReadsTargetPcodeExecutorState
|
||||
}
|
||||
else {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Create space", true)) {
|
||||
UndoableTransaction.start(trace, "Create space")) {
|
||||
tms = TraceSleighUtils.getSpaceForExecution(s, trace, thread, frame, true);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -403,7 +403,7 @@ public class DebuggerEmulationServicePlugin extends Plugin implements DebuggerEm
|
||||
time.execute(trace, emu, monitor);
|
||||
}
|
||||
TraceSnapshot destSnap;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate")) {
|
||||
destSnap = findScratch(trace, time);
|
||||
emu.writeDown(trace, destSnap.getKey(), time.getSnap(), false);
|
||||
}
|
||||
|
||||
+2
-4
@@ -293,13 +293,12 @@ public enum ProgramEmulationUtils {
|
||||
boolean success = false;
|
||||
try {
|
||||
trace = new DBTrace(getTraceName(program), program.getCompilerSpec(), consumer);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate")) {
|
||||
TraceSnapshot initial =
|
||||
trace.getTimeManager().createSnapshot(EMULATION_STARTED_AT + pc);
|
||||
long snap = initial.getKey();
|
||||
loadExecutable(initial, program);
|
||||
doLaunchEmulationThread(trace, snap, program, pc, pc);
|
||||
tid.commit();
|
||||
}
|
||||
success = true;
|
||||
return trace;
|
||||
@@ -339,9 +338,8 @@ public enum ProgramEmulationUtils {
|
||||
public static TraceThread launchEmulationThread(Trace trace, long snap, Program program,
|
||||
Address tracePc, Address programPc) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Emulate new Thread", false)) {
|
||||
UndoableTransaction.start(trace, "Emulate new Thread")) {
|
||||
TraceThread thread = doLaunchEmulationThread(trace, snap, program, tracePc, programPc);
|
||||
tid.commit();
|
||||
return thread;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import ghidra.util.database.UndoableTransaction;
|
||||
public class RecorderPermanentTransaction implements AutoCloseable {
|
||||
|
||||
public static RecorderPermanentTransaction start(UndoableDomainObject obj, String description) {
|
||||
UndoableTransaction tid = UndoableTransaction.start(obj, description, true);
|
||||
UndoableTransaction tid = UndoableTransaction.start(obj, description);
|
||||
return new RecorderPermanentTransaction(obj, tid);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -255,7 +255,7 @@ public class TraceObjectManager {
|
||||
TraceThread traceThread = threadRecorder.getTraceThread();
|
||||
recorder.createSnapshot(traceThread + " started", traceThread, null);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(recorder.getTrace(), "Adjust thread creation", true)) {
|
||||
UndoableTransaction.start(recorder.getTrace(), "Adjust thread creation")) {
|
||||
long existing = traceThread.getCreationSnap();
|
||||
if (existing == Long.MIN_VALUE) {
|
||||
traceThread.setCreationSnap(recorder.getSnap());
|
||||
@@ -545,7 +545,7 @@ public class TraceObjectManager {
|
||||
if (rec != null) {
|
||||
String name = (String) added.get(TargetObject.DISPLAY_ATTRIBUTE_NAME);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(rec.getTrace(), "Renamed thread", true)) {
|
||||
UndoableTransaction.start(rec.getTrace(), "Rename thread")) {
|
||||
rec.getTraceThread().setName(name);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ public class ObjectBasedTraceRecorder implements TraceRecorder {
|
||||
String path = object.getJoinedPath(".");
|
||||
// Don't offload, because we need a consistent map
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Object created: " + path, true)) {
|
||||
UndoableTransaction.start(trace, "Object created: " + path)) {
|
||||
objectRecorder.recordCreated(snap, object);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ class ObjectRecorder {
|
||||
this.isSupportsFocus = !schema.searchFor(TargetFocusScope.class, false).isEmpty();
|
||||
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(recorder.trace, "Create root", true)) {
|
||||
UndoableTransaction.start(recorder.trace, "Create root")) {
|
||||
objectManager.createRootObject(schema);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -730,7 +730,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
public void addMapping(TraceLocation from, ProgramLocation to, long length,
|
||||
boolean truncateExisting) throws TraceConflictedMappingException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(from.getTrace(), "Add mapping", true)) {
|
||||
UndoableTransaction.start(from.getTrace(), "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(from, to, length, truncateExisting);
|
||||
}
|
||||
}
|
||||
@@ -739,7 +739,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
public void addMapping(MapEntry<?, ?> entry, boolean truncateExisting)
|
||||
throws TraceConflictedMappingException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(entry.getFromTrace(), "Add mapping", true)) {
|
||||
UndoableTransaction.start(entry.getFromTrace(), "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(entry, truncateExisting);
|
||||
}
|
||||
}
|
||||
@@ -751,8 +751,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
entries.stream().collect(Collectors.groupingBy(ent -> ent.getFromTrace()));
|
||||
for (Map.Entry<Trace, List<MapEntry<?, ?>>> ent : byTrace.entrySet()) {
|
||||
Trace trace = ent.getKey();
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, description, true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, description)) {
|
||||
doAddMappings(trace, ent.getValue(), monitor, truncateExisting);
|
||||
}
|
||||
}
|
||||
@@ -776,7 +775,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
public void addIdentityMapping(Trace from, Program toProgram, Range<Long> lifespan,
|
||||
boolean truncateExisting) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(from, "Add identity mappings", true)) {
|
||||
UndoableTransaction.start(from, "Add identity mappings")) {
|
||||
DebuggerStaticMappingUtils.addIdentityMapping(from, toProgram, lifespan,
|
||||
truncateExisting);
|
||||
}
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ public class DisassembleAtPcDebuggerBot implements DebuggerBot {
|
||||
}
|
||||
TraceData pcUnit = null;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Disassemble: PC is code pointer", true)) {
|
||||
UndoableTransaction.start(trace, "Disassemble: PC is code pointer")) {
|
||||
TraceCodeRegisterSpace regCode =
|
||||
codeManager.getCodeRegisterSpace(thread, frameLevel, true);
|
||||
try {
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class DebuggerBreakpointMarkerPluginScreenShots extends GhidraScreenShotG
|
||||
.getRootFolder()
|
||||
.createFile("WinHelloCPP", program, TaskMonitor.DUMMY);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add Mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add Mapping")) {
|
||||
mappingService.addIdentityMapping(trace, program, Range.atLeast(0L), true);
|
||||
}
|
||||
waitForValue(() -> mappingService.getOpenMappedLocation(
|
||||
|
||||
+3
-3
@@ -130,12 +130,12 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera
|
||||
mb.testProcess1.addRegion("echo:.data", mb.rng(0x00600000, 0x00600fff), "rw");
|
||||
mb.testProcess3.addRegion("echo:.text", mb.rng(0x7fac0000, 0x7fac0fff), "rx");
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace1, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace1, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace1, null, Range.atLeast(0L), addr(trace1, 0x00400000)),
|
||||
new ProgramLocation(program, addr(program, 0x00400000)), 0x00210000, false);
|
||||
}
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace3, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace3, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace3, null, Range.atLeast(0L), addr(trace3, 0x7fac0000)),
|
||||
new ProgramLocation(program, addr(program, 0x00400000)), 0x00010000, false);
|
||||
@@ -159,7 +159,7 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera
|
||||
trace3.getBreakpointManager()
|
||||
.getBreakpointsAt(recorder3.getSnap(), addr(trace3, 0x7fac1234))));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add breakpoint", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add breakpoint")) {
|
||||
program.getBookmarkManager()
|
||||
.setBookmark(addr(program, 0x00401234),
|
||||
LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE, "SW_EXECUTE;1",
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ public class DebuggerCopyActionsPluginScreenShots extends GhidraScreenShotGenera
|
||||
program = createDefaultProgram("echo", "Toy:BE:64:default", this);
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add memory")) {
|
||||
program.setImageBase(tb.addr(stSpace, 0x00400000), true);
|
||||
Memory memory = program.getMemory();
|
||||
memory.createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000, (byte) 0,
|
||||
|
||||
+2
-2
@@ -103,7 +103,7 @@ public class DebuggerRegionsPluginScreenShots extends GhidraScreenShotGenerator
|
||||
progBash = createDefaultProgram("bash", ProgramBuilder._X64, this);
|
||||
progLibC = createDefaultProgram("libc.so.6", ProgramBuilder._X64, this);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory")) {
|
||||
progBash.setImageBase(addr(progBash, 0x00400000), true);
|
||||
progBash.getMemory()
|
||||
.createInitializedBlock(".text", addr(progBash, 0x00400000), 0x10000, (byte) 0,
|
||||
@@ -113,7 +113,7 @@ public class DebuggerRegionsPluginScreenShots extends GhidraScreenShotGenerator
|
||||
TaskMonitor.DUMMY, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
||||
+2
-2
@@ -114,7 +114,7 @@ public class DebuggerModulesPluginScreenShots extends GhidraScreenShotGenerator
|
||||
progBash = createDefaultProgram("bash", ProgramBuilder._X64, this);
|
||||
progLibC = createDefaultProgram("libc.so.6", ProgramBuilder._X64, this);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory")) {
|
||||
progBash.setImageBase(addr(progBash, 0x00400000), true);
|
||||
progBash.getMemory()
|
||||
.createInitializedBlock(".text", addr(progBash, 0x00400000), 0x10000, (byte) 0,
|
||||
@@ -124,7 +124,7 @@ public class DebuggerModulesPluginScreenShots extends GhidraScreenShotGenerator
|
||||
TaskMonitor.DUMMY, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
||||
+2
-2
@@ -94,7 +94,7 @@ public class DebuggerStaticMappingPluginScreenShots extends GhidraScreenShotGene
|
||||
progEcho = createDefaultProgram("bash", ProgramBuilder._X64, this);
|
||||
progLibC = createDefaultProgram("libc.so.6", ProgramBuilder._X64, this);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progEcho, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progEcho, "Add memory")) {
|
||||
progEcho.setImageBase(addr(progEcho, 0x00400000), true);
|
||||
progEcho.getMemory()
|
||||
.createInitializedBlock(".text", addr(progEcho, 0x00400000), 0x10000, (byte) 0,
|
||||
@@ -104,7 +104,7 @@ public class DebuggerStaticMappingPluginScreenShots extends GhidraScreenShotGene
|
||||
TaskMonitor.DUMMY, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ public class DebuggerStackPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
public void testCaptureDebuggerStackPlugin() throws Throwable {
|
||||
DomainFolder root = tool.getProject().getProjectData().getRootFolder();
|
||||
program = createDefaultProgram("echo", ToyProgramBuilder._X64, this);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate")) {
|
||||
program.setImageBase(addr(program, 0x00400000), true);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x10000, (byte) 0,
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class DebuggerThreadsPluginScreenShots extends GhidraScreenShotGenerator
|
||||
waitForValue(() -> recorder.getTraceThread(handler2Thread));
|
||||
AbstractGhidraHeadedDebuggerGUITest.waitForDomainObject(trace);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Comments", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Comments")) {
|
||||
recorder.getTraceThread(mainThread).setComment("GUI main loop");
|
||||
recorder.getTraceThread(serverThread).setComment("Server");
|
||||
recorder.getTraceThread(handler1Thread).setComment("Handler 1");
|
||||
|
||||
+1
-1
@@ -736,7 +736,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
program = new ProgramDB("static-" + name.getMethodName(), lang,
|
||||
lang.getDefaultCompilerSpec(), this);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Set Executable Path", true)) {
|
||||
UndoableTransaction.start(program, "Set Executable Path")) {
|
||||
program.setExecutablePath(path);
|
||||
}
|
||||
programManager.openProgram(program);
|
||||
|
||||
+4
-4
@@ -107,7 +107,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
protected void addStaticMemoryAndBreakpoint() throws LockException, DuplicateNameException,
|
||||
MemoryConflictException, AddressOverflowException, CancelledException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Add bookmark break", true)) {
|
||||
UndoableTransaction.start(program, "Add bookmark break")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
@@ -118,7 +118,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
}
|
||||
|
||||
protected void addMapping(Trace trace) throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace, null, Range.atLeast(0L), addr(trace, 0x55550123)),
|
||||
new ProgramLocation(program, addr(program, 0x00400123)), 0x1000, false);
|
||||
@@ -421,7 +421,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
}
|
||||
waitForPass(() -> assertEquals(0, breakpointService.getAllBreakpoints().size()));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble")) {
|
||||
Disassembler.getDisassembler(program, TaskMonitor.DUMMY, msg -> {
|
||||
}).disassemble(addr(program, 0x00400123), set(rng(program, 0x00400123, 0x00400123)));
|
||||
}
|
||||
@@ -449,7 +449,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
}
|
||||
waitForPass(() -> assertEquals(0, breakpointService.getAllBreakpoints().size()));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble")) {
|
||||
program.getListing().createData(addr(program, 0x00400123), ByteDataType.dataType);
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
||||
+2
-2
@@ -81,7 +81,7 @@ public class DebuggerBreakpointsProviderTest extends AbstractGhidraHeadedDebugge
|
||||
}
|
||||
|
||||
protected void addMapping(Trace trace, Program prog) throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace, null, Range.atLeast(0L), addr(trace, 0x55550000)),
|
||||
new ProgramLocation(prog, addr(prog, 0x00400000)), 0x1000, false);
|
||||
@@ -103,7 +103,7 @@ public class DebuggerBreakpointsProviderTest extends AbstractGhidraHeadedDebugge
|
||||
protected void addStaticMemoryAndBreakpoint() throws LockException, DuplicateNameException,
|
||||
MemoryConflictException, AddressOverflowException, CancelledException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Add bookmark break", true)) {
|
||||
UndoableTransaction.start(program, "Add bookmark break")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
|
||||
+3
-3
@@ -136,7 +136,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add blocks", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add blocks")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x8000, (byte) 0,
|
||||
monitor, false);
|
||||
@@ -230,7 +230,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
MemoryBlock block;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block")) {
|
||||
block = program.getMemory()
|
||||
.createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000,
|
||||
false);
|
||||
@@ -292,7 +292,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
MemoryBlock block;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block")) {
|
||||
block = program.getMemory()
|
||||
.createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000,
|
||||
false);
|
||||
|
||||
+12
-12
@@ -84,7 +84,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
assertTrue(AllCopiers.BYTES.isRequiresInitializedMemory());
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
@@ -117,7 +117,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
assertFalse(AllCopiers.STATE.isRequiresInitializedMemory());
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
@@ -194,7 +194,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
assertTrue(iit.hasNext());
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@@ -242,7 +242,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
assertTrue(iit.hasNext());
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@@ -315,7 +315,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
assertFalse(insCtx.equals(tb.trace.getRegisterContextManager()
|
||||
.getDefaultValue(tb.language, contextReg, checkCtx.getAddress())));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@@ -372,7 +372,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
tb.buf(0x00, 0x03, 0x00, 0x01, 0x02));
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00600000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@@ -432,7 +432,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
tb.buf(0x00, 0x03, 0x00, 0x01, 0x02));
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00600000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@@ -505,7 +505,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
@@ -570,7 +570,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
@@ -621,7 +621,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
@@ -677,7 +677,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
@@ -720,7 +720,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
|
||||
+4
-4
@@ -115,7 +115,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
@@ -488,7 +488,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
@@ -601,7 +601,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
@@ -1486,7 +1486,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
protected void addBlocks() throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
Memory mem = program.getMemory();
|
||||
blockExeText = mem.createInitializedBlock(".text", tb.addr(0x00400000), 0x100, (byte) 0,
|
||||
monitor, false);
|
||||
@@ -257,7 +257,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertFalse(provider.actionMapRegions.isEnabled());
|
||||
|
||||
addBlocks();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setName("echo");
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class ModelQueryTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
ModelQuery rootQuery = ModelQuery.parse("");
|
||||
ModelQuery threadQuery = ModelQuery.parse("Processes[].Threads[]");
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(tb.trace, "Init", true)) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
DBTraceObjectManager objects = tb.trace.getObjectManager();
|
||||
|
||||
TraceObjectValue rootVal =
|
||||
|
||||
+5
-5
@@ -129,7 +129,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
protected MemoryBlock addBlock() throws Exception,
|
||||
MemoryConflictException, AddressOverflowException, CancelledException {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
return program.getMemory()
|
||||
.createInitializedBlock(".text", tb.addr(0x00400000), 0x1000, (byte) 0, monitor,
|
||||
false);
|
||||
@@ -226,7 +226,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForSwing();
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@@ -355,7 +355,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertTrue(modulesProvider.actionMapIdentically.isEnabled());
|
||||
|
||||
// Need some substance in the program
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate")) {
|
||||
addBlock();
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@@ -390,7 +390,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
// Still
|
||||
assertFalse(modulesProvider.actionMapModules.isEnabled());
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setImageBase(addr(program, 0x00400000), true);
|
||||
program.setName(modExe.getName());
|
||||
|
||||
@@ -458,7 +458,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertFalse(modulesProvider.actionMapSections.isEnabled());
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0xc0de1234L), 0x100, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user