mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-16 07:30:16 +00:00
GP-3122 Added AutoCloseable Transaction API to DBHandle and
UndoableDomainObject. Performed renaming of some internal classes.
This commit is contained in:
parent
b4de95f4f5
commit
1795c35dfc
@ -18,6 +18,7 @@ import java.nio.ByteOrder;
|
||||
|
||||
import agent.dbgeng.manager.impl.DbgManagerImpl;
|
||||
import agent.dbgeng.model.AbstractDbgModel;
|
||||
import db.Transaction;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.app.services.DebuggerModelService;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
@ -29,7 +30,6 @@ import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.memory.*;
|
||||
import ghidra.util.LockHold;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
@ -119,7 +119,7 @@ public class BangAddressToMemory extends GhidraScript {
|
||||
}
|
||||
|
||||
private void parse(String result) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Populate memory");
|
||||
try (Transaction tx = trace.openTransaction("Populate memory");
|
||||
LockHold hold = trace.lockWrite();) {
|
||||
//Pattern pattern = Pattern.compile("\\s+(*)\\s+(*)\\s+");
|
||||
//Matcher matcher = pattern.matcher(fullclassname);
|
||||
|
@ -25,6 +25,7 @@ import agent.dbgmodel.dbgmodel.DbgModel;
|
||||
import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess;
|
||||
import agent.dbgmodel.dbgmodel.main.ModelObject;
|
||||
import agent.dbgmodel.impl.dbgmodel.bridge.HDMAUtil;
|
||||
import db.Transaction;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
import ghidra.program.model.address.*;
|
||||
@ -39,7 +40,6 @@ import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.thread.TraceThreadManager;
|
||||
import ghidra.trace.model.time.TraceTimeManager;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
/**
|
||||
* This script populates a trace database for demonstrations purposes and opens it in the current
|
||||
@ -189,8 +189,7 @@ public class PopulateTraceLocal extends GhidraScript {
|
||||
client.openDumpFileWide(f.getAbsolutePath());
|
||||
control.waitForEvent();
|
||||
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Populate Events")) {
|
||||
try (Transaction tx = trace.openTransaction("Populate Events")) {
|
||||
|
||||
List<ModelObject> children =
|
||||
util.getElements(List.of("Debugger", "State", "DebuggerVariables", "curprocess",
|
||||
@ -282,8 +281,7 @@ public class PopulateTraceLocal extends GhidraScript {
|
||||
}
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Populate Registers")) {
|
||||
try (Transaction tx = trace.openTransaction("Populate Registers")) {
|
||||
//for (Long tick : tickManager.getAllTicks()) {
|
||||
for (Long snap : eventSnaps) {
|
||||
control.execute("!tt " + Long.toHexString(snap) + ":0");
|
||||
@ -331,7 +329,7 @@ public class PopulateTraceLocal extends GhidraScript {
|
||||
}
|
||||
|
||||
/*
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Populate Heap", true)) {
|
||||
try (Transaction tx = trace.openTransaction("Populate Heap")) {
|
||||
ModelObject currentSession = util.getCurrentSession();
|
||||
ModelObject data = currentSession.getKeyValue("TTD").getKeyValue("Data");
|
||||
ModelMethod heap = data.getMethod("Heap");
|
||||
|
@ -16,6 +16,7 @@
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.app.services.DebuggerModelService;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
@ -28,7 +29,6 @@ import ghidra.program.model.lang.*;
|
||||
import ghidra.trace.database.DBTrace;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.time.TraceTimeManager;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
/**
|
||||
* This script populates a trace database for demonstrations purposes and opens it in the current
|
||||
@ -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")) {
|
||||
try (Transaction tx = trace.openTransaction("Populate Events")) {
|
||||
timeManager = trace.getTimeManager();
|
||||
timeManager.createSnapshot("init");
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.assembler.Assembler;
|
||||
import ghidra.app.plugin.assembler.Assemblers;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
@ -39,7 +40,6 @@ import ghidra.trace.model.symbol.TraceLabelSymbol;
|
||||
import ghidra.trace.model.symbol.TraceNamespaceSymbol;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@ -289,12 +289,10 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
|
||||
/**
|
||||
* For clarity, I will add each tick to the trace in its own transaction. The
|
||||
* UndoableTransaction class eases the syntax and reduces errors in starting and ending
|
||||
* transactions. This Utility deprecates ProgramTransaction, as it can be used on any domain
|
||||
* object.
|
||||
* Transaction class eases the syntax and reduces errors in starting and ending
|
||||
* transactions.
|
||||
*/
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Populate First Snapshot")) {
|
||||
try (Transaction tx = trace.openTransaction("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
|
||||
@ -438,7 +436,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Just hand emulate the stepping
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap = trace.getTimeManager().createSnapshot("Stepped: PUSH RBP").getKey();
|
||||
|
||||
stack1offset -= 8;
|
||||
@ -465,7 +463,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* More hand emulation
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap = trace.getTimeManager().createSnapshot("Stepped: MOV RBP,RSP").getKey();
|
||||
|
||||
putRIP(snap, regs1, mainInstructions.get(++pc1));
|
||||
@ -481,7 +479,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")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap = trace.getTimeManager()
|
||||
.createSnapshot("Stepped Thread 1: CALL clone -> Thread 2")
|
||||
.getKey();
|
||||
@ -519,7 +517,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Hand emulate thread1 a few steps
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: RET from clone").getKey();
|
||||
|
||||
@ -534,7 +532,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* ...
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: TEST EAX,EAX").getKey();
|
||||
|
||||
@ -544,7 +542,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: JNZ child").getKey();
|
||||
|
||||
@ -556,7 +554,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Switch to thread2
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: RET from clone").getKey();
|
||||
|
||||
@ -568,7 +566,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: TEST EAX,EAX").getKey();
|
||||
|
||||
@ -578,7 +576,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: JNZ child").getKey();
|
||||
|
||||
@ -590,7 +588,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Switch to thread1
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: SUB RSP,0x10").getKey();
|
||||
|
||||
@ -602,7 +600,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(1)").getKey();
|
||||
|
||||
@ -613,7 +611,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(2)").getKey();
|
||||
|
||||
@ -624,7 +622,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(3)").getKey();
|
||||
|
||||
@ -635,7 +633,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread1);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: MOV...(4)").getKey();
|
||||
|
||||
@ -649,7 +647,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Switch to thread2
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: SUB RSP,0x10").getKey();
|
||||
|
||||
@ -661,7 +659,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: MOV...(1)").getKey();
|
||||
|
||||
@ -672,7 +670,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: MOV...(2)").getKey();
|
||||
|
||||
@ -683,7 +681,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
placeRegUnits(snap, thread2);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: MOV...(3)").getKey();
|
||||
|
||||
@ -697,7 +695,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Let thread2 exit first
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 2: CALL exit").getKey();
|
||||
|
||||
@ -707,7 +705,7 @@ public class PopulateDemoTrace extends GhidraScript {
|
||||
/**
|
||||
* Terminate
|
||||
*/
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Step")) {
|
||||
try (Transaction tx = trace.openTransaction("Step")) {
|
||||
long snap =
|
||||
trace.getTimeManager().createSnapshot("Stepped Thread 1: CALL exit").getKey();
|
||||
|
||||
|
@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AutoReadMemoryAction;
|
||||
import ghidra.app.plugin.core.debug.service.emulation.ProgramEmulationUtils;
|
||||
@ -34,7 +35,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.memory.TraceMemoryManager;
|
||||
import ghidra.trace.model.memory.TraceMemoryState;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class LoadEmulatorAutoReadMemorySpec implements AutoReadMemorySpec {
|
||||
public static final String CONFIG_NAME = "LOAD_EMULATOR";
|
||||
@ -85,7 +85,7 @@ public class LoadEmulatorAutoReadMemorySpec implements AutoReadMemorySpec {
|
||||
|
||||
long snap = coordinates.getSnap();
|
||||
ByteBuffer buf = ByteBuffer.allocate(4096);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Load Visible")) {
|
||||
try (Transaction tx = trace.openTransaction("Load Visible")) {
|
||||
new AbstractMappedMemoryBytesVisitor(mappingService, buf.array()) {
|
||||
@Override
|
||||
protected void visitData(Address hostAddr, byte[] data, int size) {
|
||||
|
@ -18,13 +18,13 @@ package ghidra.app.plugin.core.debug.gui.breakpoint;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.services.LogicalBreakpoint;
|
||||
import ghidra.app.services.LogicalBreakpoint.State;
|
||||
import ghidra.pcode.exec.SleighUtils;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class BreakpointLocationRow {
|
||||
private final DebuggerBreakpointsProvider provider;
|
||||
@ -73,8 +73,7 @@ public class BreakpointLocationRow {
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint name")) {
|
||||
try (Transaction tid = loc.getTrace().openTransaction("Set breakpoint name")) {
|
||||
loc.setName(name);
|
||||
}
|
||||
}
|
||||
@ -100,8 +99,7 @@ public class BreakpointLocationRow {
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint comment")) {
|
||||
try (Transaction tid = loc.getTrace().openTransaction("Set breakpoint comment")) {
|
||||
loc.setComment(comment);
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import javax.swing.*;
|
||||
import javax.swing.table.TableColumn;
|
||||
import javax.swing.table.TableColumnModel;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ReusableDialogComponentProvider;
|
||||
import docking.widgets.table.*;
|
||||
import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn;
|
||||
@ -47,7 +48,6 @@ import ghidra.trace.model.memory.TraceMemoryRegion;
|
||||
import ghidra.trace.model.modules.*;
|
||||
import ghidra.trace.model.program.TraceProgramView;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.table.GhidraTableFilterPanel;
|
||||
import ghidra.util.task.*;
|
||||
@ -831,7 +831,7 @@ public class DebuggerCopyIntoProgramDialog extends ReusableDialogComponentProvid
|
||||
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")) {
|
||||
try (Transaction tx = dest.openTransaction("Copy From Trace")) {
|
||||
monitor.initialize(tableModel.getRowCount());
|
||||
for (RangeEntry entry : tableModel.getModelData()) {
|
||||
monitor.setMessage("Copying into " + entry.getDstRange());
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.memory;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.address.AddressRange;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.TraceMemoryRegion;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class RegionRow {
|
||||
private final TraceMemoryRegion region;
|
||||
@ -33,8 +33,7 @@ public class RegionRow {
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Rename region")) {
|
||||
try (Transaction tx = region.getTrace().openTransaction("Rename region")) {
|
||||
region.setName(name);
|
||||
}
|
||||
}
|
||||
@ -73,8 +72,8 @@ public class RegionRow {
|
||||
}
|
||||
|
||||
public void setRead(boolean read) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region read flag")) {
|
||||
try (Transaction tx =
|
||||
region.getTrace().openTransaction("Toggle region read flag")) {
|
||||
region.setRead(read);
|
||||
}
|
||||
}
|
||||
@ -84,8 +83,8 @@ public class RegionRow {
|
||||
}
|
||||
|
||||
public void setWrite(boolean write) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region write flag")) {
|
||||
try (Transaction tx =
|
||||
region.getTrace().openTransaction("Toggle region write flag")) {
|
||||
region.setWrite(write);
|
||||
}
|
||||
}
|
||||
@ -95,8 +94,8 @@ public class RegionRow {
|
||||
}
|
||||
|
||||
public void setExecute(boolean execute) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region execute flag")) {
|
||||
try (Transaction tx =
|
||||
region.getTrace().openTransaction("Toggle region execute flag")) {
|
||||
region.setExecute(execute);
|
||||
}
|
||||
}
|
||||
@ -106,8 +105,8 @@ public class RegionRow {
|
||||
}
|
||||
|
||||
public void setVolatile(boolean vol) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region volatile flag")) {
|
||||
try (Transaction tx =
|
||||
region.getTrace().openTransaction("Toggle region volatile flag")) {
|
||||
region.setVolatile(vol);
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.model.columns;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.model.ObjectTableModel.ValueProperty;
|
||||
import ghidra.app.plugin.core.debug.gui.model.ObjectTableModel.ValueRow;
|
||||
import ghidra.docking.settings.Settings;
|
||||
@ -22,7 +23,6 @@ import ghidra.framework.plugintool.ServiceProvider;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.target.TraceObject;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class TraceValueObjectEditableAttributeColumn<T> extends TraceValueObjectAttributeColumn<T>
|
||||
implements EditableColumn<ValueRow, ValueProperty<T>, Trace> {
|
||||
@ -40,8 +40,8 @@ public class TraceValueObjectEditableAttributeColumn<T> extends TraceValueObject
|
||||
public void setValue(ValueRow row, ValueProperty<T> value, Settings settings, Trace dataSource,
|
||||
ServiceProvider serviceProvider) {
|
||||
TraceObject object = row.getValue().getChild();
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(object.getTrace(), "Edit column " + getColumnName())) {
|
||||
try (Transaction tx =
|
||||
object.getTrace().openTransaction("Edit column " + getColumnName())) {
|
||||
object.setAttribute(Lifespan.nowOn(row.currentSnap()), attributeName, value.getValue());
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import javax.swing.*;
|
||||
import javax.swing.table.TableColumn;
|
||||
import javax.swing.table.TableColumnModel;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.DockingActionIf;
|
||||
@ -50,11 +51,9 @@ import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.Trace.TraceStaticMappingChangeType;
|
||||
import ghidra.trace.model.modules.TraceStaticMapping;
|
||||
import ghidra.trace.model.modules.TraceStaticMappingManager;
|
||||
import ghidra.trace.model.program.TraceProgramView;
|
||||
import ghidra.util.MathUtilities;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.ObjectKey;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.table.GhidraTableFilterPanel;
|
||||
|
||||
public class DebuggerStaticMappingProvider extends ComponentProviderAdapter
|
||||
@ -305,8 +304,7 @@ public class DebuggerStaticMappingProvider extends ComponentProviderAdapter
|
||||
private void activatedRemove(DebuggerStaticMappingActionContext ctx) {
|
||||
// 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")) {
|
||||
try (Transaction tid = currentTrace.openTransaction("Remove Static Mappings")) {
|
||||
for (StaticMappingRow mapping : ctx.getSelectedMappings()) {
|
||||
mapping.getMapping().delete();
|
||||
}
|
||||
|
@ -15,10 +15,10 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.modules;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class ModuleRow {
|
||||
private final TraceModule module;
|
||||
@ -32,8 +32,7 @@ public class ModuleRow {
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(module.getTrace(), "Renamed module")) {
|
||||
try (Transaction tx = module.getTrace().openTransaction("Renamed module")) {
|
||||
module.setName(name);
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.modules;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.address.AddressRange;
|
||||
import ghidra.trace.model.DefaultTraceLocation;
|
||||
@ -22,7 +23,6 @@ import ghidra.trace.model.TraceLocation;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.trace.model.modules.TraceSection;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class SectionRow {
|
||||
@ -41,8 +41,7 @@ public class SectionRow {
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(section.getTrace(), "Rename section")) {
|
||||
try (Transaction tx = section.getTrace().openTransaction("Rename section")) {
|
||||
section.setName(name);
|
||||
}
|
||||
catch (DuplicateNameException e) {
|
||||
|
@ -30,6 +30,7 @@ import javax.swing.table.*;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.action.DockingAction;
|
||||
import docking.widgets.table.*;
|
||||
import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn;
|
||||
@ -62,7 +63,6 @@ import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.ColorUtils;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import ghidra.util.table.GhidraTableFilterPanel;
|
||||
import ghidra.util.table.column.AbstractGColumnRenderer;
|
||||
@ -241,8 +241,8 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {
|
||||
if (dataType == null) {
|
||||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Resolve DataType")) {
|
||||
try (Transaction tid =
|
||||
current.getTrace().openTransaction("Resolve DataType")) {
|
||||
return current.getTrace().getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import javax.swing.table.TableColumnModel;
|
||||
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
@ -78,7 +79,6 @@ import ghidra.trace.util.TraceRegisterUtils;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.classfinder.ClassSearcher;
|
||||
import ghidra.util.data.DataTypeParser.AllowedDataTypes;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import ghidra.util.table.GhidraTableFilterPanel;
|
||||
@ -450,8 +450,7 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||
if (dataType == null) {
|
||||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType")) {
|
||||
try (Transaction tx = currentTrace.openTransaction("Resolve DataType")) {
|
||||
return currentTrace.getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
@ -902,8 +901,7 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||
* register and modify it.... Well, that works until you consider changes in time....
|
||||
*/
|
||||
void writeRegisterDataType(Register register, DataType dataType) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Edit Register Type")) {
|
||||
try (Transaction tx = current.getTrace().openTransaction("Edit Register Type")) {
|
||||
if (dataType instanceof Pointer ptrType && register.getAddress().isRegisterAddress()) {
|
||||
// Because we're about to use the size, resolve it first
|
||||
ptrType = (Pointer) current.getTrace()
|
||||
@ -1004,8 +1002,8 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
||||
void prepareRegisterSpace() {
|
||||
if (current.getThread() != null &&
|
||||
current.getTrace().getObjectManager().getRootSchema() != null) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Create/initialize register space")) {
|
||||
try (Transaction tx =
|
||||
current.getTrace().openTransaction("Create/initialize register space")) {
|
||||
getRegisterMemorySpace(true);
|
||||
}
|
||||
}
|
||||
|
@ -15,10 +15,10 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.stack;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.Function;
|
||||
import ghidra.trace.model.stack.TraceStackFrame;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class StackFrameRow {
|
||||
public static class Synthetic extends StackFrameRow {
|
||||
@ -73,8 +73,8 @@ public class StackFrameRow {
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(frame.getStack().getThread().getTrace(), "Frame comment")) {
|
||||
try (Transaction tx =
|
||||
frame.getStack().getThread().getTrace().openTransaction("Frame comment")) {
|
||||
frame.setComment(getSnap(), comment);
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.thread;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.services.DebuggerModelService;
|
||||
import ghidra.app.services.TraceRecorder;
|
||||
import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState;
|
||||
@ -22,7 +23,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class ThreadRow {
|
||||
private final DebuggerModelService service;
|
||||
@ -42,8 +42,7 @@ public class ThreadRow {
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Rename thread")) {
|
||||
try (Transaction tx = thread.getTrace().openTransaction("Rename thread")) {
|
||||
thread.setName(name);
|
||||
}
|
||||
}
|
||||
@ -67,8 +66,7 @@ public class ThreadRow {
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Rename thread")) {
|
||||
try (Transaction tx = thread.getTrace().openTransaction("Set thread comment")) {
|
||||
thread.setComment(comment);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.gui.time;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.widgets.dialogs.InputDialog;
|
||||
@ -37,7 +38,6 @@ import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.program.TraceProgramView;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.trace.model.time.TraceTimeManager;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@PluginInfo(
|
||||
shortDescription = "Lists recorded snapshots in a trace",
|
||||
@ -112,7 +112,7 @@ public class DebuggerTimePlugin extends AbstractDebuggerPlugin {
|
||||
if (dialog.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Rename Snapshot")) {
|
||||
try (Transaction tx = trace.openTransaction("Rename Snapshot")) {
|
||||
if (snapshot == null) {
|
||||
snapshot = manager.getSnapshot(snap, true);
|
||||
}
|
||||
|
@ -17,11 +17,11 @@ package ghidra.app.plugin.core.debug.gui.time;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.DateUtils;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class SnapshotRow {
|
||||
//private static final DateFormat FORMAT = DateFormat.getDateTimeInstance();
|
||||
@ -60,8 +60,7 @@ public class SnapshotRow {
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Modify snapshot description")) {
|
||||
try (Transaction tx = trace.openTransaction("Modify snapshot description")) {
|
||||
snapshot.setDescription(description);
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import javax.swing.table.TableColumnModel;
|
||||
|
||||
import org.jdom.Element;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.action.DockingAction;
|
||||
@ -81,7 +82,6 @@ import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.trace.util.TraceAddressSpace;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import ghidra.util.table.GhidraTableFilterPanel;
|
||||
@ -280,8 +280,7 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
|
||||
if (dataType == null) {
|
||||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType")) {
|
||||
try (Transaction tx = currentTrace.openTransaction("Resolve DataType")) {
|
||||
return currentTrace.getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
@ -605,8 +604,8 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
|
||||
return;
|
||||
}
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Apply Watch Data Type")) {
|
||||
try (Transaction tx =
|
||||
current.getTrace().openTransaction("Apply Watch Data Type")) {
|
||||
try {
|
||||
listing.clearCodeUnits(row.getAddress(), row.getRange().getMaxAddress(), false);
|
||||
Data data = listing.createData(address, dataType, size);
|
||||
|
@ -19,6 +19,7 @@ import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.processors.sleigh.SleighLanguage;
|
||||
import ghidra.app.services.DataTypeManagerService;
|
||||
@ -44,7 +45,6 @@ import ghidra.trace.model.memory.TraceMemoryState;
|
||||
import ghidra.trace.model.symbol.TraceLabelSymbol;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.NumericUtilities;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class WatchRow {
|
||||
public static final int TRUNCATE_BYTES_LENGTH = 64;
|
||||
@ -234,8 +234,7 @@ public class WatchRow {
|
||||
dataType =
|
||||
new PointerTypedef(null, ptrType.getDataType(), ptrType.getLength(), dtm, space);
|
||||
if (dtm != null) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(dtm, "Resolve data type")) {
|
||||
try (Transaction tid = dtm.openTransaction("Resolve data type")) {
|
||||
dataType = dtm.resolve(dataType, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.mapping;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.lang.CompilerSpec;
|
||||
@ -24,7 +25,6 @@ import ghidra.trace.model.guest.*;
|
||||
import ghidra.trace.model.target.TraceObject;
|
||||
import ghidra.util.MathUtilities;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DefaultDebuggerPlatformMapper extends AbstractDebuggerPlatformMapper {
|
||||
|
||||
@ -57,7 +57,7 @@ public class DefaultDebuggerPlatformMapper extends AbstractDebuggerPlatformMappe
|
||||
public void addToTrace(long snap) {
|
||||
String description = "Add guest " + cSpec.getLanguage().getLanguageDescription() + "/" +
|
||||
cSpec.getCompilerSpecDescription();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, description)) {
|
||||
try (Transaction tx = trace.openTransaction(description)) {
|
||||
TracePlatformManager platformManager = trace.getPlatformManager();
|
||||
TracePlatform platform = platformManager.getOrAddPlatform(cSpec);
|
||||
if (platform.isHost()) {
|
||||
|
@ -18,9 +18,9 @@ package ghidra.app.plugin.core.debug.mapping;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class ObjectBasedDebuggerMemoryMapper implements DebuggerMemoryMapper {
|
||||
@ -77,8 +77,7 @@ public class ObjectBasedDebuggerMemoryMapper implements DebuggerMemoryMapper {
|
||||
}
|
||||
|
||||
protected AddressSpace createSpace(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Create space for mapping")) {
|
||||
try (Transaction tx = trace.openTransaction("Create space for mapping")) {
|
||||
AddressFactory factory = trace.getBaseAddressFactory();
|
||||
AddressSpace space = factory.getAddressSpace(name);
|
||||
if (space == null) {
|
||||
|
@ -17,15 +17,15 @@ package ghidra.app.plugin.core.debug.service.breakpoint;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.async.AsyncUtils;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public record DeleteEmuBreakpointActionItem(TraceBreakpoint bpt) implements BreakpointActionItem {
|
||||
@Override
|
||||
public CompletableFuture<Void> execute() {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(bpt.getTrace(), "Delete Emulated Breakpoint")) {
|
||||
try (Transaction tx =
|
||||
bpt.getTrace().openTransaction("Delete Emulated Breakpoint")) {
|
||||
String emuName = PlaceEmuBreakpointActionItem.createName(bpt.getMinAddress());
|
||||
if (bpt.getPath().contains(emuName)) {
|
||||
bpt.delete();
|
||||
|
@ -17,16 +17,16 @@ package ghidra.app.plugin.core.debug.service.breakpoint;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.async.AsyncUtils;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public record DisableEmuBreakpointActionItem(TraceBreakpoint bpt)
|
||||
implements BreakpointActionItem {
|
||||
@Override
|
||||
public CompletableFuture<Void> execute() {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(bpt.getTrace(), "Disable Emulated Breakpoint")) {
|
||||
try (Transaction tx =
|
||||
bpt.getTrace().openTransaction("Disable Emulated Breakpoint")) {
|
||||
bpt.setEmuEnabled(false);
|
||||
}
|
||||
return AsyncUtils.NIL;
|
||||
|
@ -17,15 +17,15 @@ package ghidra.app.plugin.core.debug.service.breakpoint;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.async.AsyncUtils;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public record EnableEmuBreakpointActionItem(TraceBreakpoint bpt) implements BreakpointActionItem {
|
||||
@Override
|
||||
public CompletableFuture<Void> execute() {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(bpt.getTrace(), "Enable Emulated Breakpoint")) {
|
||||
try (Transaction tx =
|
||||
bpt.getTrace().openTransaction("Enable Emulated Breakpoint")) {
|
||||
bpt.setEmuEnabled(true);
|
||||
}
|
||||
return AsyncUtils.NIL;
|
||||
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.service.breakpoint;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.async.AsyncUtils;
|
||||
import ghidra.dbg.target.TargetBreakpointSpec;
|
||||
import ghidra.dbg.target.TargetBreakpointSpecContainer;
|
||||
@ -30,7 +31,6 @@ import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.trace.model.memory.TraceMemoryRegion;
|
||||
import ghidra.trace.model.memory.TraceObjectMemoryRegion;
|
||||
import ghidra.trace.model.target.TraceObject;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public record PlaceEmuBreakpointActionItem(Trace trace, long snap, Address address, long length,
|
||||
@ -97,8 +97,7 @@ public record PlaceEmuBreakpointActionItem(Trace trace, long snap, Address addre
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> execute() {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Place Emulated Breakpoint")) {
|
||||
try (Transaction tx = trace.openTransaction("Place Emulated Breakpoint")) {
|
||||
// Defaults with emuEnable=true
|
||||
TraceBreakpoint bpt = trace.getBreakpointManager()
|
||||
.addBreakpoint(computePath(), Lifespan.at(snap), range(address, length),
|
||||
|
@ -19,6 +19,8 @@ import java.util.*;
|
||||
|
||||
import com.google.gson.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.services.LogicalBreakpoint;
|
||||
import ghidra.app.services.LogicalBreakpoint.ProgramMode;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.address.AddressSet;
|
||||
@ -27,7 +29,6 @@ import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind.TraceBreakpointKindSet;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@ -194,8 +195,7 @@ public class ProgramBreakpoint {
|
||||
}
|
||||
|
||||
private void writeProperties(Bookmark bookmark) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Rename breakpoint")) {
|
||||
try (Transaction tx = program.openTransaction("Rename breakpoint")) {
|
||||
bookmark.set(bookmark.getCategory(), computeComment());
|
||||
}
|
||||
catch (ConcurrentModificationException e) {
|
||||
@ -297,7 +297,7 @@ public class ProgramBreakpoint {
|
||||
// volatile reads
|
||||
Bookmark eBookmark = this.eBookmark;
|
||||
Bookmark dBookmark = this.dBookmark;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Clear breakpoint")) {
|
||||
try (Transaction tx = program.openTransaction("Clear breakpoint")) {
|
||||
BookmarkManager bookmarkManager = program.getBookmarkManager();
|
||||
if (eBookmark != null) {
|
||||
bookmarkManager.removeBookmark(eBookmark);
|
||||
@ -452,13 +452,12 @@ public class ProgramBreakpoint {
|
||||
*/
|
||||
public void toggleWithComment(boolean enabled, String comment) {
|
||||
String addType =
|
||||
enabled ? LogicalBreakpointInternal.BREAKPOINT_ENABLED_BOOKMARK_TYPE
|
||||
: LogicalBreakpointInternal.BREAKPOINT_DISABLED_BOOKMARK_TYPE;
|
||||
enabled ? LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE
|
||||
: LogicalBreakpoint.BREAKPOINT_DISABLED_BOOKMARK_TYPE;
|
||||
String delType =
|
||||
enabled ? LogicalBreakpointInternal.BREAKPOINT_DISABLED_BOOKMARK_TYPE
|
||||
: LogicalBreakpointInternal.BREAKPOINT_ENABLED_BOOKMARK_TYPE;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Enable breakpoint")) {
|
||||
enabled ? LogicalBreakpoint.BREAKPOINT_DISABLED_BOOKMARK_TYPE
|
||||
: LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE;
|
||||
try (Transaction tx = program.openTransaction("Toggle breakpoint")) {
|
||||
BookmarkManager manager = program.getBookmarkManager();
|
||||
String catStr = computeCategory();
|
||||
manager.setBookmark(address, addType, catStr, comment);
|
||||
|
@ -19,6 +19,7 @@ import java.util.*;
|
||||
|
||||
import com.google.common.collect.Collections2;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.LogicalBreakpoint.TraceMode;
|
||||
import ghidra.dbg.target.*;
|
||||
@ -30,7 +31,6 @@ import ghidra.program.model.address.AddressRange;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import utilities.util.IDHashed;
|
||||
|
||||
/**
|
||||
@ -218,7 +218,7 @@ class TraceBreakpointSet {
|
||||
*/
|
||||
public void setEmuSleigh(String emuSleigh) {
|
||||
this.emuSleigh = emuSleigh;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Set breakpoint Sleigh")) {
|
||||
try (Transaction tx = trace.openTransaction("Set breakpoint Sleigh")) {
|
||||
for (IDHashed<TraceBreakpoint> bpt : breakpoints) {
|
||||
bpt.obj.setEmuSleigh(emuSleigh);
|
||||
}
|
||||
@ -255,8 +255,7 @@ class TraceBreakpointSet {
|
||||
*/
|
||||
public boolean add(TraceBreakpoint bpt) {
|
||||
if (SleighUtils.UNCONDITIONAL_BREAK.equals(bpt.getEmuSleigh()) && emuSleigh != null) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Set breakpoint Sleigh")) {
|
||||
try (Transaction tx = trace.openTransaction("Set breakpoint Sleigh")) {
|
||||
bpt.setEmuSleigh(emuSleigh);
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import javax.swing.event.ChangeListener;
|
||||
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.ToggleDockingAction;
|
||||
@ -62,7 +63,6 @@ import ghidra.trace.model.time.schedule.Scheduler.RunResult;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.classfinder.ClassSearcher;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.ListenerSet;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.Task;
|
||||
@ -556,8 +556,7 @@ public class DebuggerEmulationServicePlugin extends Plugin implements DebuggerEm
|
||||
DebuggerCoordinates current = traceManager.getCurrent();
|
||||
Trace trace = current.getTrace();
|
||||
long version = trace.getEmulatorCacheVersion();
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Invalidate Emulator Cache")) {
|
||||
try (Transaction tx = trace.openTransaction("Invalidate Emulator Cache")) {
|
||||
trace.setEmulatorCacheVersion(version + 1);
|
||||
}
|
||||
// NB. Success should already display on screen, since it's current.
|
||||
@ -750,7 +749,7 @@ public class DebuggerEmulationServicePlugin extends Plugin implements DebuggerEm
|
||||
}
|
||||
|
||||
protected TraceSnapshot writeToScratch(CacheKey key, CachedEmulator ce) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(key.trace, "Emulate")) {
|
||||
try (Transaction tx = key.trace.openTransaction("Emulate")) {
|
||||
TraceSnapshot destSnap = findScratch(key.trace, key.time);
|
||||
try {
|
||||
ce.emulator().writeDown(key.platform, destSnap.getKey(), key.time.getSnap());
|
||||
@ -794,7 +793,7 @@ public class DebuggerEmulationServicePlugin extends Plugin implements DebuggerEm
|
||||
// Cause object-register support to copy values into new register spaces
|
||||
// TODO: I wish this were not necessary
|
||||
monitor.setMessage("Creating register spaces");
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Prepare emulation")) {
|
||||
try (Transaction tx = trace.openTransaction("Prepare emulation")) {
|
||||
for (TraceThread thread : time.getThreads(trace)) {
|
||||
trace.getMemoryManager().getMemoryRegisterSpace(thread, 0, true);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.modules.DebuggerStaticMappingUtils;
|
||||
import ghidra.app.plugin.core.debug.service.modules.DebuggerStaticMappingUtils.Extrema;
|
||||
import ghidra.app.services.DebuggerEmulationService;
|
||||
@ -44,7 +45,6 @@ import ghidra.trace.model.thread.*;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.DifferenceAddressSetView;
|
||||
import ghidra.util.NumericUtilities;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
@ -339,7 +339,7 @@ public enum ProgramEmulationUtils {
|
||||
boolean success = false;
|
||||
try {
|
||||
trace = new DBTrace(getTraceName(program), program.getCompilerSpec(), consumer);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate")) {
|
||||
try (Transaction tx = trace.openTransaction("Emulate")) {
|
||||
TraceSnapshot initial =
|
||||
trace.getTimeManager().createSnapshot(EMULATION_STARTED_AT + pc);
|
||||
long snap = initial.getKey();
|
||||
@ -383,8 +383,7 @@ 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")) {
|
||||
try (Transaction tx = trace.openTransaction("Emulate new Thread")) {
|
||||
TraceThread thread = doLaunchEmulationThread(trace, snap, program, tracePc, programPc);
|
||||
return thread;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.builder.MultiStateActionBuilder;
|
||||
@ -58,7 +59,6 @@ import ghidra.program.model.util.StringPropertyMap;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.CollectionChangeListener;
|
||||
import ghidra.util.datastruct.ListenerSet;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
@ -305,7 +305,7 @@ public class DebuggerModelServiceProxyPlugin extends Plugin
|
||||
|
||||
protected void writeMostRecentLaunches(Program program, List<String> mrl) {
|
||||
ProgramUserData userData = program.getProgramUserData();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(userData)) {
|
||||
try (Transaction tid = userData.openTransaction()) {
|
||||
StringPropertyMap prop = userData
|
||||
.getStringProperty(getName(), KEY_MOST_RECENT_LAUNCHES, true);
|
||||
Address min = program.getAddressFactory().getDefaultAddressSpace().getMinAddress();
|
||||
|
@ -15,27 +15,27 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.service.model;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.framework.model.UndoableDomainObject;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class RecorderPermanentTransaction implements AutoCloseable {
|
||||
|
||||
public static RecorderPermanentTransaction start(UndoableDomainObject obj, String description) {
|
||||
UndoableTransaction tid = UndoableTransaction.start(obj, description);
|
||||
return new RecorderPermanentTransaction(obj, tid);
|
||||
Transaction tx = obj.openTransaction(description);
|
||||
return new RecorderPermanentTransaction(obj, tx);
|
||||
}
|
||||
|
||||
private final UndoableDomainObject obj;
|
||||
private final UndoableTransaction tid;
|
||||
private final Transaction tx;
|
||||
|
||||
public RecorderPermanentTransaction(UndoableDomainObject obj, UndoableTransaction tid) {
|
||||
public RecorderPermanentTransaction(UndoableDomainObject obj, Transaction tx) {
|
||||
this.obj = obj;
|
||||
this.tid = tid;
|
||||
this.tx = tx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
tid.close();
|
||||
tx.close();
|
||||
obj.clearUndo();
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.mapping.*;
|
||||
import ghidra.app.plugin.core.debug.service.model.interfaces.*;
|
||||
import ghidra.app.services.TraceRecorder;
|
||||
@ -38,7 +39,6 @@ import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.trace.model.modules.TraceSection;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.ListenerSet;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
@ -254,8 +254,8 @@ public class TraceObjectManager {
|
||||
ManagedThreadRecorder threadRecorder = recorder.getThreadRecorder((TargetThread) added);
|
||||
TraceThread traceThread = threadRecorder.getTraceThread();
|
||||
recorder.createSnapshot(traceThread + " started", traceThread, null);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(recorder.getTrace(), "Adjust thread creation")) {
|
||||
try (Transaction tx =
|
||||
recorder.getTrace().openTransaction("Adjust thread creation")) {
|
||||
long existing = traceThread.getCreationSnap();
|
||||
if (existing == Long.MIN_VALUE) {
|
||||
traceThread.setCreationSnap(recorder.getSnap());
|
||||
@ -546,8 +546,7 @@ public class TraceObjectManager {
|
||||
ManagedThreadRecorder rec = recorder.getThreadRecorderForSuccessor(thread);
|
||||
if (rec != null) {
|
||||
String name = (String) added.get(TargetObject.DISPLAY_ATTRIBUTE_NAME);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(rec.getTrace(), "Rename thread")) {
|
||||
try (Transaction tx = rec.getTrace().openTransaction("Rename thread")) {
|
||||
rec.getTraceThread().setName(name);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.service.model.launch;
|
||||
|
||||
import static ghidra.async.AsyncUtils.loop;
|
||||
import static ghidra.async.AsyncUtils.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
@ -29,6 +29,7 @@ import javax.swing.JOptionPane;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerMethodInvocationDialog;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.DebuggerTraceManagerService.ActivationCause;
|
||||
@ -53,7 +54,6 @@ import ghidra.trace.model.TraceLocation;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.CollectionChangeListener;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@ -243,7 +243,7 @@ public abstract class AbstractDebuggerProgramLaunchOffer implements DebuggerProg
|
||||
}
|
||||
if (program != null) {
|
||||
ProgramUserData userData = program.getProgramUserData();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(userData)) {
|
||||
try (Transaction tx = userData.openTransaction()) {
|
||||
Element element = state.saveToXml();
|
||||
userData.setStringProperty(TargetCmdLineLauncher.CMDLINE_ARGS_NAME,
|
||||
XmlUtilities.toString(element));
|
||||
|
@ -21,6 +21,7 @@ import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.mapping.*;
|
||||
import ghidra.app.plugin.core.debug.service.model.DebuggerModelServicePlugin;
|
||||
import ghidra.app.plugin.core.debug.service.model.PermanentTransactionExecutor;
|
||||
@ -56,7 +57,6 @@ import ghidra.trace.model.thread.TraceObjectThread;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.ListenerSet;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@ -193,8 +193,7 @@ public class ObjectBasedTraceRecorder implements TraceRecorder {
|
||||
long snap = timeRecorder.getSnap();
|
||||
String path = object.getJoinedPath(".");
|
||||
// Don't offload, because we need a consistent map
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Object created: " + path)) {
|
||||
try (Transaction trans = trace.openTransaction("Object created: " + path)) {
|
||||
objectRecorder.recordCreated(snap, object);
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import org.apache.commons.collections4.bidimap.DualHashBidiMap;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.dbg.DebuggerObjectModel;
|
||||
import ghidra.dbg.attributes.TargetDataType;
|
||||
import ghidra.dbg.target.*;
|
||||
@ -45,7 +46,6 @@ import ghidra.trace.model.target.*;
|
||||
import ghidra.trace.model.thread.TraceObjectThread;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import utilities.util.IDKeyed;
|
||||
|
||||
class ObjectRecorder {
|
||||
@ -64,8 +64,7 @@ class ObjectRecorder {
|
||||
this.isSupportsFocus = !schema.searchFor(TargetFocusScope.class, false).isEmpty();
|
||||
this.isSupportsActivation = !schema.searchFor(TargetActiveScope.class, false).isEmpty();
|
||||
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(recorder.trace, "Create root")) {
|
||||
try (Transaction tx = recorder.trace.openTransaction("Create root")) {
|
||||
objectManager.createRootObject(schema);
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.events.ProgramClosedPluginEvent;
|
||||
import ghidra.app.events.ProgramOpenedPluginEvent;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
@ -53,7 +54,6 @@ import ghidra.trace.model.memory.TraceMemoryRegion;
|
||||
import ghidra.trace.model.modules.*;
|
||||
import ghidra.trace.model.program.TraceProgramView;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.ListenerSet;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@ -733,8 +733,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
@Override
|
||||
public void addMapping(TraceLocation from, ProgramLocation to, long length,
|
||||
boolean truncateExisting) throws TraceConflictedMappingException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(from.getTrace(), "Add mapping")) {
|
||||
try (Transaction tx = from.getTrace().openTransaction("Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(from, to, length, truncateExisting);
|
||||
}
|
||||
}
|
||||
@ -742,8 +741,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
@Override
|
||||
public void addMapping(MapEntry<?, ?> entry, boolean truncateExisting)
|
||||
throws TraceConflictedMappingException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(entry.getFromTrace(), "Add mapping")) {
|
||||
try (Transaction tx = entry.getFromTrace().openTransaction("Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(entry, truncateExisting);
|
||||
}
|
||||
}
|
||||
@ -755,7 +753,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)) {
|
||||
try (Transaction tx = trace.openTransaction(description)) {
|
||||
doAddMappings(trace, ent.getValue(), monitor, truncateExisting);
|
||||
}
|
||||
}
|
||||
@ -778,8 +776,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
@Override
|
||||
public void addIdentityMapping(Trace from, Program toProgram, Lifespan lifespan,
|
||||
boolean truncateExisting) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(from, "Add identity mappings")) {
|
||||
try (Transaction tx = from.openTransaction("Add identity mappings")) {
|
||||
DebuggerStaticMappingUtils.addIdentityMapping(from, toProgram, lifespan,
|
||||
truncateExisting);
|
||||
}
|
||||
@ -798,8 +795,8 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
for (Map.Entry<Program, List<ModuleMapEntry>> ent : entriesByProgram.entrySet()) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(ent.getKey(), "Memorize module mapping")) {
|
||||
try (Transaction tx =
|
||||
ent.getKey().openTransaction("Memorize module mapping")) {
|
||||
for (ModuleMapEntry entry : ent.getValue()) {
|
||||
ProgramModuleIndexer.addModulePaths(entry.getToProgram(),
|
||||
List.of(entry.getModule().getName()));
|
||||
|
@ -161,13 +161,13 @@ public class DebuggerTraceManagerServicePlugin extends Plugin
|
||||
public TransactionEndFuture(Trace trace) {
|
||||
this.trace = trace;
|
||||
this.trace.addTransactionListener(this);
|
||||
if (this.trace.getCurrentTransaction() == null) {
|
||||
if (this.trace.getCurrentTransactionInfo() == null) {
|
||||
complete(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transactionStarted(DomainObjectAdapterDB domainObj, Transaction tx) {
|
||||
public void transactionStarted(DomainObjectAdapterDB domainObj, TransactionInfo tx) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.DockingWindowManager;
|
||||
import docking.Tool;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerPlatformMapper;
|
||||
@ -33,7 +34,8 @@ import ghidra.framework.model.DomainObject;
|
||||
import ghidra.framework.options.annotation.HelpInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.program.model.data.PointerTypedef;
|
||||
import ghidra.program.model.data.VoidDataType;
|
||||
import ghidra.program.model.lang.Register;
|
||||
import ghidra.program.model.util.CodeUnitInsertionException;
|
||||
import ghidra.trace.model.*;
|
||||
@ -49,7 +51,6 @@ import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.util.*;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.classfinder.ClassSearcher;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@DebuggerBotInfo( //
|
||||
@ -222,8 +223,8 @@ public class DisassembleAtPcDebuggerBot implements DebuggerBot {
|
||||
return;
|
||||
}
|
||||
TraceData pcUnit = null;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Disassemble: PC is code pointer")) {
|
||||
try (Transaction tx =
|
||||
trace.openTransaction("Disassemble: PC is code pointer")) {
|
||||
TraceCodeSpace regCode = codeManager.getCodeRegisterSpace(thread, frameLevel, true);
|
||||
// TODO: Should be same platform as pc, not necessarily base
|
||||
AddressSpace space = trace.getBaseAddressFactory().getDefaultAddressSpace();
|
||||
|
@ -22,6 +22,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.services.DebuggerTraceManagerService.ActivationCause;
|
||||
@ -41,7 +42,6 @@ import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.PatchStep;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.trace.util.TraceRegisterUtils;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@ -214,8 +214,7 @@ public enum ControlMode {
|
||||
}
|
||||
TraceMemoryOperations memOrRegs;
|
||||
Address overlayAddress;
|
||||
try (UndoableTransaction txid =
|
||||
UndoableTransaction.start(trace, "Edit Variable")) {
|
||||
try (Transaction tx = trace.openTransaction("Edit Variable")) {
|
||||
if (hostAddress.isRegisterAddress()) {
|
||||
TraceThread thread = coordinates.getThread();
|
||||
if (thread == null) {
|
||||
|
@ -21,6 +21,7 @@ import java.util.Set;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest.TestDebuggerTargetTraceMapper;
|
||||
@ -42,7 +43,6 @@ import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
@ -98,7 +98,7 @@ public class DebuggerBreakpointMarkerPluginScreenShots extends GhidraScreenShotG
|
||||
.getRootFolder()
|
||||
.createFile("WinHelloCPP", program, TaskMonitor.DUMMY);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add Mapping")) {
|
||||
try (Transaction tx = trace.openTransaction("Add Mapping")) {
|
||||
mappingService.addIdentityMapping(trace, program, Lifespan.nowOn(0), true);
|
||||
}
|
||||
waitForValue(() -> mappingService.getOpenMappedLocation(
|
||||
@ -148,7 +148,7 @@ public class DebuggerBreakpointMarkerPluginScreenShots extends GhidraScreenShotG
|
||||
.getRootFolder()
|
||||
.createFile("WinHelloCPP", program, TaskMonitor.DUMMY);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add Mapping")) {
|
||||
try (Transaction tx = trace.openTransaction("Add Mapping")) {
|
||||
mappingService.addIdentityMapping(trace, program, Lifespan.nowOn(0), true);
|
||||
}
|
||||
waitForValue(() -> mappingService.getOpenMappedLocation(
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.breakpoint;
|
||||
|
||||
import static ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest.waitForPass;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest.TestDebuggerTargetTraceMapper;
|
||||
import ghidra.app.plugin.core.debug.service.breakpoint.DebuggerLogicalBreakpointServicePlugin;
|
||||
@ -44,7 +44,6 @@ import ghidra.test.ToyProgramBuilder;
|
||||
import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
@ -127,19 +126,19 @@ 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")) {
|
||||
try (Transaction tx = trace1.openTransaction("Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace1, null, Lifespan.nowOn(0), addr(trace1, 0x00400000)),
|
||||
new ProgramLocation(program, addr(program, 0x00400000)), 0x00210000, false);
|
||||
}
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace3, "Add mapping")) {
|
||||
try (Transaction tx = trace3.openTransaction("Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace3, null, Lifespan.nowOn(0), addr(trace3, 0x7fac0000)),
|
||||
new ProgramLocation(program, addr(program, 0x00400000)), 0x00010000, false);
|
||||
}
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add breakpoint")) {
|
||||
try (Transaction tx = program.openTransaction("Add breakpoint")) {
|
||||
program.getBookmarkManager()
|
||||
.setBookmark(addr(program, 0x00401234),
|
||||
LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE, "SW_EXECUTE;1",
|
||||
|
@ -19,6 +19,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest.TestDebuggerTargetTraceMapper;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingProvider;
|
||||
@ -40,7 +41,6 @@ import ghidra.trace.model.DefaultTraceLocation;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
@ -87,7 +87,7 @@ public class DebuggerCopyActionsPluginScreenShots extends GhidraScreenShotGenera
|
||||
@Test
|
||||
public void testCaptureDebuggerCopyIntoProgramDialog() throws Throwable {
|
||||
long snap;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
DBTraceMemoryManager mem = tb.trace.getMemoryManager();
|
||||
mem.createRegion(".text", snap, tb.range(0x55550000, 0x5555ffff),
|
||||
@ -110,7 +110,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")) {
|
||||
try (Transaction tx = program.openTransaction("Add memory")) {
|
||||
program.setImageBase(tb.addr(stSpace, 0x00400000), true);
|
||||
Memory memory = program.getMemory();
|
||||
memory.createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000, (byte) 0,
|
||||
@ -123,7 +123,7 @@ public class DebuggerCopyActionsPluginScreenShots extends GhidraScreenShotGenera
|
||||
root.createFile(tb.trace.getName(), tb.trace, TaskMonitor.DUMMY);
|
||||
root.createFile(program.getName(), program, TaskMonitor.DUMMY);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingService.addMapping(
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(snap), tb.addr(0x55550000)),
|
||||
new ProgramLocation(program, tb.addr(stSpace, 0x00400000)), 0x10000, true);
|
||||
|
@ -15,13 +15,14 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.diff;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingProvider;
|
||||
import ghidra.app.plugin.core.debug.gui.time.DebuggerTimeSelectionDialog;
|
||||
@ -36,7 +37,6 @@ import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerTraceViewDiffPluginScreenShots extends GhidraScreenShotGenerator
|
||||
@ -66,7 +66,7 @@ public class DebuggerTraceViewDiffPluginScreenShots extends GhidraScreenShotGene
|
||||
@Test
|
||||
public void testCaptureDebuggerTraceViewDiffPlugin() throws Throwable {
|
||||
long snap1, snap2;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceTimeManager tm = tb.trace.getTimeManager();
|
||||
snap1 = tm.createSnapshot("Baseline").getKey();
|
||||
snap2 = tm.createSnapshot("X's first move").getKey();
|
||||
@ -106,7 +106,7 @@ public class DebuggerTraceViewDiffPluginScreenShots extends GhidraScreenShotGene
|
||||
@Test
|
||||
public void testCaptureDebuggerTimeSelectionDialog() throws Throwable {
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceTimeManager tm = tb.trace.getTimeManager();
|
||||
thread = tb.getOrAddThread("main", 0);
|
||||
tm.createSnapshot("Break on main").setEventThread(thread);
|
||||
|
@ -19,6 +19,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.assembler.Assembler;
|
||||
import ghidra.app.plugin.assembler.Assemblers;
|
||||
import ghidra.app.plugin.core.debug.gui.action.DebuggerGoToDialog;
|
||||
@ -33,7 +34,6 @@ import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.symbol.*;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerListingPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -59,7 +59,7 @@ public class DebuggerListingPluginScreenShots extends GhidraScreenShotGenerator
|
||||
|
||||
@Test
|
||||
public void testCaptureDebuggerListingPlugin() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion(".text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
@ -123,7 +123,7 @@ public class DebuggerListingPluginScreenShots extends GhidraScreenShotGenerator
|
||||
|
||||
@Test
|
||||
public void testCaptureDebuggerGoToDialog() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("bash:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
|
@ -19,6 +19,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.assembler.Assembler;
|
||||
import ghidra.app.plugin.assembler.Assemblers;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin;
|
||||
@ -33,7 +34,6 @@ import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.symbol.*;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerMemoryBytesPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -63,7 +63,7 @@ public class DebuggerMemoryBytesPluginScreenShots extends GhidraScreenShotGenera
|
||||
|
||||
@Test
|
||||
public void testCaptureDebuggerMemoryBytesPlugin() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion(".text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
|
@ -19,6 +19,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
@ -32,7 +33,6 @@ import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.database.memory.DBTraceMemoryManager;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
@ -74,7 +74,7 @@ public class DebuggerRegionsPluginScreenShots extends GhidraScreenShotGenerator
|
||||
}
|
||||
|
||||
private void populateTrace() throws Exception {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
|
||||
long snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
|
||||
@ -102,7 +102,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")) {
|
||||
try (Transaction tx = progBash.openTransaction("Add memory")) {
|
||||
progBash.setImageBase(addr(progBash, 0x00400000), true);
|
||||
progBash.getMemory()
|
||||
.createInitializedBlock(".text", addr(progBash, 0x00400000), 0x10000, (byte) 0,
|
||||
@ -112,7 +112,7 @@ public class DebuggerRegionsPluginScreenShots extends GhidraScreenShotGenerator
|
||||
TaskMonitor.DUMMY, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory")) {
|
||||
try (Transaction tx = progLibC.openTransaction("Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
@ -20,6 +20,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
@ -31,7 +32,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerMemviewPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -78,13 +78,13 @@ public class DebuggerMemviewPluginScreenShots extends GhidraScreenShotGenerator
|
||||
private void populateTraceAndPrograms() throws Exception {
|
||||
tool.getProject().getProjectData().getRootFolder();
|
||||
TraceThread thread1;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread1 = tb.trace.getThreadManager().addThread("[0]", Lifespan.span(1, 40));
|
||||
tb.trace.getThreadManager().addThread("[1]", Lifespan.span(4, 50));
|
||||
tb.trace.getThreadManager().addThread("[2]", Lifespan.span(6, 20));
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getModuleManager()
|
||||
.addLoadedModule("/bin/bash", "/bin/bash", tb.range(0x00400000, 0x0060ffff), 0);
|
||||
tb.trace.getModuleManager()
|
||||
@ -92,7 +92,7 @@ public class DebuggerMemviewPluginScreenShots extends GhidraScreenShotGenerator
|
||||
tb.range(0x7fac0000, 0x7faeffff), 10);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("bash.text", Lifespan.nowOn(5), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.EXECUTE);
|
||||
@ -108,7 +108,7 @@ public class DebuggerMemviewPluginScreenShots extends GhidraScreenShotGenerator
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.WRITE);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
Set<TraceThread> threads = new HashSet<TraceThread>();
|
||||
Set<TraceBreakpointKind> kinds = new HashSet<TraceBreakpointKind>();
|
||||
threads.add(thread1);
|
||||
|
@ -19,6 +19,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
@ -30,7 +31,6 @@ import ghidra.program.model.listing.Program;
|
||||
import ghidra.test.ToyProgramBuilder;
|
||||
import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
@ -69,7 +69,7 @@ public class DebuggerModulesPluginScreenShots extends GhidraScreenShotGenerator
|
||||
|
||||
@Test
|
||||
public void testCaptureDebuggerModulesPlugin() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
|
||||
TraceModule bin = tb.trace.getModuleManager()
|
||||
@ -96,7 +96,7 @@ public class DebuggerModulesPluginScreenShots extends GhidraScreenShotGenerator
|
||||
|
||||
private void populateTraceAndPrograms() throws Exception {
|
||||
DomainFolder root = tool.getProject().getProjectData().getRootFolder();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
|
||||
TraceModule bin = tb.trace.getModuleManager()
|
||||
@ -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")) {
|
||||
try (Transaction tx = progBash.openTransaction("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")) {
|
||||
try (Transaction tx = progLibC.openTransaction("Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
@ -19,6 +19,7 @@ import java.util.*;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.modules.DebuggerStaticMappingServicePlugin;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin;
|
||||
@ -31,7 +32,6 @@ import ghidra.program.model.listing.Program;
|
||||
import ghidra.test.ToyProgramBuilder;
|
||||
import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
@ -76,7 +76,7 @@ public class DebuggerStaticMappingPluginScreenShots extends GhidraScreenShotGene
|
||||
@Test
|
||||
public void testCaptureDebuggerStaticMappingPlugin() throws Throwable {
|
||||
DomainFolder root = tool.getProject().getProjectData().getRootFolder();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
|
||||
TraceModule bin = tb.trace.getModuleManager()
|
||||
@ -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")) {
|
||||
try (Transaction tx = progEcho.openTransaction("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")) {
|
||||
try (Transaction tx = progLibC.openTransaction("Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
@ -124,7 +124,7 @@ public class DebuggerStaticMappingPluginScreenShots extends GhidraScreenShotGene
|
||||
programManager.openProgram(progEcho);
|
||||
programManager.openProgram(progLibC);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
Map<TraceModule, ModuleMapProposal> proposal =
|
||||
mappingService.proposeModuleMaps(tb.trace.getModuleManager().getAllModules(),
|
||||
List.of(programManager.getAllOpenPrograms()));
|
||||
|
@ -17,6 +17,7 @@ package ghidra.app.plugin.core.debug.gui.pcode;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.assembler.Assembler;
|
||||
import ghidra.app.plugin.assembler.Assemblers;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
@ -29,7 +30,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerPcodeStepperPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -56,7 +56,7 @@ public class DebuggerPcodeStepperPluginScreenShots extends GhidraScreenShotGener
|
||||
|
||||
@Test
|
||||
public void testCaptureDebuggerPcodeStepperPlugin() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap0 = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
|
||||
tb.trace.getMemoryManager()
|
||||
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.gui.platform;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
import ghidra.dbg.target.schema.SchemaContext;
|
||||
@ -25,7 +26,6 @@ import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName;
|
||||
import ghidra.dbg.target.schema.XmlSchemaContext;
|
||||
import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.database.target.DBTraceObjectManagerTest;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerPlatformPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -43,7 +43,7 @@ public class DebuggerPlatformPluginScreenShots extends GhidraScreenShotGenerator
|
||||
public void testCaptureDebuggerSelectPlatformOfferDialog() throws Throwable {
|
||||
SchemaContext ctx = XmlSchemaContext.deserialize(DBTraceObjectManagerTest.XML_CTX);
|
||||
try (ToyDBTraceBuilder tb = new ToyDBTraceBuilder("echo", "DATA:BE:64:default")) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getObjectManager()
|
||||
.createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import java.math.BigInteger;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
import ghidra.program.model.data.PointerDataType;
|
||||
@ -29,7 +30,6 @@ import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerRegistersPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -56,7 +56,7 @@ public class DebuggerRegistersPluginScreenShots extends GhidraScreenShotGenerato
|
||||
|
||||
@Test
|
||||
public void testCaptureDebuggerRegistersPlugin() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap0 = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
long snap1 = tb.trace.getTimeManager().createSnapshot("Second").getKey();
|
||||
|
||||
@ -106,7 +106,7 @@ public class DebuggerRegistersPluginScreenShots extends GhidraScreenShotGenerato
|
||||
|
||||
@Test
|
||||
public void testCaptureDebuggerAvailableRegistersDialog() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
long snap0 = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
TraceThread thread = tb.getOrAddThread("[1]", snap0);
|
||||
|
||||
|
@ -22,6 +22,7 @@ import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.assembler.*;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
@ -37,8 +38,8 @@ import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerService
|
||||
import ghidra.app.plugin.core.debug.stack.*;
|
||||
import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.DebuggerEmulationService.EmulationResult;
|
||||
import ghidra.app.services.DebuggerControlService.StateEditor;
|
||||
import ghidra.app.services.DebuggerEmulationService.EmulationResult;
|
||||
import ghidra.async.AsyncTestUtils;
|
||||
import ghidra.framework.model.DomainFolder;
|
||||
import ghidra.framework.model.DomainObject;
|
||||
@ -63,7 +64,6 @@ import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.Scheduler;
|
||||
import ghidra.util.InvalidNameException;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.ConsoleTaskMonitor;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@ -113,7 +113,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")) {
|
||||
try (Transaction tx = program.openTransaction("Populate")) {
|
||||
program.setImageBase(addr(program, 0x00400000), true);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x10000, (byte) 0,
|
||||
@ -128,7 +128,7 @@ public class DebuggerStackPluginScreenShots extends GhidraScreenShotGenerator
|
||||
}
|
||||
long snap;
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
snap = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
thread = tb.getOrAddThread("[1]", snap);
|
||||
TraceStack stack = tb.trace.getStackManager().getStack(thread, snap, true);
|
||||
@ -144,7 +144,7 @@ public class DebuggerStackPluginScreenShots extends GhidraScreenShotGenerator
|
||||
}
|
||||
root.createFile("trace", tb.trace, TaskMonitor.DUMMY);
|
||||
root.createFile("echo", program, TaskMonitor.DUMMY);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(snap), tb.addr(0x00400000)),
|
||||
new ProgramLocation(program, addr(program, 0x00400000)), 0x10000, false);
|
||||
@ -205,7 +205,7 @@ public class DebuggerStackPluginScreenShots extends GhidraScreenShotGenerator
|
||||
protected Function createFibonacciProgramX86_32() throws Throwable {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
Address entry = addr(program, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
|
||||
@ -307,7 +307,7 @@ public class DebuggerStackPluginScreenShots extends GhidraScreenShotGenerator
|
||||
waitOn(frameAtSetup.setReturnAddress(editor, tb.addr(0xdeadbeef)));
|
||||
waitForTasks();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
|
||||
Set.of(),
|
||||
@ -321,7 +321,7 @@ public class DebuggerStackPluginScreenShots extends GhidraScreenShotGenerator
|
||||
traceManager.activateTime(result.schedule());
|
||||
waitForTasks();
|
||||
DebuggerCoordinates tallest = traceManager.getCurrent();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
new UnwindStackCommand(tool, tallest).applyTo(tb.trace, monitor);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
@ -25,6 +25,7 @@ import java.util.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||
import generic.Unique;
|
||||
@ -44,8 +45,8 @@ import ghidra.app.plugin.core.debug.stack.StackUnwinderTest.HoverLocation;
|
||||
import ghidra.app.plugin.core.decompile.DecompilerProvider;
|
||||
import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.DebuggerEmulationService.EmulationResult;
|
||||
import ghidra.app.services.DebuggerControlService.StateEditor;
|
||||
import ghidra.app.services.DebuggerEmulationService.EmulationResult;
|
||||
import ghidra.app.util.viewer.listingpanel.ListingPanel;
|
||||
import ghidra.async.AsyncTestUtils;
|
||||
import ghidra.framework.model.DomainFolder;
|
||||
@ -70,7 +71,6 @@ import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.Scheduler;
|
||||
import ghidra.util.InvalidNameException;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.ConsoleTaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
@ -138,7 +138,7 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
|
||||
protected Function createFibonacciProgramX86_32() throws Throwable {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
Address entry = addr(program, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
|
||||
@ -244,7 +244,7 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
|
||||
traceManager.activateThread(thread);
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
MemoryBlock block = program.getMemory().getBlock(".text");
|
||||
byte[] text = new byte[(int) block.getSize()];
|
||||
block.getBytes(block.getStart(), text);
|
||||
@ -269,7 +269,7 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
|
||||
waitOn(frameAtSetup.setReturnAddress(editor, tb.addr(0xdeadbeef)));
|
||||
waitForTasks();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
|
||||
Set.of(),
|
||||
@ -283,7 +283,7 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
|
||||
traceManager.activateTime(result.schedule());
|
||||
waitForTasks();
|
||||
DebuggerCoordinates tallest = traceManager.getCurrent();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
new UnwindStackCommand(tool, tallest).applyTo(tb.trace, monitor);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.gui.thread;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest.TestDebuggerTargetTraceMapper;
|
||||
import ghidra.app.plugin.core.debug.service.model.DebuggerModelServiceProxyPlugin;
|
||||
@ -26,7 +27,6 @@ import ghidra.app.services.*;
|
||||
import ghidra.dbg.model.*;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerThreadsPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -72,7 +72,7 @@ public class DebuggerThreadsPluginScreenShots extends GhidraScreenShotGenerator
|
||||
waitForValue(() -> recorder.getTraceThread(handler2Thread));
|
||||
AbstractGhidraHeadedDebuggerGUITest.waitForDomainObject(trace);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Comments")) {
|
||||
try (Transaction tx = trace.openTransaction("Comments")) {
|
||||
recorder.getTraceThread(mainThread).setComment("GUI main loop");
|
||||
recorder.getTraceThread(serverThread).setComment("Server");
|
||||
recorder.getTraceThread(handler1Thread).setComment("Handler 1");
|
||||
|
@ -17,6 +17,7 @@ package ghidra.app.plugin.core.debug.gui.time;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
import ghidra.test.ToyProgramBuilder;
|
||||
@ -24,7 +25,6 @@ import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerTimePluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -52,7 +52,7 @@ public class DebuggerTimePluginScreenShots extends GhidraScreenShotGenerator {
|
||||
public void testCaptureDebuggerTimePlugin() throws Throwable {
|
||||
long fakeClock = (long) Integer.MAX_VALUE * 1000;
|
||||
TraceSnapshot snap;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
snap = tb.trace.getTimeManager().createSnapshot("Trace started");
|
||||
snap.setRealTime(fakeClock);
|
||||
|
||||
|
@ -17,6 +17,7 @@ package ghidra.app.plugin.core.debug.gui.watch;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
import ghidra.pcode.exec.PcodeExecutor;
|
||||
@ -27,7 +28,6 @@ import ghidra.program.model.symbol.SourceType;
|
||||
import ghidra.test.ToyProgramBuilder;
|
||||
import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerWatchesPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@ -56,7 +56,7 @@ public class DebuggerWatchesPluginScreenShots extends GhidraScreenShotGenerator
|
||||
public void testCaptureDebuggerWatchesPlugin() throws Throwable {
|
||||
TraceThread thread;
|
||||
long snap0, snap1;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
snap0 = tb.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
snap1 = tb.trace.getTimeManager().createSnapshot("Second").getKey();
|
||||
|
||||
|
@ -27,6 +27,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.action.DockingActionIf;
|
||||
import generic.Unique;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
@ -66,7 +67,6 @@ import ghidra.trace.model.target.TraceObject.ConflictResolution;
|
||||
import ghidra.trace.model.target.TraceObjectKeyPath;
|
||||
import ghidra.trace.model.thread.TraceObjectThread;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -150,7 +150,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
createAndOpenTrace("DATA:BE:64:default");
|
||||
|
||||
DBTraceObjectManager objects = tb.trace.getObjectManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
objects.createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
DBTraceObject env =
|
||||
objects.createObject(TraceObjectKeyPath.parse("Targets[0].Environment"));
|
||||
@ -190,7 +190,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
Supplier<ByteBuffer> byteSupplier) throws Throwable {
|
||||
createAndOpenTrace(langID);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion("Memory[bin:.text]", 0, tb.range(offset, offset + 0xffff),
|
||||
Set.of(TraceMemoryFlag.EXECUTE));
|
||||
@ -221,7 +221,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
|
||||
// Fabricate the cpsr so that ARM is used. Otherwise, it will assume Cortex-M, so THUMB
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
DBTraceMemorySpace regs =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
@ -255,7 +255,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
|
||||
// Fabricate the cpsr so that THUMB is used, even though we could omit as in Cortex-M
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
DBTraceMemorySpace regs =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
@ -414,7 +414,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
// Ensure the mapper is added to the trace
|
||||
assertNotNull(platformService.getMapper(tb.trace, null, 0));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.addInstruction(0, start, tb.host);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -446,7 +446,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
// Ensure the mapper is added to the trace
|
||||
assertNotNull(platformService.getMapper(tb.trace, null, 0));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceDisassembleCommand dis = new TraceDisassembleCommand(tb.host, start,
|
||||
new AddressSet(start, start.addWrap(1)));
|
||||
dis.setInitialContext(DebuggerDisassemblerPlugin.deriveAlternativeDefaultContext(
|
||||
@ -484,7 +484,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
|
||||
TraceGuestPlatform guest =
|
||||
Unique.assertOne(tb.trace.getPlatformManager().getGuestPlatforms());
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.addInstruction(0, start, guest);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -519,7 +519,7 @@ public class DebuggerDisassemblyTest extends AbstractGhidraHeadedDebuggerGUITest
|
||||
waitForPass(() -> Unique.assertOne(tb.trace.getPlatformManager().getGuestPlatforms()));
|
||||
TraceGuestPlatform guest =
|
||||
Unique.assertOne(tb.trace.getPlatformManager().getGuestPlatforms());
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceDisassembleCommand dis = new TraceDisassembleCommand(guest, start,
|
||||
new AddressSet(start, start.addWrap(1)));
|
||||
dis.setInitialContext(DebuggerDisassemblerPlugin.deriveAlternativeDefaultContext(
|
||||
|
@ -37,6 +37,7 @@ import org.junit.rules.TestName;
|
||||
import org.junit.rules.TestWatcher;
|
||||
import org.junit.runner.Description;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.action.ActionContextProvider;
|
||||
import docking.action.DockingActionIf;
|
||||
@ -75,7 +76,6 @@ import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.util.TraceAddressSpace;
|
||||
import ghidra.util.InvalidNameException;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.ListenerMap;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.ConsoleTaskMonitor;
|
||||
@ -702,7 +702,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
}
|
||||
|
||||
protected void addSnapshot(String desc) throws IOException {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getTimeManager().createSnapshot(desc);
|
||||
}
|
||||
}
|
||||
@ -773,8 +773,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
Language lang = getToyBE64Language();
|
||||
program = new ProgramDB("static-" + name.getMethodName(), lang,
|
||||
lang.getDefaultCompilerSpec(), this);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Set Executable Path")) {
|
||||
try (Transaction tx = program.openTransaction("Set Executable Path")) {
|
||||
program.setExecutablePath(path);
|
||||
}
|
||||
programManager.openProgram(program);
|
||||
|
@ -19,6 +19,7 @@ import java.io.IOException;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.bookmark.BookmarkPlugin;
|
||||
import ghidra.app.plugin.core.byteviewer.ByteViewerPlugin;
|
||||
import ghidra.app.plugin.core.clear.ClearPlugin;
|
||||
@ -48,7 +49,6 @@ import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.database.guest.DBTraceGuestPlatform;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.memory.TraceOverlappedRegionException;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class DebuggerManualTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -59,7 +59,7 @@ public class DebuggerManualTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
public void setUpManualTest() throws IOException {
|
||||
createTrace();
|
||||
ub = new ToyDBTraceBuilder("dynamic2-" + name.getMethodName(), LANGID_TOYBE64);
|
||||
try (UndoableTransaction tid = ub.startTransaction()) {
|
||||
try (Transaction tx = ub.startTransaction()) {
|
||||
ub.trace.getTimeManager().createSnapshot("First snap");
|
||||
}
|
||||
}
|
||||
@ -120,7 +120,7 @@ public class DebuggerManualTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
//addPlugin(tool, NextPrevSelectedRangePlugin.class);
|
||||
addPlugin(tool, SymbolTablePlugin.class);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion("Region", 0, tb.range(0x4000, 0x4fff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
|
@ -33,6 +33,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.action.DockingAction;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
import generic.Unique;
|
||||
@ -65,7 +66,6 @@ import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.trace.model.program.TraceProgramView;
|
||||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@ -109,7 +109,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
programManager.openProgram(program);
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create function")) {
|
||||
try (Transaction tx = program.openTransaction("Create function")) {
|
||||
entry = addr(program, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 0x1000, (byte) 0,
|
||||
@ -133,8 +133,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
|
||||
protected void addStaticMemoryAndBreakpoint() throws LockException, DuplicateNameException,
|
||||
MemoryConflictException, AddressOverflowException, CancelledException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Add bookmark break")) {
|
||||
try (Transaction tx = program.openTransaction("Add bookmark break")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
@ -145,7 +144,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
}
|
||||
|
||||
protected void addMapping(Trace trace) throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping")) {
|
||||
try (Transaction tx = trace.openTransaction("Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace, null, Lifespan.nowOn(0), addr(trace, 0x55550123)),
|
||||
new ProgramLocation(program, addr(program, 0x00400123)), 0x1000, false);
|
||||
@ -449,7 +448,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
}
|
||||
waitForPass(() -> assertEquals(0, breakpointService.getAllBreakpoints().size()));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble")) {
|
||||
try (Transaction tx = program.openTransaction("Disassemble")) {
|
||||
Disassembler.getDisassembler(program, TaskMonitor.DUMMY, msg -> {
|
||||
}).disassemble(addr(program, 0x00400123), set(rng(program, 0x00400123, 0x00400123)));
|
||||
}
|
||||
@ -478,7 +477,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
||||
}
|
||||
waitForPass(() -> assertEquals(0, breakpointService.getAllBreakpoints().size()));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble")) {
|
||||
try (Transaction tx = program.openTransaction("Disassemble")) {
|
||||
program.getListing().createData(addr(program, 0x00400123), ByteDataType.dataType);
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
@ -19,13 +19,13 @@ import java.io.IOException;
|
||||
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.dbg.target.schema.SchemaContext;
|
||||
import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName;
|
||||
import ghidra.dbg.target.schema.XmlSchemaContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.target.TraceObjectKeyPath;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
public class DebuggerBreakpointsProviderObjectTest extends DebuggerBreakpointsProviderTest {
|
||||
@ -105,7 +105,7 @@ public class DebuggerBreakpointsProviderObjectTest extends DebuggerBreakpointsPr
|
||||
</context>
|
||||
""", index));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getObjectManager().createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
tb.trace.getObjectManager()
|
||||
.createObject(
|
||||
|
@ -27,6 +27,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.table.RowWrappedEnumeratedColumnTableModel;
|
||||
import generic.Unique;
|
||||
import generic.test.category.NightlyCategory;
|
||||
@ -52,7 +53,6 @@ import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@ -82,7 +82,7 @@ public class DebuggerBreakpointsProviderTest extends AbstractGhidraHeadedDebugge
|
||||
}
|
||||
|
||||
protected void addMapping(Trace trace, Program prog) throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping")) {
|
||||
try (Transaction tx = trace.openTransaction("Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace, null, Lifespan.nowOn(0), addr(trace, 0x55550000)),
|
||||
new ProgramLocation(prog, addr(prog, 0x00400000)), 0x1000, false);
|
||||
@ -103,8 +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")) {
|
||||
try (Transaction tx = program.openTransaction("Add bookmark break")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
@ -705,7 +704,7 @@ public class DebuggerBreakpointsProviderTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
// Do our own launch, so that object mode is enabled during load (region creation)
|
||||
createTrace(program.getLanguageID().getIdAsString());
|
||||
try (UndoableTransaction startTransaction = tb.startTransaction()) {
|
||||
try (Transaction startTransaction = tb.startTransaction()) {
|
||||
TraceSnapshot initial = tb.trace.getTimeManager().getSnapshot(0, true);
|
||||
ProgramEmulationUtils.loadExecutable(initial, program);
|
||||
Address pc = program.getMinAddress();
|
||||
|
@ -26,6 +26,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.DockingActionIf;
|
||||
@ -65,7 +66,6 @@ import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.Scheduler;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
/**
|
||||
* Tests for target control and state editing
|
||||
@ -277,7 +277,7 @@ public class DebuggerControlPluginTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
Address start = tb.addr(0x00400000);
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
Assembler asm = Assemblers.getAssembler(tb.language);
|
||||
AssemblyBuffer buf = new AssemblyBuffer(asm, start);
|
||||
buf.assemble("br 0x" + start);
|
||||
@ -376,7 +376,7 @@ public class DebuggerControlPluginTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
protected void create2SnapTrace() throws Throwable {
|
||||
createAndOpenTrace();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getTimeManager().getSnapshot(1, true);
|
||||
}
|
||||
}
|
||||
@ -421,7 +421,7 @@ public class DebuggerControlPluginTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
createAndOpenTrace();
|
||||
TraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.getOrAddThread("Threads[0]", 0);
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion("Memory[bin:.text]", 0, tb.range(0x00400000, 0x00401000),
|
||||
@ -472,7 +472,7 @@ public class DebuggerControlPluginTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
createAndOpenTrace();
|
||||
TraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.getOrAddThread("Threads[0]", 0);
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion("Memory[bin:.text]", 0, tb.range(0x00400000, 0x00401000),
|
||||
@ -528,7 +528,7 @@ public class DebuggerControlPluginTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
createAndOpenTrace();
|
||||
TraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.getOrAddThread("Threads[0]", 0);
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion("Memory[bin:.text]", 0, tb.range(0x00400000, 0x00401000),
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.control;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
@ -26,6 +26,7 @@ import org.jdom.JDOMException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.action.DockingActionIf;
|
||||
import generic.Unique;
|
||||
import ghidra.app.context.ProgramLocationActionContext;
|
||||
@ -45,7 +46,6 @@ import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerMethodActionsPluginTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
public static final XmlSchemaContext SCHEMA_CTX;
|
||||
@ -216,13 +216,13 @@ public class DebuggerMethodActionsPluginTest extends AbstractGhidraHeadedDebugge
|
||||
createProgramFromTrace(tb.trace);
|
||||
intoProject(program);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add memory")) {
|
||||
try (Transaction tx = program.openTransaction("Add memory")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000,
|
||||
(byte) 0, monitor, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingService.addIdentityMapping(tb.trace, program, Lifespan.ALL, true);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -252,13 +252,13 @@ public class DebuggerMethodActionsPluginTest extends AbstractGhidraHeadedDebugge
|
||||
createProgramFromTrace(tb.trace);
|
||||
intoProject(program);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add memory")) {
|
||||
try (Transaction tx = program.openTransaction("Add memory")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000,
|
||||
(byte) 0, monitor, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingService.addIdentityMapping(tb.trace, program, Lifespan.ALL, true);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
@ -24,6 +24,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.action.DockingActionIf;
|
||||
import generic.Unique;
|
||||
import generic.test.category.NightlyCategory;
|
||||
@ -46,7 +47,6 @@ import ghidra.test.ToyProgramBuilder;
|
||||
import ghidra.trace.database.memory.DBTraceMemoryManager;
|
||||
import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -92,7 +92,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
assertDisabled(copyActionsPlugin.actionCopyIntoCurrentProgram);
|
||||
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -133,7 +133,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add blocks")) {
|
||||
try (Transaction tx = program.openTransaction("Add blocks")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x8000, (byte) 0,
|
||||
monitor, false);
|
||||
@ -142,7 +142,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
(byte) 0, monitor, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ,
|
||||
TraceMemoryFlag.EXECUTE);
|
||||
@ -214,7 +214,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
intoProject(program);
|
||||
intoProject(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -227,7 +227,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
MemoryBlock block;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block")) {
|
||||
try (Transaction tx = program.openTransaction("Create block")) {
|
||||
block = program.getMemory()
|
||||
.createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000,
|
||||
false);
|
||||
@ -236,7 +236,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
TraceLocation tloc =
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(0), tb.addr(0x55550000));
|
||||
ProgramLocation ploc = new ProgramLocation(program, tb.addr(stSpace, 0x00400000));
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingService.addMapping(tloc, ploc, 0x10000, true);
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
intoProject(program);
|
||||
intoProject(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -289,7 +289,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
MemoryBlock block;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block")) {
|
||||
try (Transaction tx = program.openTransaction("Create block")) {
|
||||
block = program.getMemory()
|
||||
.createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000,
|
||||
false);
|
||||
@ -298,7 +298,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
TraceLocation tloc =
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(0), tb.addr(0x55550000));
|
||||
ProgramLocation ploc = new ProgramLocation(program, tb.addr(stSpace, 0x00400000));
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingService.addMapping(tloc, ploc, 0x10000, true);
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
createAndOpenTrace();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -380,7 +380,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
createAndOpenTrace();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
|
@ -25,6 +25,7 @@ import javax.swing.JCheckBox;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.theme.GThemeDefaults.Colors.Palette;
|
||||
import ghidra.app.plugin.assembler.Assembler;
|
||||
import ghidra.app.plugin.assembler.Assemblers;
|
||||
@ -49,7 +50,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.memory.TraceMemoryState;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -74,7 +74,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
Random r = new Random();
|
||||
byte src[] = new byte[0x10000];
|
||||
r.nextBytes(src);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -83,7 +83,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
assertTrue(AllCopiers.BYTES.isRequiresInitializedMemory());
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
@ -106,7 +106,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
DBTraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
assertTrue(AllCopiers.STATE.isAvailable(view, program));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -116,7 +116,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
assertFalse(AllCopiers.STATE.isRequiresInitializedMemory());
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
@ -183,7 +183,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
AddressRange trng = tb.range(0x55550000, 0x5555ffff);
|
||||
Assembler asm = Assemblers.getAssembler(view);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
InstructionIterator iit = asm.assemble(tb.addr(0x55550000),
|
||||
@ -193,7 +193,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
assertTrue(iit.hasNext());
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@ -231,7 +231,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
AddressRange trng = tb.range(0x55550000, 0x5555ffff);
|
||||
Assembler asm = Assemblers.getAssembler(view);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
InstructionIterator iit = asm.assemble(tb.addr(0x55550000),
|
||||
@ -241,7 +241,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
assertTrue(iit.hasNext());
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@ -286,7 +286,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
.getValueWithDefault(tb.host, contextReg, 0, tb.addr(0x55550000));
|
||||
rv = rv.assign(longMode, BigInteger.ZERO);
|
||||
Instruction checkCtx;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
tb.trace.getRegisterContextManager().setValue(tb.language, rv, Lifespan.nowOn(0), trng);
|
||||
@ -314,7 +314,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")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@ -358,7 +358,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
assertTrue(AllCopiers.DATA.isAvailable(view, program));
|
||||
|
||||
AddressRange trng = tb.range(0x55560000, 0x5556ffff);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".data", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.WRITE);
|
||||
tb.addData(0, tb.addr(0x55560000), ByteDataType.dataType, tb.buf(0x12));
|
||||
@ -371,7 +371,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
tb.buf(0x00, 0x03, 0x00, 0x01, 0x02));
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00600000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@ -418,7 +418,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
assertTrue(AllCopiers.DYNAMIC_DATA.isAvailable(view, program));
|
||||
|
||||
AddressRange trng = tb.range(0x55560000, 0x5556ffff);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".data", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.WRITE);
|
||||
tb.addData(0, tb.addr(0x55560000), ByteDataType.dataType, tb.buf(0x12));
|
||||
@ -431,7 +431,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
tb.buf(0x00, 0x03, 0x00, 0x01, 0x02));
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00600000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
@ -485,7 +485,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
DBTraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
assertTrue(AllCopiers.LABELS.isAvailable(view, program));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -504,7 +504,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
try (Transaction tx = program.openTransaction("Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
@ -556,7 +556,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
DBTraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
assertTrue(AllCopiers.BREAKPOINTS.isAvailable(view, program));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -569,7 +569,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
try (Transaction tx = program.openTransaction("Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
@ -609,7 +609,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
DBTraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
assertTrue(AllCopiers.BOOKMARKS.isAvailable(view, program));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -620,7 +620,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
try (Transaction tx = program.openTransaction("Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
@ -657,7 +657,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
DBTraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
assertTrue(AllCopiers.REFERENCES.isAvailable(view, program));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -676,7 +676,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
try (Transaction tx = program.openTransaction("Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
@ -708,7 +708,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
DBTraceVariableSnapProgramView view = tb.trace.getProgramView();
|
||||
assertTrue(AllCopiers.COMMENTS.isAvailable(view, program));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -719,7 +719,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
try (Transaction tx = program.openTransaction("Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
|
@ -22,6 +22,7 @@ import java.nio.ByteBuffer;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingProvider;
|
||||
@ -32,7 +33,6 @@ import ghidra.trace.database.memory.DBTraceMemoryManager;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerTraceViewDiffPluginTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
@ -128,7 +128,7 @@ public class DebuggerTraceViewDiffPluginTest extends AbstractGhidraHeadedDebugge
|
||||
@Test
|
||||
public void testColorsDiffBytes() throws Throwable {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -163,7 +163,7 @@ public class DebuggerTraceViewDiffPluginTest extends AbstractGhidraHeadedDebugge
|
||||
@Test
|
||||
public void testActionPrevDiff() throws Throwable {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -200,7 +200,7 @@ public class DebuggerTraceViewDiffPluginTest extends AbstractGhidraHeadedDebugge
|
||||
@Test
|
||||
public void testActionNextDiff() throws Throwable {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
|
@ -29,6 +29,7 @@ import java.util.Set;
|
||||
import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.menu.ActionState;
|
||||
import docking.menu.MultiStateDockingAction;
|
||||
import docking.widgets.EventTrigger;
|
||||
@ -70,7 +71,6 @@ import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.trace.model.stack.TraceStack;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.exception.VersionException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@ -120,12 +120,12 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
}
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -144,7 +144,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
public void testListingViewIsRegionsActivateThenAdd() throws Exception {
|
||||
createAndOpenTrace();
|
||||
traceManager.activateTrace(tb.trace);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -158,7 +158,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
@Test
|
||||
public void testListingViewIsRegionsAddThenActivate() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -174,7 +174,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
@Test
|
||||
public void testRegisterTrackingOnRegisterChange() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -200,7 +200,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
@Test
|
||||
public void testRegisterTrackingOnSnapChange() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -233,7 +233,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
TraceThread thread1;
|
||||
TraceThread thread2;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -279,7 +279,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
.submit(() -> listingPlugin.createListingIfMissing(PCLocationTrackingSpec.INSTANCE,
|
||||
true))
|
||||
.get();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -315,7 +315,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
@Test
|
||||
public void testRegisterTrackingOnTrackingSpecChange() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -354,7 +354,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
new ToyDBTraceBuilder(name.getMethodName() + "_2", LANGID_TOYBE64)) {
|
||||
TraceThread t1, t2;
|
||||
|
||||
try (UndoableTransaction tid = b1.startTransaction()) {
|
||||
try (Transaction tx = b1.startTransaction()) {
|
||||
b1.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b1.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b1.range(0x00400000, 0x0040ffff),
|
||||
@ -366,7 +366,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
regs.setValue(0, new RegisterValue(pc, BigInteger.valueOf(0x00401234)));
|
||||
}
|
||||
waitForDomainObject(b1.trace);
|
||||
try (UndoableTransaction tid = b2.startTransaction()) {
|
||||
try (Transaction tx = b2.startTransaction()) {
|
||||
b2.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b2.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b2.range(0x00400000, 0x0040ffff),
|
||||
@ -410,7 +410,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
new ToyDBTraceBuilder(name.getMethodName() + "_2", LANGID_TOYBE64)) {
|
||||
TraceThread t1, t2;
|
||||
|
||||
try (UndoableTransaction tid = b1.startTransaction()) {
|
||||
try (Transaction tx = b1.startTransaction()) {
|
||||
b1.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b1.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b1.range(0x00400000, 0x0040ffff),
|
||||
@ -422,7 +422,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
regs.setValue(0, new RegisterValue(pc, BigInteger.valueOf(0x00401234)));
|
||||
}
|
||||
waitForDomainObject(b1.trace);
|
||||
try (UndoableTransaction tid = b2.startTransaction()) {
|
||||
try (Transaction tx = b2.startTransaction()) {
|
||||
b2.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b2.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b2.range(0x00400000, 0x0040ffff),
|
||||
@ -494,13 +494,13 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
}
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -579,7 +579,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForSwing();
|
||||
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -607,13 +607,13 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
}
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -769,7 +769,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -829,7 +829,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertFalse(listingProvider.actionGoTo.isEnabled());
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -870,7 +870,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertTrue(listingProvider.actionTrackLocation.isEnabled());
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1017,7 +1017,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
TraceThread thread1;
|
||||
TraceThread thread2;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1069,7 +1069,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
// To verify enabled requires live target
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x55550000, 0x555500ff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1185,7 +1185,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
DebuggerConsolePlugin consolePlugin = addPlugin(tool, DebuggerConsolePlugin.class);
|
||||
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("bash:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0041ffff),
|
||||
Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE));
|
||||
@ -1216,7 +1216,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
DebuggerConsolePlugin consolePlugin = addPlugin(tool, DebuggerConsolePlugin.class);
|
||||
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("bash:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0041ffff),
|
||||
Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE));
|
||||
@ -1247,7 +1247,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForSwing();
|
||||
assertEquals("(nowhere)", listingProvider.locationLabel.getText());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("test_region", Lifespan.nowOn(0), tb.range(0x55550000, 0x555502ff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1256,7 +1256,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForPass(() -> assertEquals("test_region", listingProvider.locationLabel.getText()));
|
||||
|
||||
TraceModule modExe;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe = tb.trace.getModuleManager()
|
||||
.addModule("modExe", "modExe", tb.range(0x55550000, 0x555501ff),
|
||||
Lifespan.nowOn(0));
|
||||
@ -1264,7 +1264,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForDomainObject(tb.trace);
|
||||
waitForPass(() -> assertEquals("modExe", listingProvider.locationLabel.getText()));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe.addSection(".text", tb.range(0x55550000, 0x555500ff));
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -1282,7 +1282,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
new ToyDBTraceBuilder("dynamic2-" + name.getMethodName(), "dsPIC33F:LE:24:default")) {
|
||||
|
||||
TraceThread thread1;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getTimeManager().createSnapshot("First");
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff),
|
||||
@ -1292,7 +1292,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
TraceThread thread2;
|
||||
try (UndoableTransaction tid = tb2.startTransaction()) {
|
||||
try (Transaction tx = tb2.startTransaction()) {
|
||||
tb2.trace.getTimeManager().createSnapshot("First");
|
||||
tb2.trace.getMemoryManager()
|
||||
.createRegion(".text", 0, tb2.range(0x200, 0x3ff), TraceMemoryFlag.READ,
|
||||
@ -1323,7 +1323,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread1;
|
||||
TraceThread thread2;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1354,7 +1354,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1382,7 +1382,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1413,7 +1413,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
thread = tb.getOrAddThread("Thread 1", 0);
|
||||
@ -1426,7 +1426,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
assertEquals(tb.addr(0x00401234), listingProvider.getLocation().getAddress());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regs = mm.getMemoryRegisterSpace(thread, true);
|
||||
regs.setValue(0, new RegisterValue(pc, new BigInteger("00404321", 16)));
|
||||
}
|
||||
@ -1444,7 +1444,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
thread = tb.getOrAddThread("Thread 1", 0);
|
||||
@ -1461,7 +1461,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
assertEquals(tb.addr(0x00401234), listingProvider.getLocation().getAddress());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regs = mm.getMemoryRegisterSpace(thread, true);
|
||||
regs.setValue(0, new RegisterValue(pc, new BigInteger("00404321", 16)));
|
||||
}
|
||||
@ -1478,7 +1478,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
DBTraceStackManager sm = tb.trace.getStackManager();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1492,7 +1492,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
assertEquals(tb.addr(0x00401234), listingProvider.getLocation().getAddress());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceStack stack = sm.getStack(thread, 0, true);
|
||||
stack.getFrame(0, true).setProgramCounter(Lifespan.ALL, tb.addr(0x00404321));
|
||||
}
|
||||
@ -1511,12 +1511,12 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
}
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1625,7 +1625,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
protected Instruction placeGuestInstruction(int guestRangeLength) throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("Memory[.text]", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE));
|
||||
|
@ -30,6 +30,7 @@ import java.util.Objects;
|
||||
import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.dnd.GClipboard;
|
||||
@ -66,7 +67,6 @@ import ghidra.trace.model.modules.TraceModule;
|
||||
import ghidra.trace.model.stack.TraceStack;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -110,7 +110,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
public void testBytesViewIsRegionsActivateThenAdd() throws Exception {
|
||||
createAndOpenTrace();
|
||||
traceManager.activateTrace(tb.trace);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -126,7 +126,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
@Test
|
||||
public void testBytesViewIsRegionsAddThenActivate() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -142,7 +142,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
@Test
|
||||
public void testRegisterTrackingOnRegisterChange() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -168,7 +168,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
@Test
|
||||
public void testRegisterTrackingOnSnapChange() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -202,7 +202,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
createAndOpenTrace();
|
||||
TraceThread thread1;
|
||||
TraceThread thread2;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -248,7 +248,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
.submit(() -> memBytesPlugin.createViewerIfMissing(PCLocationTrackingSpec.INSTANCE,
|
||||
true))
|
||||
.get();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -284,7 +284,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
@Test
|
||||
public void testRegisterTrackingOnTrackingSpecChange() throws Exception {
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -322,7 +322,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
new ToyDBTraceBuilder(name.getMethodName() + "_2", LANGID_TOYBE64)) {
|
||||
TraceThread t1, t2;
|
||||
|
||||
try (UndoableTransaction tid = b1.startTransaction()) {
|
||||
try (Transaction tx = b1.startTransaction()) {
|
||||
b1.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b1.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b1.range(0x00400000, 0x0040ffff),
|
||||
@ -334,7 +334,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
regs.setValue(0, new RegisterValue(pc, BigInteger.valueOf(0x00401234)));
|
||||
}
|
||||
waitForDomainObject(b1.trace);
|
||||
try (UndoableTransaction tid = b2.startTransaction()) {
|
||||
try (Transaction tx = b2.startTransaction()) {
|
||||
b2.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b2.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b2.range(0x00400000, 0x0040ffff),
|
||||
@ -373,7 +373,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
new ToyDBTraceBuilder(name.getMethodName() + "_2", LANGID_TOYBE64)) {
|
||||
TraceThread t1, t2;
|
||||
|
||||
try (UndoableTransaction tid = b1.startTransaction()) {
|
||||
try (Transaction tx = b1.startTransaction()) {
|
||||
b1.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b1.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b1.range(0x00400000, 0x0040ffff),
|
||||
@ -385,7 +385,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
regs.setValue(0, new RegisterValue(pc, BigInteger.valueOf(0x00401234)));
|
||||
}
|
||||
waitForDomainObject(b1.trace);
|
||||
try (UndoableTransaction tid = b2.startTransaction()) {
|
||||
try (Transaction tx = b2.startTransaction()) {
|
||||
b2.trace.getTimeManager().createSnapshot("First snap");
|
||||
DBTraceMemoryManager memory = b2.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), b2.range(0x00400000, 0x0040ffff),
|
||||
@ -445,7 +445,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
waitForSwing();
|
||||
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -548,7 +548,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
createAndOpenTrace();
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -611,7 +611,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
assertFalse(memBytesProvider.actionGoTo.isEnabled());
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -655,7 +655,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
assertTrue(memBytesProvider.actionTrackLocation.isEnabled());
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -708,7 +708,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
createAndOpenTrace();
|
||||
TraceThread thread1;
|
||||
TraceThread thread2;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager memory = tb.trace.getMemoryManager();
|
||||
memory.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -761,7 +761,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
// To verify enabled requires live target
|
||||
createAndOpenTrace();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x55550000, 0x555500ff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -881,7 +881,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
waitForSwing();
|
||||
assertEquals("(nowhere)", memBytesProvider.locationLabel.getText());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("test_region", Lifespan.nowOn(0), tb.range(0x55550000, 0x555502ff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -892,7 +892,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
waitForPass(() -> assertEquals("test_region", memBytesProvider.locationLabel.getText()));
|
||||
|
||||
TraceModule modExe;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe = tb.trace.getModuleManager()
|
||||
.addModule("modExe", "modExe", tb.range(0x55550000, 0x555501ff),
|
||||
Lifespan.nowOn(0));
|
||||
@ -900,7 +900,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
waitForDomainObject(tb.trace);
|
||||
waitForPass(() -> assertEquals("modExe", memBytesProvider.locationLabel.getText()));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe.addSection(".text", tb.range(0x55550000, 0x555500ff));
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -916,7 +916,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread1;
|
||||
TraceThread thread2;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -947,7 +947,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
createAndOpenTrace();
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -975,7 +975,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1006,7 +1006,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
thread = tb.getOrAddThread("Thread 1", 0);
|
||||
@ -1019,7 +1019,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertEquals(tb.addr(0x00401234), memBytesProvider.getLocation().getAddress());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regs = mm.getMemoryRegisterSpace(thread, true);
|
||||
regs.setValue(0, new RegisterValue(pc, new BigInteger("00404321", 16)));
|
||||
}
|
||||
@ -1037,7 +1037,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
Register pc = tb.language.getProgramCounter();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
thread = tb.getOrAddThread("Thread 1", 0);
|
||||
@ -1054,7 +1054,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertEquals(tb.addr(0x00401234), memBytesProvider.getLocation().getAddress());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regs = mm.getMemoryRegisterSpace(thread, true);
|
||||
regs.setValue(0, new RegisterValue(pc, new BigInteger("00404321", 16)));
|
||||
}
|
||||
@ -1071,7 +1071,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
createAndOpenTrace();
|
||||
DBTraceStackManager sm = tb.trace.getStackManager();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("exe:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -1085,7 +1085,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertEquals(tb.addr(0x00401234), memBytesProvider.getLocation().getAddress());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceStack stack = sm.getStack(thread, 0, true);
|
||||
stack.getFrame(0, true).setProgramCounter(Lifespan.ALL, tb.addr(0x00404321));
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
@ -40,7 +41,6 @@ import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.*;
|
||||
import ghidra.trace.model.modules.TraceStaticMapping;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -63,7 +63,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
|
||||
protected void addRegions() throws Exception {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
regionExeText = mm.createRegion("Memory[/bin/echo 0x55550000]", 0,
|
||||
tb.range(0x55550000, 0x555500ff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
regionExeData = mm.createRegion("Memory[/bin/echo 0x55750000]", 0,
|
||||
@ -76,7 +76,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
}
|
||||
|
||||
protected void addBlocks() throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
Memory mem = program.getMemory();
|
||||
blockExeText = mem.createInitializedBlock(".text", tb.addr(0x00400000), 0x100, (byte) 0,
|
||||
monitor, false);
|
||||
@ -104,7 +104,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
createTrace();
|
||||
|
||||
TraceMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
region = mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -132,7 +132,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
TraceMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
region = mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -149,7 +149,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
createTrace();
|
||||
|
||||
TraceMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
region = mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -162,7 +162,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
RegionRow row = Unique.assertOne(provider.legacyPanel.regionTableModel.getModelData());
|
||||
assertEquals(region, row.getRegion());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region.delete();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -174,7 +174,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
public void testUndoRedo() throws Exception {
|
||||
createTrace();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -197,14 +197,14 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
createAndOpenTrace();
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
|
||||
waitForDomainObject(tb.trace);
|
||||
Unique.assertOne(provider.legacyPanel.regionTableModel.getModelData());
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
assertEquals(0, provider.legacyPanel.regionTableModel.getModelData().size());
|
||||
@ -218,7 +218,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
createTrace();
|
||||
|
||||
TraceMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
region = mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -256,7 +256,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
assertFalse(provider.actionMapRegions.isEnabled());
|
||||
|
||||
addBlocks();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setName("echo");
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -331,7 +331,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
createTrace();
|
||||
|
||||
TraceMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
region = mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
@ -362,7 +362,7 @@ public class DebuggerRegionsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
createTrace();
|
||||
|
||||
TraceMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
region = mm.addRegion("Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
|
@ -23,6 +23,7 @@ import java.util.*;
|
||||
import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.table.DynamicTableColumn;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
@ -50,7 +51,6 @@ import ghidra.trace.model.memory.TraceObjectMemoryRegion;
|
||||
import ghidra.trace.model.modules.TraceStaticMapping;
|
||||
import ghidra.trace.model.target.*;
|
||||
import ghidra.trace.model.target.TraceObject.ConflictResolution;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
@ -100,7 +100,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
</context>
|
||||
""");
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getObjectManager().createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
protected void addRegions() throws Exception {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
regionExeText = addRegion("/bin/echo .text", 0, tb.range(0x55550000, 0x555500ff));
|
||||
regionExeData = addRegion("/bin/echo .data", 0, tb.range(0x55750000, 0x5575007f));
|
||||
regionLibText = addRegion("/lib/libc.so .text", 0, tb.range(0x7f000000, 0x7f0003ff));
|
||||
@ -133,7 +133,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
protected void addBlocks() throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
Memory mem = program.getMemory();
|
||||
blockExeText = mem.createInitializedBlock(".text", tb.addr(0x00400000), 0x100, (byte) 0,
|
||||
monitor, false);
|
||||
@ -206,7 +206,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForPass(() -> assertTableSize(0));
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
}
|
||||
waitForTasks();
|
||||
@ -245,7 +245,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
}
|
||||
|
||||
@ -258,7 +258,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
0x10000, "rx");
|
||||
});
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region.getObject().removeTree(Lifespan.nowOn(0));
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -272,7 +272,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
waitForDomainObject(tb.trace);
|
||||
waitForTasks();
|
||||
@ -318,7 +318,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertRow(0, region.getObject(), "bin:.text", tb.addr(0x00400000),
|
||||
tb.addr(0x0040ffff), 0x10000, "rx");
|
||||
});
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
waitForTasks();
|
||||
@ -334,7 +334,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
}
|
||||
|
||||
@ -376,7 +376,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertFalse(provider.actionMapRegions.isEnabled());
|
||||
|
||||
addBlocks();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setName("echo");
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -449,7 +449,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createAndOpenTrace();
|
||||
|
||||
TraceObjectMemoryRegion region;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
region = addRegion("bin:.text", 0, tb.range(0x00400000, 0x0040ffff));
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ import java.util.Set;
|
||||
import org.jdom.JDOMException;
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.table.DynamicTableColumn;
|
||||
import docking.widgets.table.GDynamicColumnTableModel;
|
||||
import docking.widgets.tree.GTree;
|
||||
@ -47,7 +48,6 @@ import ghidra.trace.model.target.*;
|
||||
import ghidra.trace.model.target.TraceObject.ConflictResolution;
|
||||
import ghidra.trace.model.thread.TraceObjectThread;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
@ -130,14 +130,14 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
}
|
||||
|
||||
protected void populateSnapshots() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getTimeManager().getSnapshot(20, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected TraceObjectValue createSessionObject() throws Throwable {
|
||||
TraceObjectManager objects = tb.trace.getObjectManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
return objects.createRootObject(CTX.getSchema(new SchemaName("Session")));
|
||||
}
|
||||
}
|
||||
@ -162,7 +162,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
}
|
||||
|
||||
protected TraceObject createStack(TraceObject thread) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObjectKeyPath stackPath = thread.getCanonicalPath().key("Stack");
|
||||
TraceObjectManager objects = tb.trace.getObjectManager();
|
||||
TraceObject stack = objects.createObject(stackPath);
|
||||
@ -175,7 +175,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
}
|
||||
|
||||
protected void populateThreads() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject prevThread = null;
|
||||
for (long i = 0; i < 10; i++) {
|
||||
TraceObject thread = createThread(i, prevThread);
|
||||
@ -186,7 +186,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
protected void addThread10() throws Throwable {
|
||||
TraceObjectManager objects = tb.trace.getObjectManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
createThread(10, objects.getObjectByCanonicalPath(
|
||||
TraceObjectKeyPath.parse("Processes[0].Threads[9]")));
|
||||
}
|
||||
@ -194,7 +194,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
protected void populateHandles() throws Throwable {
|
||||
TraceObjectManager objects = tb.trace.getObjectManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject handleContainer =
|
||||
objects.createObject(TraceObjectKeyPath.parse("Processes[0].Handles"));
|
||||
handleContainer.insert(Lifespan.nowOn(0), ConflictResolution.DENY);
|
||||
@ -208,7 +208,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
protected void populateLinks() throws Throwable {
|
||||
TraceObjectManager objects = tb.trace.getObjectManager();
|
||||
TraceObjectKeyPath threadContainerPath = TraceObjectKeyPath.parse("Processes[0].Threads");
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject linkContainer =
|
||||
objects.createObject(TraceObjectKeyPath.parse("Processes[0].Links"));
|
||||
linkContainer.insert(Lifespan.nowOn(0), ConflictResolution.DENY);
|
||||
@ -221,7 +221,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
protected void populateBoxedPrimitive() throws Throwable {
|
||||
TraceObjectManager objects = tb.trace.getObjectManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject boxed =
|
||||
objects.createObject(TraceObjectKeyPath.parse("Processes[0].Boxed"));
|
||||
boxed.insert(Lifespan.nowOn(0), ConflictResolution.DENY);
|
||||
@ -684,7 +684,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
assertPathIs(path, 0, 3);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject thread = tb.trace.getObjectManager().getObjectByCanonicalPath(path);
|
||||
thread.setAttribute(Lifespan.nowOn(0), "NewAttribute", 11);
|
||||
}
|
||||
@ -705,7 +705,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
assertPathIsThreadsContainer();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject threads = tb.trace.getObjectManager().getObjectByCanonicalPath(path);
|
||||
threads.setElement(Lifespan.ALL, 2, null);
|
||||
}
|
||||
@ -726,7 +726,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
assertPathIs(path, 0, 3);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject thread = tb.trace.getObjectManager().getObjectByCanonicalPath(path);
|
||||
thread.setAttribute(Lifespan.ALL, "_self", null);
|
||||
}
|
||||
@ -751,14 +751,14 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
assertPathIs(path, 3, 0);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
element2.setLifespan(Lifespan.nowOn(10), ConflictResolution.DENY);
|
||||
}
|
||||
waitForTasks();
|
||||
|
||||
assertPathIs(path, 2, 0);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
element2.setLifespan(Lifespan.nowOn(2), ConflictResolution.DENY);
|
||||
}
|
||||
waitForTasks();
|
||||
@ -783,14 +783,14 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
assertPathIs(path, 0, 4); // _next created at snap 3
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
attrSelf.setLifespan(Lifespan.nowOn(10), ConflictResolution.DENY);
|
||||
}
|
||||
waitForTasks();
|
||||
|
||||
assertPathIs(path, 0, 3);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
attrSelf.setLifespan(Lifespan.nowOn(2), ConflictResolution.DENY);
|
||||
}
|
||||
waitForTasks();
|
||||
@ -813,7 +813,7 @@ public class DebuggerModelProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
waitForValue(() -> modelProvider.objectsTreePanel.treeModel.getNode(path));
|
||||
assertEquals("<html>[2]", node.getDisplayText());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread.setAttribute(Lifespan.nowOn(0), "_display", "Renamed Thread");
|
||||
}
|
||||
waitForTasks();
|
||||
|
@ -15,12 +15,12 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.model;
|
||||
|
||||
import static ghidra.app.plugin.core.debug.gui.model.DebuggerModelProviderTest.CTX;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static ghidra.app.plugin.core.debug.gui.model.DebuggerModelProviderTest.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName;
|
||||
import ghidra.trace.database.target.DBTraceObjectManager;
|
||||
@ -28,7 +28,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.target.TraceObject.ConflictResolution;
|
||||
import ghidra.trace.model.target.TraceObjectKeyPath;
|
||||
import ghidra.trace.model.target.TraceObjectValue;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class ModelQueryTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@Test
|
||||
@ -38,7 +37,7 @@ public class ModelQueryTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
ModelQuery rootQuery = ModelQuery.parse("");
|
||||
ModelQuery threadQuery = ModelQuery.parse("Processes[].Threads[]");
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceObjectManager objects = tb.trace.getObjectManager();
|
||||
|
||||
TraceObjectValue rootVal =
|
||||
@ -65,7 +64,7 @@ public class ModelQueryTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
ModelQuery rootQuery = ModelQuery.parse("");
|
||||
ModelQuery threadQuery = ModelQuery.parse("Processes[].Threads[]");
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceObjectManager objects = tb.trace.getObjectManager();
|
||||
|
||||
TraceObjectValue rootVal =
|
||||
|
@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import generic.Unique;
|
||||
import generic.test.category.NightlyCategory;
|
||||
@ -59,7 +60,6 @@ import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.memory.TraceOverlappedRegionException;
|
||||
import ghidra.trace.model.modules.*;
|
||||
import ghidra.trace.model.symbol.TraceSymbol;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
@Category(NightlyCategory.class) // this may actually be an @PortSensitive test
|
||||
@ -83,7 +83,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
|
||||
protected void addRegionsFromModules()
|
||||
throws TraceOverlappedRegionException, DuplicateNameException {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager manager = tb.trace.getMemoryManager();
|
||||
for (TraceModule module : tb.trace.getModuleManager().getAllModules()) {
|
||||
for (TraceSection section : module.getSections()) {
|
||||
@ -108,7 +108,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
|
||||
protected void addModules() throws Exception {
|
||||
TraceModuleManager manager = tb.trace.getModuleManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe = manager.addLoadedModule("Processes[1].Modules[first_proc]", "first_proc",
|
||||
tb.range(0x55550000, 0x5575007f), 0);
|
||||
secExeText = modExe.addSection("Processes[1].Modules[first_proc].Sections[.text]",
|
||||
@ -126,7 +126,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
}
|
||||
|
||||
protected MemoryBlock addBlock() throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
return program.getMemory()
|
||||
.createInitializedBlock(".text", tb.addr(0x00400000), 0x1000, (byte) 0, monitor,
|
||||
false);
|
||||
@ -225,7 +225,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
waitForSwing();
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -261,7 +261,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
|
||||
assertProviderPopulated(); // Cheap sanity check
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe.delete();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -355,7 +355,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
assertTrue(modulesProvider.actionMapIdentically.isEnabled());
|
||||
|
||||
// Need some substance in the program
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate")) {
|
||||
try (Transaction tx = program.openTransaction("Populate")) {
|
||||
addBlock();
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -390,7 +390,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
// Still
|
||||
assertFalse(modulesProvider.actionMapModules.isEnabled());
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setImageBase(addr(program, 0x00400000), true);
|
||||
program.setName(modExe.getName());
|
||||
|
||||
@ -459,7 +459,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
assertFalse(modulesProvider.actionMapSections.isEnabled());
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -669,7 +669,7 @@ public class DebuggerModulesProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.activateTrace(tb.trace);
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe.setName("/bin/echo"); // File has to exist
|
||||
}
|
||||
waitForPass(
|
||||
|
@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import docking.widgets.table.DynamicTableColumn;
|
||||
import generic.Unique;
|
||||
@ -46,9 +47,9 @@ import ghidra.app.plugin.core.debug.gui.modules.DebuggerSectionMapProposalDialog
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerTargetTraceMapper;
|
||||
import ghidra.app.plugin.core.debug.mapping.ObjectBasedDebuggerTargetTraceMapper;
|
||||
import ghidra.app.services.DebuggerListingService;
|
||||
import ghidra.app.services.TraceRecorder;
|
||||
import ghidra.app.services.ModuleMapProposal.ModuleMapEntry;
|
||||
import ghidra.app.services.SectionMapProposal.SectionMapEntry;
|
||||
import ghidra.app.services.TraceRecorder;
|
||||
import ghidra.dbg.attributes.TargetPrimitiveDataType.DefaultTargetPrimitiveDataType;
|
||||
import ghidra.dbg.attributes.TargetPrimitiveDataType.PrimitiveKind;
|
||||
import ghidra.dbg.model.TestTargetModule;
|
||||
@ -56,8 +57,8 @@ import ghidra.dbg.model.TestTargetTypedefDataType;
|
||||
import ghidra.dbg.target.*;
|
||||
import ghidra.dbg.target.schema.SchemaContext;
|
||||
import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName;
|
||||
import ghidra.dbg.util.*;
|
||||
import ghidra.dbg.target.schema.XmlSchemaContext;
|
||||
import ghidra.dbg.util.*;
|
||||
import ghidra.framework.main.DataTreeDialog;
|
||||
import ghidra.plugin.importer.ImporterPlugin;
|
||||
import ghidra.program.model.address.*;
|
||||
@ -73,7 +74,6 @@ import ghidra.trace.model.modules.*;
|
||||
import ghidra.trace.model.symbol.TraceSymbol;
|
||||
import ghidra.trace.model.target.*;
|
||||
import ghidra.trace.model.target.TraceObject.ConflictResolution;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
@ -175,7 +175,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
</schema>
|
||||
</context>""");
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getObjectManager().createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
}
|
||||
}
|
||||
@ -183,7 +183,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
protected void addRegionsFromModules() throws Exception {
|
||||
PathPattern regionPattern = new PathPattern(PathUtils.parse("Processes[1].Memory[]"));
|
||||
TraceObjectManager om = tb.trace.getObjectManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject root = om.getRootObject();
|
||||
for (TraceObject module : (Iterable<TraceObject>) () -> root
|
||||
.querySuccessorsTargetInterface(Lifespan.at(0), TargetModule.class, true)
|
||||
@ -242,7 +242,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
protected void addModules() throws Exception {
|
||||
Lifespan zeroOn = Lifespan.nowOn(0);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe = addModule("first_proc", tb.range(0x55550000, 0x5575007f), zeroOn);
|
||||
secExeText = addSection(modExe, ".text", tb.range(0x55550000, 0x555500ff));
|
||||
secExeData = addSection(modExe, ".data", tb.range(0x55750000, 0x5575007f));
|
||||
@ -254,7 +254,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
protected MemoryBlock addBlock() throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
return program.getMemory()
|
||||
.createInitializedBlock(".text", tb.addr(0x00400000), 0x1000, (byte) 0, monitor,
|
||||
false);
|
||||
@ -392,7 +392,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForTasks();
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -427,7 +427,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
waitForPass(() -> assertProviderPopulated());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe.getObject().removeTree(Lifespan.nowOn(0));
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -515,7 +515,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForPass(() -> assertTrue(provider.actionMapIdentically.isEnabled()));
|
||||
|
||||
// Need some substance in the program
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate")) {
|
||||
try (Transaction tx = program.openTransaction("Populate")) {
|
||||
addBlock();
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -550,7 +550,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
// Still
|
||||
assertFalse(provider.actionMapModules.isEnabled());
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setImageBase(addr(program, 0x00400000), true);
|
||||
program.setName(modExe.getName());
|
||||
|
||||
@ -618,7 +618,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertFalse(provider.actionMapSections.isEnabled());
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
try (Transaction tx = program.openTransaction("Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -819,7 +819,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
traceManager.activateTrace(tb.trace);
|
||||
waitForTasks();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
modExe.setName("/bin/echo"); // File has to exist
|
||||
}
|
||||
waitForPass(() -> assertModuleTableSize(2));
|
||||
|
@ -25,6 +25,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||
@ -39,7 +40,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.modules.TraceStaticMapping;
|
||||
import ghidra.trace.model.modules.TraceStaticMappingManager;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
@ -64,7 +64,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.openTrace(tb.trace);
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef, 0xdeadbeef + 0xff), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "DEADBEEF");
|
||||
}
|
||||
@ -84,7 +84,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.openTrace(tb.trace);
|
||||
// Note: don't activate yet
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef, 0xdeadbeef + 0xff), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "DEADBEEF");
|
||||
}
|
||||
@ -114,7 +114,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
intoProject(tb.trace);
|
||||
intoProject(program);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion(".text", Lifespan.nowOn(0),
|
||||
tb.range(0xdeadbeefL, 0xdeadbeefL + 0xff),
|
||||
@ -122,7 +122,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0xc0de1234L), 0x100, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
@ -162,7 +162,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.openTrace(tb.trace);
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef, 0xdeadbeef + 0xff), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "DEADBEEF");
|
||||
manager.add(tb.range(0xdeadbeef + 0x100, 0xdeadbeef + 0x17f), Lifespan.nowOn(0),
|
||||
@ -203,7 +203,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.openTrace(tb.trace);
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef, 0xdeadbeef + 0xff), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "DEADBEEF");
|
||||
manager.add(tb.range(0xdeadbeef + 0x100, 0xdeadbeef + 0x17f), Lifespan.nowOn(0),
|
||||
@ -218,7 +218,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
assertEquals(3, displayed.size());
|
||||
|
||||
// Remove the first two in another transaction
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.findContaining(tb.addr(0xdeadbeef), 0).delete();
|
||||
manager.findContaining(tb.addr(0xdeadbeef + 0x100), 0).delete();
|
||||
}
|
||||
@ -236,14 +236,14 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.openTrace(tb.trace);
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef, 0xdeadbeef + 0xff), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "DEADBEEF");
|
||||
manager.add(tb.range(0xdeadbeef + 0x100, 0xdeadbeef + 0x17f), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "C0DE1234");
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef + 0x180, 0xdeadbeef + 0x1bf), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "1E55C0DE");
|
||||
}
|
||||
@ -263,14 +263,14 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.openTrace(tb.trace);
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef, 0xdeadbeef + 0xff), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "DEADBEEF");
|
||||
manager.add(tb.range(0xdeadbeef + 0x100, 0xdeadbeef + 0x17f), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "C0DE1234");
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.add(tb.range(0xdeadbeef + 0x180, 0xdeadbeef + 0x1bf), Lifespan.nowOn(0),
|
||||
new URL("ghidra://static"), "1E55C0DE");
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -278,7 +278,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
||||
// Check that all records are displayed in the interim
|
||||
assertEquals(3, mappingsProvider.mappingTableModel.getModelData().size());
|
||||
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
|
@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.objects;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.services.CodeViewerService;
|
||||
import ghidra.app.services.DebuggerStaticMappingService;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerObjectsProviderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
protected DebuggerObjectsPlugin objectsPlugin;
|
||||
@ -43,7 +43,7 @@ public class DebuggerObjectsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
public void testBasic() throws Exception {
|
||||
createAndOpenTrace();
|
||||
traceManager.activateTrace(tb.trace);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
//objectsProvider.importFromXMLAction.run();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
@ -23,6 +23,7 @@ import java.util.List;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.assembler.Assembler;
|
||||
import ghidra.app.plugin.assembler.Assemblers;
|
||||
@ -45,7 +46,6 @@ import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerPcodeStepperProviderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
@ -75,7 +75,7 @@ public class DebuggerPcodeStepperProviderTest extends AbstractGhidraHeadedDebugg
|
||||
protected void populateTrace() throws Exception {
|
||||
start = tb.addr(0x00400000);
|
||||
InstructionIterator iit;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("echo:.text", Lifespan.nowOn(0), tb.range(0x00400000, 0x0040ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.register;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
@ -24,6 +24,7 @@ import java.util.stream.Collectors;
|
||||
import org.junit.Before;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerTargetTraceMapper;
|
||||
@ -39,7 +40,6 @@ import ghidra.trace.model.guest.TraceGuestPlatform;
|
||||
import ghidra.trace.model.guest.TracePlatform;
|
||||
import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@Category(NightlyCategory.class) // this may actually be an @PortSensitive test
|
||||
public class DebuggerRegistersProviderGuestTest extends DebuggerRegistersProviderTest {
|
||||
@ -52,7 +52,7 @@ public class DebuggerRegistersProviderGuestTest extends DebuggerRegistersProvide
|
||||
}
|
||||
|
||||
public void createToyPlatform() throws Exception {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
toy = tb.trace.getPlatformManager()
|
||||
.addGuestPlatform(getToyBE64Language().getDefaultCompilerSpec());
|
||||
toy.addMappedRange(tb.addr(0), tb.addr(toy, 0), -1);
|
||||
@ -130,7 +130,7 @@ public class DebuggerRegistersProviderGuestTest extends DebuggerRegistersProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addRegisterValues(TraceThread thread, UndoableTransaction tid) {
|
||||
protected void addRegisterValues(TraceThread thread, Transaction tx) {
|
||||
TraceMemorySpace regVals =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
regVals.putBytes(toy, 0, pc, tb.buf(0, 0, 0, 0, 0, 0x40, 0, 0));
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.register;
|
||||
|
||||
import static ghidra.lifecycle.Unfinished.TODO;
|
||||
import static ghidra.lifecycle.Unfinished.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.math.BigInteger;
|
||||
@ -26,6 +26,7 @@ import java.util.stream.Collectors;
|
||||
import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.action.NoneLocationTrackingSpec;
|
||||
@ -48,7 +49,6 @@ import ghidra.trace.model.listing.*;
|
||||
import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
@Category(NightlyCategory.class) // this may actually be an @PortSensitive test
|
||||
@ -107,7 +107,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
}
|
||||
|
||||
protected TraceThread addThread(String threadName) throws DuplicateNameException {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
return tb.trace.getThreadManager().createThread(threadName, 0);
|
||||
}
|
||||
}
|
||||
@ -121,12 +121,12 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
}
|
||||
|
||||
protected void addRegisterValues(TraceThread thread) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
addRegisterValues(thread, tid);
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
addRegisterValues(thread, tx);
|
||||
}
|
||||
}
|
||||
|
||||
protected void addRegisterValues(TraceThread thread, UndoableTransaction tid) {
|
||||
protected void addRegisterValues(TraceThread thread, Transaction tx) {
|
||||
TraceMemorySpace regVals =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
regVals.putBytes(0, pc, tb.buf(0, 0, 0, 0, 0, 0x40, 0, 0));
|
||||
@ -134,7 +134,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
regVals.putBytes(0, r0, tb.buf(1, 2, 3, 4, 5, 6, 7, 8));
|
||||
}
|
||||
|
||||
protected void addRegisterTypes(TraceThread thread, UndoableTransaction tid)
|
||||
protected void addRegisterTypes(TraceThread thread, Transaction tx)
|
||||
throws CodeUnitInsertionException {
|
||||
TraceCodeSpace regCode =
|
||||
tb.trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
@ -146,8 +146,8 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
}
|
||||
|
||||
protected void addRegisterTypes(TraceThread thread) throws CodeUnitInsertionException {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
addRegisterTypes(thread, tid);
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
addRegisterTypes(thread, tx);
|
||||
}
|
||||
}
|
||||
|
||||
@ -475,7 +475,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
traceManager.openTrace(tb.trace);
|
||||
|
||||
TraceThread thread = addThread();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.exec(getPlatform(), 0, thread, 0, "pc = 100;");
|
||||
}
|
||||
activateThread(thread);
|
||||
@ -540,9 +540,9 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
TraceThread thread = addThread();
|
||||
activateThread(thread);
|
||||
// Group adds into a single transaction
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
addRegisterValues(thread, tid);
|
||||
addRegisterTypes(thread, tid);
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
addRegisterValues(thread, tx);
|
||||
addRegisterTypes(thread, tx);
|
||||
}
|
||||
waitForSwing();
|
||||
|
||||
@ -574,9 +574,9 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
TraceThread thread = addThread();
|
||||
activateThread(thread);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
addRegisterValues(thread, tid);
|
||||
addRegisterTypes(thread, tid);
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
addRegisterValues(thread, tx);
|
||||
addRegisterTypes(thread, tx);
|
||||
waitForSwing();
|
||||
|
||||
// Sanity
|
||||
@ -585,7 +585,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
assertPCRowTypePopulated();
|
||||
assertR0RowTypePopulated();
|
||||
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
@ -628,7 +628,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
assertPCRowValuePopulated();
|
||||
assertR0RowValuePopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regVals =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
TraceCodeSpace regCode =
|
||||
@ -657,7 +657,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
assertEquals(1, traceManager.getCurrentSnap());
|
||||
assertR0RowTypePopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceCodeSpace regCode =
|
||||
tb.trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
TraceCodeUnit code = regCode.codeUnits().getContaining(getPlatform(), 1, r0);
|
||||
@ -687,7 +687,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
|
||||
assertR0RowTypePopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceCodeSpace regCode =
|
||||
tb.trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
TraceCodeUnit code = regCode.codeUnits().getContaining(getPlatform(), 1, r0);
|
||||
@ -755,7 +755,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
traceManager.openTrace(tb.trace);
|
||||
|
||||
TraceThread thread = addThread();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// Unconventional start, to ensure goto PC is actually the cause, not just min of view
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("bin:.text", Lifespan.nowOn(0), tb.range(0x00300000, 0x00500000),
|
||||
@ -864,7 +864,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
traceManager.openTrace(ub.trace);
|
||||
|
||||
TraceThread thread3;
|
||||
try (UndoableTransaction tid = ub.startTransaction()) {
|
||||
try (Transaction tx = ub.startTransaction()) {
|
||||
thread3 = ub.trace.getThreadManager().createThread("Thread3", 0);
|
||||
}
|
||||
traceManager.activateTrace(ub.trace);
|
||||
@ -898,7 +898,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
assertR0RowValuePopulated();
|
||||
assertR0RowTypePopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regVals =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
TraceCodeSpace regCode =
|
||||
@ -940,7 +940,7 @@ public class DebuggerRegistersProviderTest extends AbstractGhidraHeadedDebuggerG
|
||||
assertR0RowValuePopulated();
|
||||
assertR0RowTypePopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regVals =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, 1, true);
|
||||
regVals.putBytes(getPlatform(), 0, pc, tb.buf(0, 0, 0, 0, 0, 0x50, 0, 0));
|
||||
|
@ -23,6 +23,7 @@ import java.util.List;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.service.modules.DebuggerStaticMappingServicePlugin;
|
||||
@ -41,7 +42,6 @@ import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.stack.TraceStack;
|
||||
import ghidra.trace.model.stack.TraceStackFrame;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@ -63,13 +63,13 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
}
|
||||
|
||||
protected TraceThread addThread(String n) throws DuplicateNameException {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
return tb.trace.getThreadManager().createThread(n, 0);
|
||||
}
|
||||
}
|
||||
|
||||
protected void addRegVals(TraceThread thread) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regs =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
regs.setValue(0, new RegisterValue(pc, new BigInteger("00400123", 16)));
|
||||
@ -77,7 +77,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
}
|
||||
|
||||
protected TraceStack addStack(TraceThread thread, int snap) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
return tb.trace.getStackManager().getStack(thread, snap, true);
|
||||
}
|
||||
}
|
||||
@ -87,7 +87,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
}
|
||||
|
||||
protected void addStackFrames(TraceStack stack) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.setDepth(2, false);
|
||||
|
||||
TraceStackFrame frame = stack.getFrame(0, false);
|
||||
@ -234,7 +234,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertProviderPopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.setDepth(3, false);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -259,7 +259,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertProviderPopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.setDepth(3, true);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -284,7 +284,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertProviderPopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.setDepth(1, false);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -307,7 +307,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertProviderPopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.setDepth(1, true);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -330,7 +330,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
assertProviderPopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.delete();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -472,7 +472,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
assertProviderPopulated();
|
||||
|
||||
Function func;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add Function")) {
|
||||
try (Transaction tx = program.openTransaction("Add Function")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00600000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
@ -483,7 +483,7 @@ public class DebuggerStackProviderLegacyTest extends AbstractGhidraHeadedDebugge
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.addRegion("Processes[1].Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.drng(0x00400000, 0x00400fff),
|
||||
|
@ -15,8 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.stack;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@ -24,6 +23,7 @@ import java.util.Objects;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.table.DynamicTableColumn;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
@ -52,7 +52,6 @@ import ghidra.trace.model.stack.TraceObjectStack;
|
||||
import ghidra.trace.model.target.*;
|
||||
import ghidra.trace.model.target.TraceObject.ConflictResolution;
|
||||
import ghidra.trace.model.thread.TraceObjectThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
@ -159,7 +158,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
</context>
|
||||
""");
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getObjectManager().createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
}
|
||||
}
|
||||
@ -168,7 +167,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
PathPattern threadPattern = new PathPattern(PathUtils.parse("Processes[1].Threads[]"));
|
||||
TraceObjectKeyPath threadPath =
|
||||
TraceObjectKeyPath.of(threadPattern.applyIntKeys(n).getSingletonPath());
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
return Objects.requireNonNull(tb.trace.getObjectManager()
|
||||
.createObject(threadPath)
|
||||
.insert(Lifespan.nowOn(0), ConflictResolution.TRUNCATE)
|
||||
@ -179,7 +178,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
protected TraceObjectStack addStack(TraceObjectThread thread) {
|
||||
TraceObjectKeyPath stackPath = thread.getObject().getCanonicalPath().extend("Stack");
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
return Objects.requireNonNull(tb.trace.getObjectManager()
|
||||
.createObject(stackPath)
|
||||
.insert(Lifespan.nowOn(0), ConflictResolution.TRUNCATE)
|
||||
@ -195,7 +194,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
protected void addStackFrames(TraceObjectStack stack, int count) {
|
||||
TraceObjectKeyPath stackPath = stack.getObject().getCanonicalPath();
|
||||
TraceObjectManager om = tb.trace.getObjectManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
TraceObject frame = om.createObject(stackPath.index(i))
|
||||
.insert(Lifespan.nowOn(0), ConflictResolution.TRUNCATE)
|
||||
@ -346,7 +345,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
waitForPass(() -> assertProviderPopulated());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject frame2 = tb.trace.getObjectManager()
|
||||
.createObject(stack.getObject().getCanonicalPath().index(2))
|
||||
.insert(Lifespan.nowOn(0), ConflictResolution.TRUNCATE)
|
||||
@ -379,7 +378,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
waitForPass(() -> assertProviderPopulated());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObject frame1 = stack.getObject().getElement(0, 1).getChild();
|
||||
frame1.removeTree(Lifespan.nowOn(0));
|
||||
}
|
||||
@ -405,7 +404,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
waitForPass(() -> assertProviderPopulated());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.getObject().removeTree(Lifespan.nowOn(0));
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -449,7 +448,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
|
||||
waitForPass(() -> assertProviderPopulated());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
stack.getObject().removeTree(Lifespan.nowOn(1));
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -563,7 +562,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
waitForPass(() -> assertProviderPopulated());
|
||||
|
||||
Function func;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add Function")) {
|
||||
try (Transaction tx = program.openTransaction("Add Function")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00600000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
@ -574,7 +573,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceObjectMemoryRegion region = Objects.requireNonNull(tb.trace.getObjectManager()
|
||||
.createObject(TraceObjectKeyPath.parse("Processes[1].Memory[bin:.text]"))
|
||||
.insert(Lifespan.nowOn(0), ConflictResolution.TRUNCATE)
|
||||
|
@ -25,6 +25,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.thread.DebuggerLegacyThreadsPanel.ThreadTableColumns;
|
||||
@ -33,7 +34,6 @@ import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.thread.TraceThreadManager;
|
||||
import ghidra.trace.model.time.TraceTimeManager;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@Category(NightlyCategory.class) // this may actually be an @PortSensitive test
|
||||
public class DebuggerThreadsProviderLegacyTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -52,7 +52,7 @@ public class DebuggerThreadsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
|
||||
protected void addThreads() throws Exception {
|
||||
TraceThreadManager manager = tb.trace.getThreadManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread1 = manager.addThread("Processes[1].Threads[1]", Lifespan.nowOn(0));
|
||||
thread1.setComment("A comment");
|
||||
thread2 = manager.addThread("Processes[1].Threads[2]", Lifespan.span(5, 10));
|
||||
@ -267,7 +267,7 @@ public class DebuggerThreadsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
|
||||
assertEquals(1, threadsProvider.legacyPanel.spanRenderer.getFullRange().max().longValue());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.getSnapshot(10, true);
|
||||
}
|
||||
waitForSwing();
|
||||
@ -284,7 +284,7 @@ public class DebuggerThreadsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
traceManager.activateTrace(tb.trace);
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread1.setDestructionSnap(15);
|
||||
}
|
||||
waitForSwing();
|
||||
@ -304,7 +304,7 @@ public class DebuggerThreadsProviderLegacyTest extends AbstractGhidraHeadedDebug
|
||||
|
||||
assertEquals(2, threadsProvider.legacyPanel.threadTableModel.getModelData().size());
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread2.delete();
|
||||
}
|
||||
waitForSwing();
|
||||
|
@ -25,6 +25,7 @@ import java.util.Set;
|
||||
import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.table.*;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
@ -52,7 +53,6 @@ import ghidra.trace.model.target.TraceObjectKeyPath;
|
||||
import ghidra.trace.model.target.TraceObjectManager;
|
||||
import ghidra.trace.model.thread.TraceObjectThread;
|
||||
import ghidra.trace.model.time.TraceTimeManager;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
|
||||
@Category(NightlyCategory.class)
|
||||
@ -133,7 +133,7 @@ public class DebuggerThreadsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
</schema>
|
||||
</context>""");
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getObjectManager().createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
}
|
||||
}
|
||||
@ -154,7 +154,7 @@ public class DebuggerThreadsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
protected void addThreads() throws Exception {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread1 = addThread(1, Lifespan.nowOn(0), "A comment");
|
||||
thread2 = addThread(2, Lifespan.span(0, 10), "Another comment");
|
||||
}
|
||||
@ -411,7 +411,7 @@ public class DebuggerThreadsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
assertEquals(1, renderer.getFullRange().max().longValue());
|
||||
});
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
manager.getSnapshot(10, true);
|
||||
}
|
||||
waitForSwing();
|
||||
@ -432,7 +432,7 @@ public class DebuggerThreadsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
traceManager.activateTrace(tb.trace);
|
||||
waitForTasks();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread1.getObject().removeTree(Lifespan.nowOn(16));
|
||||
}
|
||||
waitForTasks();
|
||||
@ -453,7 +453,7 @@ public class DebuggerThreadsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
|
||||
waitForPass(() -> assertThreadsTableSize(2));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread2.getObject().removeTree(Lifespan.ALL);
|
||||
}
|
||||
waitForTasks();
|
||||
|
@ -23,6 +23,7 @@ import java.util.List;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.dialogs.InputDialog;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin;
|
||||
@ -32,7 +33,6 @@ import ghidra.trace.database.time.DBTraceTimeManager;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerTimeProviderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
@ -47,7 +47,7 @@ public class DebuggerTimeProviderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
|
||||
protected void addSnapshots() {
|
||||
DBTraceTimeManager timeManager = tb.trace.getTimeManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceSnapshot first = timeManager.createSnapshot("First");
|
||||
Calendar c = Calendar.getInstance(); // System time zone
|
||||
c.set(2020, 0, 1, 9, 0, 0);
|
||||
@ -60,7 +60,7 @@ public class DebuggerTimeProviderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
|
||||
protected void addScratchSnapshot() {
|
||||
DBTraceTimeManager timeManager = tb.trace.getTimeManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceSnapshot scratch = timeManager.getSnapshot(Long.MIN_VALUE, true);
|
||||
scratch.setDescription("Scratch");
|
||||
scratch.setSchedule(TraceSchedule.parse("0:t0-5"));
|
||||
@ -149,7 +149,7 @@ public class DebuggerTimeProviderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
public void testActivateByThreadThenAddSnapshotsPopulatesProvider() throws Exception {
|
||||
createSnaplessTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.trace.getThreadManager().createThread("Thread 1", 0);
|
||||
}
|
||||
traceManager.openTrace(tb.trace);
|
||||
@ -193,7 +193,7 @@ public class DebuggerTimeProviderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
|
||||
assertProviderPopulated();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getTimeManager().getSnapshot(10, false).delete();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -233,13 +233,13 @@ public class DebuggerTimeProviderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
|
||||
assertProviderEmpty();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
addSnapshots();
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
assertProviderPopulated();
|
||||
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
|
@ -24,6 +24,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
||||
@ -53,7 +54,6 @@ import ghidra.trace.model.memory.*;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.util.TraceRegisterUtils;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -96,7 +96,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
createTrace();
|
||||
r0 = tb.language.getRegister("r0");
|
||||
r1 = tb.language.getRegister("r1");
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Thread1", 0);
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
private void setRegisterValues(TraceThread thread) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regVals =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
regVals.setValue(0, new RegisterValue(r0, BigInteger.valueOf(0x00400000)));
|
||||
@ -595,7 +595,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
}
|
||||
|
||||
protected void setupUnmappedDataSection() throws Throwable {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryOperations mem = tb.trace.getMemoryManager();
|
||||
mem.createRegion("Memory[bin:.data]", 0, tb.range(0x00600000, 0x0060ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.WRITE);
|
||||
@ -612,7 +612,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
intoProject(tb.trace);
|
||||
intoProject(program);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemoryOperations mem = tb.trace.getMemoryManager();
|
||||
mem.createRegion("Memory[bin:.data]", 0, tb.range(0x55750000, 0x5575ffff),
|
||||
TraceMemoryFlag.READ, TraceMemoryFlag.WRITE);
|
||||
@ -624,7 +624,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
programManager.openProgram(program);
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
Memory mem = program.getMemory();
|
||||
mem.createInitializedBlock(".data", tb.addr(stSpace, 0x00600000), 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
@ -633,7 +633,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
DefaultTraceLocation tloc =
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(0), tb.addr(0x55750000));
|
||||
ProgramLocation ploc = new ProgramLocation(program, tb.addr(stSpace, 0x00600000));
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingService.addMapping(tloc, ploc, 0x10000, false);
|
||||
}
|
||||
waitForValue(() -> mappingService.getOpenMappedLocation(tloc));
|
||||
@ -681,7 +681,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
structDt.add(DWordDataType.dataType, "field0", "");
|
||||
structDt.add(DWordDataType.dataType, "field4", "");
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getCodeManager()
|
||||
.definedData()
|
||||
.create(Lifespan.nowOn(0), tb.addr(0x00600000), structDt);
|
||||
@ -705,7 +705,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
structDt.add(DWordDataType.dataType, "field0", "");
|
||||
structDt.add(DWordDataType.dataType, "field4", "");
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add data")) {
|
||||
try (Transaction tx = program.openTransaction("Add data")) {
|
||||
program.getListing().createData(tb.addr(stSpace, 0x00600000), structDt);
|
||||
}
|
||||
|
||||
@ -746,11 +746,11 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
setupMappedDataSection();
|
||||
|
||||
Symbol symbol;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add symbol")) {
|
||||
try (Transaction tx = program.openTransaction("Add symbol")) {
|
||||
symbol = program.getSymbolTable()
|
||||
.createLabel(tb.addr(0x00601234), "my_symbol", SourceType.USER_DEFINED);
|
||||
}
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceMemorySpace regVals =
|
||||
tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
regVals.setValue(0, new RegisterValue(r0, BigInteger.valueOf(0x55751234)));
|
||||
|
@ -17,12 +17,12 @@ package ghidra.app.plugin.core.debug.service.breakpoint;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.dbg.target.schema.SchemaContext;
|
||||
import ghidra.dbg.target.schema.XmlSchemaContext;
|
||||
import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName;
|
||||
import ghidra.dbg.target.schema.XmlSchemaContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.target.TraceObjectKeyPath;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerLogicalBreakpointServiceObjectTest
|
||||
extends DebuggerLogicalBreakpointServiceTest {
|
||||
@ -102,7 +102,7 @@ public class DebuggerLogicalBreakpointServiceObjectTest
|
||||
</context>
|
||||
""", index));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getObjectManager().createRootObject(ctx.getSchema(new SchemaName("Session")));
|
||||
tb.trace.getObjectManager()
|
||||
.createObject(
|
||||
|
@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.service.control.DebuggerControlServicePlugin;
|
||||
@ -46,7 +47,6 @@ import ghidra.trace.model.memory.TraceMemoryRegion;
|
||||
import ghidra.trace.model.modules.TraceStaticMapping;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.datastruct.ListenerMap;
|
||||
|
||||
public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -256,8 +256,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
}
|
||||
|
||||
protected void addProgramTextBlock(Program p) throws Throwable {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Add .text block")) {
|
||||
try (Transaction tx = program.openTransaction("Add .text block")) {
|
||||
p.getMemory()
|
||||
.createInitializedBlock(".text", addr(p, 0x00400000), 0x1000, (byte) 0,
|
||||
monitor, false);
|
||||
@ -281,8 +280,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
Trace t = r.getTrace();
|
||||
TraceMemoryRegion textRegion =
|
||||
waitFor(() -> r.getTraceMemoryRegion(region), "Recorder missed region: " + region);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(t, "Add .text mapping")) {
|
||||
try (Transaction tx = t.openTransaction("Add .text mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(t, null, textRegion.getLifespan(),
|
||||
textRegion.getMinAddress()),
|
||||
@ -293,7 +291,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
|
||||
protected void removeTextMapping(TraceRecorder r, Program p) throws Throwable {
|
||||
Trace t = r.getTrace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(t, "Remove .text mapping")) {
|
||||
try (Transaction tx = t.openTransaction("Remove .text mapping")) {
|
||||
TraceStaticMapping mapping =
|
||||
t.getStaticMappingManager().findContaining(addr(t, 0x55550000), r.getSnap());
|
||||
mapping.delete();
|
||||
@ -342,7 +340,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
}
|
||||
|
||||
protected void addProgramBreakpoints(Program p) throws Throwable {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(p, "Create bookmarks")) {
|
||||
try (Transaction tx = p.openTransaction("Create bookmarks")) {
|
||||
enBm = p.getBookmarkManager()
|
||||
.setBookmark(addr(p, 0x00400123),
|
||||
LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE, "SW_EXECUTE;1", "");
|
||||
@ -363,7 +361,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
}
|
||||
|
||||
protected void removeProgramBreakpoints(Program p) throws Throwable {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(p, "Remove breakpoints")) {
|
||||
try (Transaction tx = p.openTransaction("Remove breakpoints")) {
|
||||
p.getBookmarkManager().removeBookmark(enBm);
|
||||
p.getBookmarkManager().removeBookmark(disBm);
|
||||
}
|
||||
@ -1141,13 +1139,13 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort")) {
|
||||
try (Transaction tx = trace.openTransaction("Will abort")) {
|
||||
addTargetSoftwareBreakpoint(recorder1, text);
|
||||
waitForDomainObject(trace);
|
||||
|
||||
// Sanity
|
||||
assertLogicalBreakpointForMappedSoftwareBreakpoint(trace);
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(trace);
|
||||
|
||||
@ -1179,14 +1177,14 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
waitForDomainObject(trace);
|
||||
changeListener.assertAgreesWithService();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort")) {
|
||||
try (Transaction tx = trace.openTransaction("Will abort")) {
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
// Sanity
|
||||
assertLogicalBreakpointForMappedSoftwareBreakpoint(trace);
|
||||
|
||||
expectMappingChange(() -> tid.abort());
|
||||
expectMappingChange(() -> tx.abort());
|
||||
}
|
||||
|
||||
waitForPass(() -> {
|
||||
@ -1208,7 +1206,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
addProgramTextBlock(program);
|
||||
TestTargetMemoryRegion text = addTargetTextRegion(mb.testProcess1);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort")) {
|
||||
try (Transaction tx = trace.openTransaction("Will abort")) {
|
||||
addTargetSoftwareBreakpoint(recorder1, text);
|
||||
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
@ -1217,7 +1215,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
// Sanity
|
||||
assertLogicalBreakpointForMappedSoftwareBreakpoint(trace);
|
||||
|
||||
expectMappingChange(() -> tid.abort());
|
||||
expectMappingChange(() -> tx.abort());
|
||||
}
|
||||
waitForDomainObject(trace); // Duplicative, but for form's sake....
|
||||
|
||||
@ -1242,13 +1240,13 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Will abort")) {
|
||||
try (Transaction tx = program.openTransaction("Will abort")) {
|
||||
addProgramBreakpoints(program);
|
||||
waitForDomainObject(program);
|
||||
|
||||
// Sanity
|
||||
assertLogicalBreakpointsForMappedBookmarks(trace);
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
||||
@ -1268,7 +1266,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
addProgramTextBlock(program);
|
||||
TestTargetMemoryRegion text = addTargetTextRegion(mb.testProcess1);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will undo")) {
|
||||
try (Transaction tx = trace.openTransaction("Will undo")) {
|
||||
addTargetSoftwareBreakpoint(recorder1, text);
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
}
|
||||
@ -1310,7 +1308,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Will undo")) {
|
||||
try (Transaction tx = program.openTransaction("Will undo")) {
|
||||
addProgramBreakpoints(program);
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
@ -1536,7 +1534,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
|
||||
protected void addTextMappingDead(Program p, ToyDBTraceBuilder tb) throws Throwable {
|
||||
addProgramTextBlock(p);
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tid = tb.startTransaction()) {
|
||||
TraceMemoryRegion textRegion = tb.trace.getMemoryManager()
|
||||
.addRegion("Processes[1].Memory[bin:.text]", Lifespan.nowOn(0),
|
||||
tb.range(0x55550000, 0x55550fff),
|
||||
@ -1550,8 +1548,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
}
|
||||
|
||||
protected void addEnabledProgramBreakpointWithSleigh(Program p) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(p, "Create bookmark bp with sleigh")) {
|
||||
try (Transaction tid = p.openTransaction("Create bookmark bp with sleigh")) {
|
||||
enBm = p.getBookmarkManager()
|
||||
.setBookmark(addr(p, 0x00400123),
|
||||
LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE, "SW_EXECUTE;1",
|
||||
@ -1632,7 +1629,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
||||
intoProject(program);
|
||||
programManager.openProgram(program);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tid = tb.startTransaction()) {
|
||||
TraceBreakpoint bpt = tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Processes[1].Breakpoints[0]", Lifespan.nowOn(0),
|
||||
tb.addr(0x55550123),
|
||||
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.service.control;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerTargetTraceMapper;
|
||||
import ghidra.app.plugin.core.debug.mapping.ObjectBasedDebuggerTargetTraceMapper;
|
||||
import ghidra.app.plugin.core.debug.service.model.DebuggerModelServicePlugin;
|
||||
@ -28,13 +29,12 @@ import ghidra.program.model.lang.LanguageID;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.guest.TraceGuestPlatform;
|
||||
import ghidra.trace.model.guest.TracePlatform;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerControlServiceGuestTest extends DebuggerControlServiceTest {
|
||||
protected TraceGuestPlatform platform;
|
||||
|
||||
public void createToyPlatform() {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
platform = tb.trace.getPlatformManager()
|
||||
.addGuestPlatform(getToyBE64Language().getDefaultCompilerSpec());
|
||||
platform.addMappedRegisterRange();
|
||||
|
@ -23,10 +23,10 @@ import java.nio.ByteBuffer;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.assembler.*;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.service.control.DebuggerControlServicePlugin;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.DebuggerControlService.StateEditor;
|
||||
import ghidra.async.AsyncUtils.TemperamentalRunnable;
|
||||
@ -38,7 +38,6 @@ import ghidra.trace.model.guest.TracePlatform;
|
||||
import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
protected DebuggerControlService editingService;
|
||||
@ -134,7 +133,7 @@ public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
createAndOpenTrace();
|
||||
editingService.setCurrentMode(tb.trace, ControlMode.RW_EMULATOR);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// NB. TraceManager should automatically activate the first thread
|
||||
tb.getOrAddThread("Threads[0]", 0);
|
||||
}
|
||||
@ -161,7 +160,7 @@ public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
editingService.setCurrentMode(tb.trace, ControlMode.RW_EMULATOR);
|
||||
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// NB. TraceManager should automatically activate the first thread
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
}
|
||||
@ -189,7 +188,7 @@ public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
createAndOpenTrace();
|
||||
editingService.setCurrentMode(tb.trace, ControlMode.RW_TRACE);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// NB. TraceManager should automatically activate the first thread
|
||||
TraceThread thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
Assembler asm = Assemblers.getAssembler(getPlatform().getLanguage());
|
||||
@ -228,7 +227,7 @@ public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
editingService.setCurrentMode(tb.trace, ControlMode.RW_TRACE);
|
||||
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// NB. TraceManager should automatically activate the first thread
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
Assembler asm = Assemblers.getAssembler(getPlatform().getLanguage());
|
||||
@ -267,7 +266,7 @@ public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
createAndOpenTrace();
|
||||
editingService.setCurrentMode(tb.trace, ControlMode.RW_EMULATOR);
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// NB. TraceManager should automatically activate the first thread
|
||||
tb.getOrAddThread("Threads[0]", 0);
|
||||
}
|
||||
@ -297,7 +296,7 @@ public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
editingService.setCurrentMode(tb.trace, ControlMode.RW_EMULATOR);
|
||||
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// NB. TraceManager should automatically activate the first thread
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
}
|
||||
@ -367,7 +366,7 @@ public class DebuggerControlServiceTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
editingService.setCurrentMode(tb.trace, ControlMode.RW_TRACE);
|
||||
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
// NB. TraceManager should automatically activate the first thread
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.assembler.*;
|
||||
@ -36,8 +37,8 @@ import ghidra.app.plugin.core.debug.mapping.DebuggerPlatformMapper;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerPlatformOpinion;
|
||||
import ghidra.app.plugin.core.debug.service.platform.DebuggerPlatformServicePlugin;
|
||||
import ghidra.app.services.DebuggerEmulationService.EmulationResult;
|
||||
import ghidra.app.services.DebuggerTraceManagerService.ActivationCause;
|
||||
import ghidra.app.services.DebuggerStaticMappingService;
|
||||
import ghidra.app.services.DebuggerTraceManagerService.ActivationCause;
|
||||
import ghidra.pcode.exec.InterruptPcodeExecutionException;
|
||||
import ghidra.pcode.utils.Utils;
|
||||
import ghidra.program.model.address.Address;
|
||||
@ -57,7 +58,6 @@ import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.Scheduler;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
@Category(NightlyCategory.class) // this may actually be an @PortSensitive test
|
||||
@ -84,7 +84,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Register regPC = program.getRegister("pc");
|
||||
Register regR0 = program.getRegister("r0");
|
||||
Register regR1 = program.getRegister("r1");
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -139,7 +139,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Register regPC = program.getRegister("pc");
|
||||
Register regR0 = program.getRegister("r0");
|
||||
Register regR1 = program.getRegister("r1");
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -197,7 +197,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Register regPC = program.getRegister("PC");
|
||||
Register regW0 = program.getRegister("W0");
|
||||
Register regW1 = program.getRegister("W1");
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -251,7 +251,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Memory memory = program.getMemory();
|
||||
Address addrText = addr(program, 0x00400000);
|
||||
Address addrData = addr(program, 0x00600000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock("text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -271,7 +271,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
CompletableFuture<Void> settled;
|
||||
TraceThread thread;
|
||||
TraceMemorySpace regs;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
regs = tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
regs.setValue(0, new RegisterValue(program.getLanguage().getProgramCounter(),
|
||||
@ -304,7 +304,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
AssemblyBuffer buf = new AssemblyBuffer(asm, tb.addr(x64, 0x00400000));
|
||||
TraceMemoryManager mem = tb.trace.getMemoryManager();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
buf.assemble("MOV RAX, qword ptr [0x00600800]");
|
||||
mem.putBytes(0, tb.addr(0x00400000), ByteBuffer.wrap(buf.getBytes()));
|
||||
@ -330,7 +330,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
waitForPass(() -> assertEquals(x64, traceManager.getCurrentPlatform().getLanguage()));
|
||||
TracePlatform platform = traceManager.getCurrentPlatform();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.exec(platform, 0, thread, 0, "RIP = 0x00400000;");
|
||||
}
|
||||
|
||||
@ -355,7 +355,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Register regR1 = program.getRegister("r1");
|
||||
Register regR2 = program.getRegister("r2");
|
||||
Address addrI2;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -381,7 +381,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
TraceThread thread = Unique.assertOne(trace.getThreadManager().getAllThreads());
|
||||
TraceMemorySpace regs = trace.getMemoryManager().getMemoryRegisterSpace(thread, false);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add breakpoint")) {
|
||||
try (Transaction tx = trace.openTransaction("Add breakpoint")) {
|
||||
trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), addrI2, Set.of(thread),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "test");
|
||||
@ -414,7 +414,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Address addrText = addr(program, 0x000400000);
|
||||
Address addrI1;
|
||||
Address addrI2;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -439,7 +439,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
|
||||
TraceThread thread = Unique.assertOne(trace.getThreadManager().getAllThreads());
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add breakpoint")) {
|
||||
try (Transaction tx = trace.openTransaction("Add breakpoint")) {
|
||||
trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), addrText, Set.of(thread),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "test");
|
||||
@ -476,7 +476,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Register regR1 = program.getRegister("r1");
|
||||
Register regR2 = program.getRegister("r2");
|
||||
Address addrI2;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -502,7 +502,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
TraceThread thread = Unique.assertOne(trace.getThreadManager().getAllThreads());
|
||||
TraceMemorySpace regs = trace.getMemoryManager().getMemoryRegisterSpace(thread, false);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add breakpoint")) {
|
||||
try (Transaction tx = trace.openTransaction("Add breakpoint")) {
|
||||
TraceBreakpoint tb = trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), addrI2, Set.of(thread),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "test");
|
||||
@ -542,7 +542,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Register regR0 = program.getRegister("r0");
|
||||
Register regR1 = program.getRegister("r1");
|
||||
Register regR2 = program.getRegister("r2");
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -568,7 +568,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
TraceMemoryManager mem = trace.getMemoryManager();
|
||||
TraceMemorySpace regs = mem.getMemoryRegisterSpace(thread, false);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add breakpoint")) {
|
||||
try (Transaction tx = trace.openTransaction("Add breakpoint")) {
|
||||
trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), addr(trace, 0x1234),
|
||||
Set.of(thread), Set.of(TraceBreakpointKind.READ), true, "test");
|
||||
@ -605,7 +605,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
Register regR0 = program.getRegister("r0");
|
||||
Register regR2 = program.getRegister("r2");
|
||||
Address addrI2;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
try (Transaction tx = program.openTransaction("Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
@ -646,7 +646,7 @@ public class DebuggerEmulationServiceTest extends AbstractGhidraHeadedDebuggerGU
|
||||
regs.getViewValue(scratch, regR2).getUnsignedValue());
|
||||
|
||||
// Inject some logic that would require a cache refresh to materialize
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add breakpoint")) {
|
||||
try (Transaction tx = trace.openTransaction("Add breakpoint")) {
|
||||
TraceBreakpoint tb = trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), addrI2, Set.of(thread),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "test");
|
||||
|
@ -22,6 +22,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerRegisterMapper;
|
||||
import ghidra.app.services.ActionSource;
|
||||
@ -36,7 +37,6 @@ import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.listing.TraceCodeSpace;
|
||||
import ghidra.trace.model.memory.*;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class DefaultTraceRecorderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
@ -73,8 +73,7 @@ public class DefaultTraceRecorderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
}
|
||||
|
||||
protected TraceMemorySpace createRegSpace(TraceThread thread) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Create register space")) {
|
||||
try (Transaction tx = thread.getTrace().openTransaction("Create register space")) {
|
||||
return thread.getTrace().getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
}
|
||||
}
|
||||
@ -140,7 +139,7 @@ public class DefaultTraceRecorderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(),
|
||||
r -> r.isBaseRegister() && r != pc && r != sp);
|
||||
TestTargetRegisterBankInThread regs = mb.testThread1.addRegisterBank();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add PC type")) {
|
||||
try (Transaction tx = trace.openTransaction("Add PC type")) {
|
||||
TraceCodeSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
code.definedData().create(Lifespan.nowOn(0), pc, PointerDataType.dataType);
|
||||
}
|
||||
@ -189,7 +188,7 @@ public class DefaultTraceRecorderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(),
|
||||
r -> r.isBaseRegister() && r != pc && r != sp);
|
||||
TestTargetRegisterBankInThread regs = mb.testThread1.addRegisterBank();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add SP type")) {
|
||||
try (Transaction tx = trace.openTransaction("Add SP type")) {
|
||||
TraceCodeSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
code.definedData().create(Lifespan.nowOn(0), sp, PointerDataType.dataType);
|
||||
}
|
||||
@ -238,7 +237,7 @@ public class DefaultTraceRecorderTest extends AbstractGhidraHeadedDebuggerGUITes
|
||||
|
||||
//waitForCondition(() -> registerMapped(recorder, thread, pc));
|
||||
TraceThread thread = waitForValue(() -> recorder.getTraceThread(mb.testThread1));
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add PC type")) {
|
||||
try (Transaction tx = trace.openTransaction("Add PC type")) {
|
||||
TraceCodeSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
code.definedData().create(Lifespan.nowOn(0), pc, PointerDataType.dataType);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import java.util.*;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.services.DebuggerStaticMappingService;
|
||||
import ghidra.app.services.DebuggerStaticMappingService.MappedAddressRange;
|
||||
@ -37,7 +38,6 @@ import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.memory.TraceMemoryRegion;
|
||||
import ghidra.trace.model.modules.*;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
// Not technically a GUI test, but must be carried out in the context of a plugin tool
|
||||
public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -75,7 +75,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(0),
|
||||
dynSpace.getAddress(0x00100000));
|
||||
ProgramLocation to = new ProgramLocation(program, stSpace.getAddress(0x00200000));
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DebuggerStaticMappingUtils.addMapping(from, to, 0x1000, false);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -85,7 +85,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg
|
||||
TraceLocation from = new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(10),
|
||||
dynSpace.getAddress(0x00100800));
|
||||
ProgramLocation to = new ProgramLocation(program, stSpace.getAddress(0x00300000));
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DebuggerStaticMappingUtils.addMapping(from, to, 0x1000, truncateExisting);
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(0),
|
||||
dynSpace.getAddress(0x00102000));
|
||||
ProgramLocation to = new ProgramLocation(program, stSpace.getAddress(0x00200000));
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DebuggerStaticMappingUtils.addMapping(from, to, 0x800, false);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -550,12 +550,12 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg
|
||||
TraceLocation goodLoc =
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(0),
|
||||
dynSpace.getAddress(0x00100c0d));
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingManager.findContaining(dynSpace.getAddress(0x00100000), 0).delete();
|
||||
waitForDomainObject(tb.trace);
|
||||
// pre-check
|
||||
assertNull(mappingService.getOpenMappedLocation(goodLoc));
|
||||
tid.abort();
|
||||
tx.abort();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
@ -573,7 +573,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg
|
||||
// pre-pre-check
|
||||
assertNotNull(mappingService.getOpenMappedLocation(goodLoc));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
mappingManager.findContaining(dynSpace.getAddress(0x00100000), 0).delete();
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -594,7 +594,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg
|
||||
public void testGroupRegionsByLikelyModule() throws Exception {
|
||||
TraceMemoryRegion echoText, echoData, libText, libData;
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
echoText = mm.createRegion("Memory.Regions[/bin/echo (0x00400000)]",
|
||||
0, tb.range(0x00400000, 0x0040ffff), TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
|
||||
echoData = mm.createRegion("Memory.Regions[/bin/echo (0x00600000)]",
|
||||
@ -620,7 +620,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg
|
||||
|
||||
@Test
|
||||
public void testMapFullSpace() throws Exception {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
TraceLocation traceLoc =
|
||||
new DefaultTraceLocation(tb.trace, null, Lifespan.nowOn(0), tb.addr(0));
|
||||
ProgramLocation progLoc = new ProgramLocation(program, stSpace.getAddress(0));
|
||||
|
@ -23,6 +23,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.test.category.NightlyCategory;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
@ -42,7 +43,6 @@ import ghidra.trace.model.target.TraceObject;
|
||||
import ghidra.trace.model.target.TraceObjectKeyPath;
|
||||
import ghidra.trace.model.thread.TraceObjectThread;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
@Category(NightlyCategory.class) // this may actually be an @PortSensitive test
|
||||
public class DebuggerTraceManagerServiceTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
@ -131,7 +131,7 @@ public class DebuggerTraceManagerServiceTest extends AbstractGhidraHeadedDebugge
|
||||
assertNull(traceManager.getCurrentThread());
|
||||
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Thread 1", 0);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -231,7 +231,7 @@ public class DebuggerTraceManagerServiceTest extends AbstractGhidraHeadedDebugge
|
||||
|
||||
SchemaContext ctx = XmlSchemaContext.deserialize(DBTraceObjectManagerTest.XML_CTX);
|
||||
TraceObject objThread0;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceObjectManager objectManager = tb.trace.getObjectManager();
|
||||
objectManager.createRootObject(ctx.getSchema(new SchemaName("Session"))).getChild();
|
||||
objThread0 =
|
||||
|
@ -25,6 +25,7 @@ import java.util.function.Predicate;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.widgets.fieldpanel.Layout;
|
||||
import docking.widgets.fieldpanel.field.Field;
|
||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||
@ -48,8 +49,8 @@ import ghidra.app.plugin.core.decompile.DecompilePlugin;
|
||||
import ghidra.app.plugin.core.decompile.DecompilerProvider;
|
||||
import ghidra.app.plugin.core.disassembler.DisassemblerPlugin;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.DebuggerEmulationService.EmulationResult;
|
||||
import ghidra.app.services.DebuggerControlService.StateEditor;
|
||||
import ghidra.app.services.DebuggerEmulationService.EmulationResult;
|
||||
import ghidra.app.util.viewer.field.FieldFactory;
|
||||
import ghidra.app.util.viewer.field.ListingField;
|
||||
import ghidra.app.util.viewer.listingpanel.ListingPanel;
|
||||
@ -78,7 +79,6 @@ import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.Scheduler;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.NumericUtilities;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
@ -135,7 +135,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
protected Function createSumSquaresProgramX86_32() throws Throwable {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
Address entry = addr(program, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
|
||||
@ -199,7 +199,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
protected Function createFibonacciProgramX86_32() throws Throwable {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
Address entry = addr(program, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
|
||||
@ -276,7 +276,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
Address entry;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
entry = addr(program, 0x00400000);
|
||||
Address externs = addr(program, 0x00700000);
|
||||
program.getMemory()
|
||||
@ -338,7 +338,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
Address entry;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
entry = addr(program, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
|
||||
@ -393,7 +393,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
Address entry = addr(program, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
|
||||
@ -430,7 +430,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
ProgramBasedDataTypeManager dtm = program.getDataTypeManager();
|
||||
Structure structure = new StructureDataType("MyStruct", 0, dtm);
|
||||
structure.add(WordDataType.dataType, "y", "");
|
||||
@ -515,7 +515,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
createProgram("x86:LE:32:default", "gcc");
|
||||
intoProject(program);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Assemble")) {
|
||||
try (Transaction tx = program.openTransaction("Assemble")) {
|
||||
ProgramBasedDataTypeManager dtm = program.getDataTypeManager();
|
||||
Structure structure = new StructureDataType("MyStruct", 0, dtm);
|
||||
structure.add(WordDataType.dataType, "y", "");
|
||||
@ -702,7 +702,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
waitOn(frameAtSetup.setValue(editor, param1, BigInteger.valueOf(4)));
|
||||
waitForTasks();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr, Set.of(),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "capture return value");
|
||||
@ -764,7 +764,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
waitForTasks();
|
||||
|
||||
TraceBreakpoint bptUnwind;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
bptUnwind = tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
|
||||
Set.of(),
|
||||
@ -802,7 +802,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
}
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
bptUnwind.delete();
|
||||
}
|
||||
|
||||
@ -845,7 +845,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
waitForSwing();
|
||||
|
||||
DebuggerCoordinates atSetup = traceManager.getCurrent();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
new UnwindStackCommand(tool, atSetup).applyTo(tb.trace, monitor);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -907,7 +907,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
waitOn(frameAtSetup.setReturnAddress(editor, tb.addr(0xdeadbeef)));
|
||||
waitForTasks();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
|
||||
Set.of(),
|
||||
@ -921,7 +921,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
traceManager.activateTime(result.schedule());
|
||||
waitForTasks();
|
||||
DebuggerCoordinates tallest = traceManager.getCurrent();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
new UnwindStackCommand(tool, tallest).applyTo(tb.trace, monitor);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -950,7 +950,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
Register sp = program.getCompilerSpec().getStackPointer();
|
||||
waitOn(editor.setRegister(new RegisterValue(sp, BigInteger.valueOf(0x4ff0))));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
|
||||
Set.of(),
|
||||
@ -965,7 +965,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
traceManager.activateTime(result.schedule());
|
||||
waitForTasks();
|
||||
DebuggerCoordinates atRet = traceManager.getCurrent();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
new UnwindStackCommand(tool, atRet).applyTo(tb.trace, monitor);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -994,7 +994,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
Register sp = program.getCompilerSpec().getStackPointer();
|
||||
waitOn(editor.setRegister(new RegisterValue(sp, BigInteger.valueOf(0x4ff0))));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
|
||||
Set.of(),
|
||||
@ -1009,7 +1009,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
traceManager.activateTime(result.schedule());
|
||||
waitForTasks();
|
||||
DebuggerCoordinates atRet = traceManager.getCurrent();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
new UnwindStackCommand(tool, atRet).applyTo(tb.trace, monitor);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -1038,7 +1038,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
Register sp = program.getCompilerSpec().getStackPointer();
|
||||
waitOn(editor.setRegister(new RegisterValue(sp, BigInteger.valueOf(0x4ff0))));
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getBreakpointManager()
|
||||
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
|
||||
Set.of(),
|
||||
@ -1053,7 +1053,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
traceManager.activateTime(result.schedule());
|
||||
waitForTasks();
|
||||
DebuggerCoordinates atRet = traceManager.getCurrent();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
new UnwindStackCommand(tool, atRet).applyTo(tb.trace, monitor);
|
||||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
@ -1261,7 +1261,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
TraceLocation dynLoc = mappingService.getOpenMappedLocation(tb.trace,
|
||||
new ProgramLocation(program, stIns.getAddress()), current.getSnap());
|
||||
Address dynamicAddress = dynLoc.getAddress();
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
int length = stIns.getLength();
|
||||
assertEquals(length, tb.trace.getMemoryManager()
|
||||
.putBytes(current.getSnap(), dynamicAddress,
|
||||
|
@ -29,6 +29,7 @@ import java.util.function.Function;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import generic.Unique;
|
||||
import ghidra.app.plugin.assembler.Assembler;
|
||||
import ghidra.app.plugin.assembler.Assemblers;
|
||||
@ -65,7 +66,6 @@ import ghidra.trace.model.memory.TraceMemoryFlag;
|
||||
import ghidra.trace.model.stack.TraceStack;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
@ -187,7 +187,7 @@ public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
}
|
||||
waitForSwing();
|
||||
@ -217,7 +217,7 @@ public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
|
||||
createAndOpenTrace();
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
TraceStack stack = tb.trace.getStackManager().getStack(thread, 0, true);
|
||||
stack.setDepth(3, true);
|
||||
@ -289,7 +289,7 @@ public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
createTrace();
|
||||
}
|
||||
TraceThread thread;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
thread = tb.getOrAddThread("Threads[0]", 0);
|
||||
TraceStack stack = tb.trace.getStackManager().getStack(thread, 0, true);
|
||||
stack.setDepth(3, true);
|
||||
@ -354,7 +354,7 @@ public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
protected void createTraceWithBinText() throws Throwable {
|
||||
createAndOpenTrace();
|
||||
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
DBTraceMemoryManager mm = tb.trace.getMemoryManager();
|
||||
mm.createRegion("Memory[bin.text]", 0, tb.range(0x00400000, 0x0040ffff),
|
||||
Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE));
|
||||
@ -401,14 +401,14 @@ public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
programManager.openProgram(program);
|
||||
traceManager.activateTrace(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "add block")) {
|
||||
try (Transaction tx = program.openTransaction("add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 4096, (byte) 0,
|
||||
monitor, false);
|
||||
}
|
||||
|
||||
CompletableFuture<Void> changesSettled;
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
try (Transaction tx = tb.startTransaction()) {
|
||||
tb.trace.getMemoryManager()
|
||||
.createRegion("Memory[bin.text]", 0, tb.range(0x00400000, 0x00400fff),
|
||||
Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE));
|
||||
@ -463,7 +463,7 @@ public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
programManager.openProgram(program);
|
||||
|
||||
Address entry = addr(program, 0x00400000);
|
||||
try (UndoableTransaction start = UndoableTransaction.start(program, "init")) {
|
||||
try (Transaction start = program.openTransaction("init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", entry, 4096, (byte) 0,
|
||||
monitor, false);
|
||||
@ -1050,7 +1050,7 @@ public class FlatDebuggerAPITest extends AbstractGhidraHeadedDebuggerGUITest {
|
||||
programManager.openProgram(program);
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
try (Transaction tx = program.openTransaction("Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(
|
||||
".text", addr(program, 0x00400000), 1024, (byte) 0, monitor, false);
|
||||
|
@ -22,6 +22,7 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import db.Transaction;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerRegisterMapper;
|
||||
@ -40,7 +41,6 @@ import ghidra.trace.model.memory.TraceMemorySpace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||
import ghidra.util.database.UndoableTransaction;
|
||||
|
||||
/**
|
||||
* Test the {@link DirectBytesTracePcodeExecutorState} in combination with
|
||||
@ -127,7 +127,7 @@ public class TraceRecorderPcodeExecTest extends AbstractGhidraHeadedDebuggerGUIT
|
||||
});
|
||||
|
||||
TraceSchedule oneTick = TraceSchedule.snap(recorder.getSnap()).steppedForward(thread, 1);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Scratch")) {
|
||||
try (Transaction tx = trace.openTransaction("Scratch")) {
|
||||
TraceSnapshot scratch = trace.getTimeManager().getSnapshot(Long.MIN_VALUE, true);
|
||||
scratch.setSchedule(oneTick);
|
||||
scratch.setDescription("Faked");
|
||||
|
@ -23,6 +23,7 @@ import org.apache.commons.collections4.collection.CompositeCollection;
|
||||
|
||||
import com.google.common.cache.RemovalNotification;
|
||||
|
||||
import db.Transaction;
|
||||
import db.DBHandle;
|
||||
import generic.depends.DependentService;
|
||||
import generic.depends.err.ServiceConstructionException;
|
||||
@ -165,7 +166,7 @@ public class DBTrace extends DBCachedDomainObjectAdapter implements Trace, Trace
|
||||
this.baseAddressFactory =
|
||||
new TraceAddressFactory(this.baseLanguage, this.baseCompilerSpec);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(this, "Create")) {
|
||||
try (Transaction tx = this.openTransaction("Create")) {
|
||||
initOptions(DBOpenMode.CREATE);
|
||||
init();
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user