mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/GP-2437_Dan_addressFixedSizeEncoding-REBASED-1--SQUASHED'
This commit is contained in:
commit
fcac56d59f
114 changed files with 2354 additions and 652 deletions
|
@ -74,7 +74,7 @@ public class BreakpointLocationRow {
|
|||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint name", true)) {
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint name")) {
|
||||
loc.setName(name);
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public class BreakpointLocationRow {
|
|||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint comment", true)) {
|
||||
UndoableTransaction.start(loc.getTrace(), "Set breakpoint comment")) {
|
||||
loc.setComment(comment);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -830,7 +830,7 @@ public class DebuggerCopyIntoProgramDialog extends DialogComponentProvider {
|
|||
Program dest = getDestination().getOrCreateProgram(source, this);
|
||||
boolean doRelease = !Arrays.asList(programManager.getAllOpenPrograms()).contains(dest);
|
||||
TraceRecorder recorder = getRecorderIfEnabledAndReadsPresent();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(dest, "Copy From Trace", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(dest, "Copy From Trace")) {
|
||||
monitor.initialize(tableModel.getRowCount());
|
||||
for (RangeEntry entry : tableModel.getModelData()) {
|
||||
monitor.setMessage("Copying into " + entry.getDstRange());
|
||||
|
|
|
@ -35,9 +35,8 @@ public class RegionRow {
|
|||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Renamed region", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Rename region")) {
|
||||
region.setName(name);
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,7 +75,7 @@ public class RegionRow {
|
|||
|
||||
public void setRead(boolean read) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region read flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region read flag")) {
|
||||
region.setRead(read);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +86,7 @@ public class RegionRow {
|
|||
|
||||
public void setWrite(boolean write) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region write flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region write flag")) {
|
||||
region.setWrite(write);
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +97,7 @@ public class RegionRow {
|
|||
|
||||
public void setExecute(boolean execute) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region execute flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region execute flag")) {
|
||||
region.setExecute(execute);
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +108,7 @@ public class RegionRow {
|
|||
|
||||
public void setVolatile(boolean vol) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region volatile flag", true)) {
|
||||
UndoableTransaction.start(region.getTrace(), "Toggle region volatile flag")) {
|
||||
region.setVolatile(vol);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -303,12 +303,10 @@ public class DebuggerStaticMappingProvider extends ComponentProviderAdapter
|
|||
// TODO: Action to adjust life span?
|
||||
// Note: provider displays mappings for all time, so delete means delete, not truncate
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Remove Static Mappings", false)) {
|
||||
UndoableTransaction.start(currentTrace, "Remove Static Mappings")) {
|
||||
for (StaticMappingRow mapping : ctx.getSelectedMappings()) {
|
||||
mapping.getMapping().delete();
|
||||
}
|
||||
// TODO: Do I want all-or-nothing among all transactions?
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class ModuleRow {
|
|||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(module.getTrace(), "Renamed module", true)) {
|
||||
UndoableTransaction.start(module.getTrace(), "Renamed module")) {
|
||||
module.setName(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class SectionRow {
|
|||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(section.getTrace(), "Renamed section", true)) {
|
||||
UndoableTransaction.start(section.getTrace(), "Rename section")) {
|
||||
section.setName(name);
|
||||
}
|
||||
catch (DuplicateNameException e) {
|
||||
|
|
|
@ -229,7 +229,7 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {
|
|||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Resolve DataType", true)) {
|
||||
UndoableTransaction.start(current.getTrace(), "Resolve DataType")) {
|
||||
return current.getTrace().getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -367,7 +367,7 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
|||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType", true)) {
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType")) {
|
||||
return currentTrace.getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
|
@ -832,14 +832,13 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
|
|||
*/
|
||||
void writeRegisterDataType(Register register, DataType dataType) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Edit Register Type", false)) {
|
||||
UndoableTransaction.start(current.getTrace(), "Edit Register Type")) {
|
||||
TraceCodeRegisterSpace space = getRegisterMemorySpace(true).getCodeSpace(true);
|
||||
long snap = current.getViewSnap();
|
||||
space.definedUnits().clear(Range.closed(snap, snap), register, TaskMonitor.DUMMY);
|
||||
if (dataType != null) {
|
||||
space.definedData().create(Range.atLeast(snap), register, dataType);
|
||||
}
|
||||
tid.commit();
|
||||
}
|
||||
catch (CodeUnitInsertionException | CancelledException e) {
|
||||
throw new AssertionError(e);
|
||||
|
|
|
@ -79,8 +79,8 @@ public class StackFrameRow {
|
|||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid = UndoableTransaction
|
||||
.start(frame.getStack().getThread().getTrace(), "Frame comment", true)) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(frame.getStack().getThread().getTrace(), "Frame comment")) {
|
||||
frame.setComment(getSnap(), comment);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class ThreadRow {
|
|||
|
||||
public void setName(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Renamed thread", true)) {
|
||||
UndoableTransaction.start(thread.getTrace(), "Rename thread")) {
|
||||
thread.setName(name);
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class ThreadRow {
|
|||
|
||||
public void setComment(String comment) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Renamed thread", true)) {
|
||||
UndoableTransaction.start(thread.getTrace(), "Rename thread")) {
|
||||
thread.setComment(comment);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ public class DebuggerTimePlugin extends AbstractDebuggerPlugin {
|
|||
if (dialog.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Rename Snapshot", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Rename Snapshot")) {
|
||||
if (snapshot == null) {
|
||||
snapshot = manager.getSnapshot(snap, true);
|
||||
}
|
||||
|
|
|
@ -61,9 +61,8 @@ public class SnapshotRow {
|
|||
|
||||
public void setDescription(String description) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Modify snapshot description", false)) {
|
||||
UndoableTransaction.start(trace, "Modify snapshot description")) {
|
||||
snapshot.setDescription(description);
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter {
|
|||
return null;
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType", true)) {
|
||||
UndoableTransaction.start(currentTrace, "Resolve DataType")) {
|
||||
return currentTrace.getDataTypeManager().resolve(dataType, null);
|
||||
}
|
||||
}
|
||||
|
@ -523,7 +523,7 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter {
|
|||
}
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(current.getTrace(), "Apply Watch Data Type", true)) {
|
||||
UndoableTransaction.start(current.getTrace(), "Apply Watch Data Type")) {
|
||||
try {
|
||||
listing.clearCodeUnits(row.getAddress(), row.getRange().getMaxAddress(), false);
|
||||
listing.createData(address, dataType, size);
|
||||
|
|
|
@ -54,9 +54,9 @@ public class DefaultDebuggerPlatformMapper extends AbstractDebuggerPlatformMappe
|
|||
|
||||
@Override
|
||||
public void addToTrace(long snap) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add guest " +
|
||||
cSpec.getLanguage().getLanguageDescription() + "/" + cSpec.getCompilerSpecDescription(),
|
||||
true)) {
|
||||
String description = "Add guest " + cSpec.getLanguage().getLanguageDescription() + "/" +
|
||||
cSpec.getCompilerSpecDescription();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, description)) {
|
||||
TracePlatformManager platformManager = trace.getPlatformManager();
|
||||
TracePlatform platform = platformManager.getOrAddPlatform(cSpec);
|
||||
if (platform.isHost()) {
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ObjectBasedDebuggerMemoryMapper implements DebuggerMemoryMapper {
|
|||
|
||||
protected AddressSpace createSpace(String name) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Create space for mapping", true)) {
|
||||
UndoableTransaction.start(trace, "Create space for mapping")) {
|
||||
AddressFactory factory = trace.getBaseAddressFactory();
|
||||
AddressSpace space = factory.getAddressSpace(name);
|
||||
if (space == null) {
|
||||
|
|
|
@ -128,9 +128,8 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
|||
throw new IllegalStateException("Must save breakpoint to program before naming it");
|
||||
}
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Rename breakpoint", false)) {
|
||||
UndoableTransaction.start(program, "Rename breakpoint")) {
|
||||
bookmark.set(bookmark.getCategory(), name);
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,8 +153,7 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
|||
// volatile reads
|
||||
Bookmark eBookmark = this.eBookmark;
|
||||
Bookmark dBookmark = this.dBookmark;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Clear breakpoint", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Clear breakpoint")) {
|
||||
BookmarkManager bookmarkManager = program.getBookmarkManager();
|
||||
if (eBookmark != null) {
|
||||
bookmarkManager.removeBookmark(eBookmark);
|
||||
|
@ -165,7 +163,6 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
|||
}
|
||||
// (e,d)Bookmark Gets nulled on program change callback
|
||||
// If null here, logical breakpoint manager will get confused
|
||||
tid.commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,7 +247,7 @@ public interface LogicalBreakpointInternal extends LogicalBreakpoint {
|
|||
String delType =
|
||||
enabled ? BREAKPOINT_DISABLED_BOOKMARK_TYPE : BREAKPOINT_ENABLED_BOOKMARK_TYPE;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Enable breakpoint", true)) {
|
||||
UndoableTransaction.start(program, "Enable breakpoint")) {
|
||||
BookmarkManager manager = program.getBookmarkManager();
|
||||
String catStr = computeCategory();
|
||||
manager.setBookmark(address, addType, catStr, comment);
|
||||
|
|
|
@ -156,7 +156,7 @@ public class DebuggerStateEditingServicePlugin extends AbstractDebuggerPlugin
|
|||
long snap = coordinates.getViewSnap();
|
||||
TraceMemoryOperations memOrRegs;
|
||||
try (UndoableTransaction txid =
|
||||
UndoableTransaction.start(trace, "Edit Variable", true)) {
|
||||
UndoableTransaction.start(trace, "Edit Variable")) {
|
||||
if (address.isRegisterAddress()) {
|
||||
TraceThread thread = coordinates.getThread();
|
||||
if (thread == null) {
|
||||
|
|
|
@ -105,7 +105,7 @@ public abstract class AbstractReadsTargetPcodeExecutorState
|
|||
}
|
||||
else {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Create space", true)) {
|
||||
UndoableTransaction.start(trace, "Create space")) {
|
||||
tms = TraceSleighUtils.getSpaceForExecution(s, trace, thread, frame, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -403,7 +403,7 @@ public class DebuggerEmulationServicePlugin extends Plugin implements DebuggerEm
|
|||
time.execute(trace, emu, monitor);
|
||||
}
|
||||
TraceSnapshot destSnap;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate")) {
|
||||
destSnap = findScratch(trace, time);
|
||||
emu.writeDown(trace, destSnap.getKey(), time.getSnap(), false);
|
||||
}
|
||||
|
|
|
@ -293,13 +293,12 @@ public enum ProgramEmulationUtils {
|
|||
boolean success = false;
|
||||
try {
|
||||
trace = new DBTrace(getTraceName(program), program.getCompilerSpec(), consumer);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Emulate")) {
|
||||
TraceSnapshot initial =
|
||||
trace.getTimeManager().createSnapshot(EMULATION_STARTED_AT + pc);
|
||||
long snap = initial.getKey();
|
||||
loadExecutable(initial, program);
|
||||
doLaunchEmulationThread(trace, snap, program, pc, pc);
|
||||
tid.commit();
|
||||
}
|
||||
success = true;
|
||||
return trace;
|
||||
|
@ -339,9 +338,8 @@ public enum ProgramEmulationUtils {
|
|||
public static TraceThread launchEmulationThread(Trace trace, long snap, Program program,
|
||||
Address tracePc, Address programPc) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Emulate new Thread", false)) {
|
||||
UndoableTransaction.start(trace, "Emulate new Thread")) {
|
||||
TraceThread thread = doLaunchEmulationThread(trace, snap, program, tracePc, programPc);
|
||||
tid.commit();
|
||||
return thread;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import ghidra.util.database.UndoableTransaction;
|
|||
public class RecorderPermanentTransaction implements AutoCloseable {
|
||||
|
||||
public static RecorderPermanentTransaction start(UndoableDomainObject obj, String description) {
|
||||
UndoableTransaction tid = UndoableTransaction.start(obj, description, true);
|
||||
UndoableTransaction tid = UndoableTransaction.start(obj, description);
|
||||
return new RecorderPermanentTransaction(obj, tid);
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ public class TraceObjectManager {
|
|||
TraceThread traceThread = threadRecorder.getTraceThread();
|
||||
recorder.createSnapshot(traceThread + " started", traceThread, null);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(recorder.getTrace(), "Adjust thread creation", true)) {
|
||||
UndoableTransaction.start(recorder.getTrace(), "Adjust thread creation")) {
|
||||
long existing = traceThread.getCreationSnap();
|
||||
if (existing == Long.MIN_VALUE) {
|
||||
traceThread.setCreationSnap(recorder.getSnap());
|
||||
|
@ -545,7 +545,7 @@ public class TraceObjectManager {
|
|||
if (rec != null) {
|
||||
String name = (String) added.get(TargetObject.DISPLAY_ATTRIBUTE_NAME);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(rec.getTrace(), "Renamed thread", true)) {
|
||||
UndoableTransaction.start(rec.getTrace(), "Rename thread")) {
|
||||
rec.getTraceThread().setName(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ public class ObjectBasedTraceRecorder implements TraceRecorder {
|
|||
String path = object.getJoinedPath(".");
|
||||
// Don't offload, because we need a consistent map
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Object created: " + path, true)) {
|
||||
UndoableTransaction.start(trace, "Object created: " + path)) {
|
||||
objectRecorder.recordCreated(snap, object);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class ObjectRecorder {
|
|||
this.isSupportsFocus = !schema.searchFor(TargetFocusScope.class, false).isEmpty();
|
||||
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(recorder.trace, "Create root", true)) {
|
||||
UndoableTransaction.start(recorder.trace, "Create root")) {
|
||||
objectManager.createRootObject(schema);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -730,7 +730,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
|||
public void addMapping(TraceLocation from, ProgramLocation to, long length,
|
||||
boolean truncateExisting) throws TraceConflictedMappingException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(from.getTrace(), "Add mapping", true)) {
|
||||
UndoableTransaction.start(from.getTrace(), "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(from, to, length, truncateExisting);
|
||||
}
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
|||
public void addMapping(MapEntry<?, ?> entry, boolean truncateExisting)
|
||||
throws TraceConflictedMappingException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(entry.getFromTrace(), "Add mapping", true)) {
|
||||
UndoableTransaction.start(entry.getFromTrace(), "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(entry, truncateExisting);
|
||||
}
|
||||
}
|
||||
|
@ -751,8 +751,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
|||
entries.stream().collect(Collectors.groupingBy(ent -> ent.getFromTrace()));
|
||||
for (Map.Entry<Trace, List<MapEntry<?, ?>>> ent : byTrace.entrySet()) {
|
||||
Trace trace = ent.getKey();
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, description, true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, description)) {
|
||||
doAddMappings(trace, ent.getValue(), monitor, truncateExisting);
|
||||
}
|
||||
}
|
||||
|
@ -776,7 +775,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
|||
public void addIdentityMapping(Trace from, Program toProgram, Range<Long> lifespan,
|
||||
boolean truncateExisting) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(from, "Add identity mappings", true)) {
|
||||
UndoableTransaction.start(from, "Add identity mappings")) {
|
||||
DebuggerStaticMappingUtils.addIdentityMapping(from, toProgram, lifespan,
|
||||
truncateExisting);
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ public class DisassembleAtPcDebuggerBot implements DebuggerBot {
|
|||
}
|
||||
TraceData pcUnit = null;
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(trace, "Disassemble: PC is code pointer", true)) {
|
||||
UndoableTransaction.start(trace, "Disassemble: PC is code pointer")) {
|
||||
TraceCodeRegisterSpace regCode =
|
||||
codeManager.getCodeRegisterSpace(thread, frameLevel, true);
|
||||
try {
|
||||
|
|
|
@ -98,7 +98,7 @@ public class DebuggerBreakpointMarkerPluginScreenShots extends GhidraScreenShotG
|
|||
.getRootFolder()
|
||||
.createFile("WinHelloCPP", program, TaskMonitor.DUMMY);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add Mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add Mapping")) {
|
||||
mappingService.addIdentityMapping(trace, program, Range.atLeast(0L), true);
|
||||
}
|
||||
waitForValue(() -> mappingService.getOpenMappedLocation(
|
||||
|
|
|
@ -130,12 +130,12 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera
|
|||
mb.testProcess1.addRegion("echo:.data", mb.rng(0x00600000, 0x00600fff), "rw");
|
||||
mb.testProcess3.addRegion("echo:.text", mb.rng(0x7fac0000, 0x7fac0fff), "rx");
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace1, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace1, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace1, null, Range.atLeast(0L), addr(trace1, 0x00400000)),
|
||||
new ProgramLocation(program, addr(program, 0x00400000)), 0x00210000, false);
|
||||
}
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace3, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace3, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace3, null, Range.atLeast(0L), addr(trace3, 0x7fac0000)),
|
||||
new ProgramLocation(program, addr(program, 0x00400000)), 0x00010000, false);
|
||||
|
@ -159,7 +159,7 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera
|
|||
trace3.getBreakpointManager()
|
||||
.getBreakpointsAt(recorder3.getSnap(), addr(trace3, 0x7fac1234))));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add breakpoint", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add breakpoint")) {
|
||||
program.getBookmarkManager()
|
||||
.setBookmark(addr(program, 0x00401234),
|
||||
LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE, "SW_EXECUTE;1",
|
||||
|
|
|
@ -111,7 +111,7 @@ public class DebuggerCopyActionsPluginScreenShots extends GhidraScreenShotGenera
|
|||
program = createDefaultProgram("echo", "Toy:BE:64:default", this);
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add memory")) {
|
||||
program.setImageBase(tb.addr(stSpace, 0x00400000), true);
|
||||
Memory memory = program.getMemory();
|
||||
memory.createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000, (byte) 0,
|
||||
|
|
|
@ -103,7 +103,7 @@ public class DebuggerRegionsPluginScreenShots extends GhidraScreenShotGenerator
|
|||
progBash = createDefaultProgram("bash", ProgramBuilder._X64, this);
|
||||
progLibC = createDefaultProgram("libc.so.6", ProgramBuilder._X64, this);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory")) {
|
||||
progBash.setImageBase(addr(progBash, 0x00400000), true);
|
||||
progBash.getMemory()
|
||||
.createInitializedBlock(".text", addr(progBash, 0x00400000), 0x10000, (byte) 0,
|
||||
|
@ -113,7 +113,7 @@ public class DebuggerRegionsPluginScreenShots extends GhidraScreenShotGenerator
|
|||
TaskMonitor.DUMMY, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
|
|
@ -114,7 +114,7 @@ public class DebuggerModulesPluginScreenShots extends GhidraScreenShotGenerator
|
|||
progBash = createDefaultProgram("bash", ProgramBuilder._X64, this);
|
||||
progLibC = createDefaultProgram("libc.so.6", ProgramBuilder._X64, this);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progBash, "Add memory")) {
|
||||
progBash.setImageBase(addr(progBash, 0x00400000), true);
|
||||
progBash.getMemory()
|
||||
.createInitializedBlock(".text", addr(progBash, 0x00400000), 0x10000, (byte) 0,
|
||||
|
@ -124,7 +124,7 @@ public class DebuggerModulesPluginScreenShots extends GhidraScreenShotGenerator
|
|||
TaskMonitor.DUMMY, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
|
|
@ -94,7 +94,7 @@ public class DebuggerStaticMappingPluginScreenShots extends GhidraScreenShotGene
|
|||
progEcho = createDefaultProgram("bash", ProgramBuilder._X64, this);
|
||||
progLibC = createDefaultProgram("libc.so.6", ProgramBuilder._X64, this);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progEcho, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progEcho, "Add memory")) {
|
||||
progEcho.setImageBase(addr(progEcho, 0x00400000), true);
|
||||
progEcho.getMemory()
|
||||
.createInitializedBlock(".text", addr(progEcho, 0x00400000), 0x10000, (byte) 0,
|
||||
|
@ -104,7 +104,7 @@ public class DebuggerStaticMappingPluginScreenShots extends GhidraScreenShotGene
|
|||
TaskMonitor.DUMMY, false);
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(progLibC, "Add memory")) {
|
||||
progLibC.setImageBase(addr(progLibC, 0x00400000), true);
|
||||
progLibC.getMemory()
|
||||
.createInitializedBlock(".text", addr(progLibC, 0x00400000), 0x10000, (byte) 0,
|
||||
|
|
|
@ -83,7 +83,7 @@ public class DebuggerStackPluginScreenShots extends GhidraScreenShotGenerator {
|
|||
public void testCaptureDebuggerStackPlugin() throws Throwable {
|
||||
DomainFolder root = tool.getProject().getProjectData().getRootFolder();
|
||||
program = createDefaultProgram("echo", ToyProgramBuilder._X64, this);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate")) {
|
||||
program.setImageBase(addr(program, 0x00400000), true);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x10000, (byte) 0,
|
||||
|
|
|
@ -72,7 +72,7 @@ public class DebuggerThreadsPluginScreenShots extends GhidraScreenShotGenerator
|
|||
waitForValue(() -> recorder.getTraceThread(handler2Thread));
|
||||
AbstractGhidraHeadedDebuggerGUITest.waitForDomainObject(trace);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Comments", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Comments")) {
|
||||
recorder.getTraceThread(mainThread).setComment("GUI main loop");
|
||||
recorder.getTraceThread(serverThread).setComment("Server");
|
||||
recorder.getTraceThread(handler1Thread).setComment("Handler 1");
|
||||
|
|
|
@ -736,7 +736,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
|||
program = new ProgramDB("static-" + name.getMethodName(), lang,
|
||||
lang.getDefaultCompilerSpec(), this);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Set Executable Path", true)) {
|
||||
UndoableTransaction.start(program, "Set Executable Path")) {
|
||||
program.setExecutablePath(path);
|
||||
}
|
||||
programManager.openProgram(program);
|
||||
|
|
|
@ -107,7 +107,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
|||
protected void addStaticMemoryAndBreakpoint() throws LockException, DuplicateNameException,
|
||||
MemoryConflictException, AddressOverflowException, CancelledException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Add bookmark break", true)) {
|
||||
UndoableTransaction.start(program, "Add bookmark break")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
|
@ -118,7 +118,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
|||
}
|
||||
|
||||
protected void addMapping(Trace trace) throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace, null, Range.atLeast(0L), addr(trace, 0x55550123)),
|
||||
new ProgramLocation(program, addr(program, 0x00400123)), 0x1000, false);
|
||||
|
@ -421,7 +421,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
|||
}
|
||||
waitForPass(() -> assertEquals(0, breakpointService.getAllBreakpoints().size()));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble")) {
|
||||
Disassembler.getDisassembler(program, TaskMonitor.DUMMY, msg -> {
|
||||
}).disassemble(addr(program, 0x00400123), set(rng(program, 0x00400123, 0x00400123)));
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
|
|||
}
|
||||
waitForPass(() -> assertEquals(0, breakpointService.getAllBreakpoints().size()));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Disassemble")) {
|
||||
program.getListing().createData(addr(program, 0x00400123), ByteDataType.dataType);
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
|
|
@ -81,7 +81,7 @@ public class DebuggerBreakpointsProviderTest extends AbstractGhidraHeadedDebugge
|
|||
}
|
||||
|
||||
protected void addMapping(Trace trace, Program prog) throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(trace, null, Range.atLeast(0L), addr(trace, 0x55550000)),
|
||||
new ProgramLocation(prog, addr(prog, 0x00400000)), 0x1000, false);
|
||||
|
@ -103,7 +103,7 @@ public class DebuggerBreakpointsProviderTest extends AbstractGhidraHeadedDebugge
|
|||
protected void addStaticMemoryAndBreakpoint() throws LockException, DuplicateNameException,
|
||||
MemoryConflictException, AddressOverflowException, CancelledException {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Add bookmark break", true)) {
|
||||
UndoableTransaction.start(program, "Add bookmark break")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00400000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
|
|
|
@ -136,7 +136,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
|||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add blocks", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add blocks")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x8000, (byte) 0,
|
||||
monitor, false);
|
||||
|
@ -230,7 +230,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
|||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
MemoryBlock block;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block")) {
|
||||
block = program.getMemory()
|
||||
.createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000,
|
||||
false);
|
||||
|
@ -292,7 +292,7 @@ public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerG
|
|||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
MemoryBlock block;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block")) {
|
||||
block = program.getMemory()
|
||||
.createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000,
|
||||
false);
|
||||
|
|
|
@ -84,7 +84,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
assertTrue(AllCopiers.BYTES.isRequiresInitializedMemory());
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
|
@ -117,7 +117,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
assertFalse(AllCopiers.STATE.isRequiresInitializedMemory());
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
|
@ -194,7 +194,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
assertTrue(iit.hasNext());
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
|
@ -242,7 +242,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
assertTrue(iit.hasNext());
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
|
@ -315,7 +315,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
assertFalse(insCtx.equals(tb.trace.getRegisterContextManager()
|
||||
.getDefaultValue(tb.language, contextReg, checkCtx.getAddress())));
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
|
@ -372,7 +372,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
tb.buf(0x00, 0x03, 0x00, 0x01, 0x02));
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00600000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
|
@ -432,7 +432,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
tb.buf(0x00, 0x03, 0x00, 0x01, 0x02));
|
||||
}
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
Address paddr = tb.addr(stSpace, 0x00600000);
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
|
@ -505,7 +505,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x00400000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY,
|
||||
false);
|
||||
|
@ -570,7 +570,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
|
@ -621,7 +621,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
|
@ -677,7 +677,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
|
@ -720,7 +720,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
}
|
||||
|
||||
Address paddr = tb.addr(stSpace, 0x55550000);
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Init")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", paddr, 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
|
|
|
@ -115,7 +115,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
|
@ -488,7 +488,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
|
@ -601,7 +601,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
|
@ -1486,7 +1486,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
intoProject(program);
|
||||
|
||||
AddressSpace ss = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", ss.getAddress(0x00600000), 0x10000, (byte) 0,
|
||||
monitor, false);
|
||||
|
|
|
@ -77,7 +77,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
}
|
||||
|
||||
protected void addBlocks() throws Exception {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
Memory mem = program.getMemory();
|
||||
blockExeText = mem.createInitializedBlock(".text", tb.addr(0x00400000), 0x100, (byte) 0,
|
||||
monitor, false);
|
||||
|
@ -257,7 +257,7 @@ public class DebuggerRegionsProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
assertFalse(provider.actionMapRegions.isEnabled());
|
||||
|
||||
addBlocks();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setName("echo");
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
|
|
@ -39,7 +39,7 @@ public class ModelQueryTest extends AbstractGhidraHeadedDebuggerGUITest {
|
|||
ModelQuery rootQuery = ModelQuery.parse("");
|
||||
ModelQuery threadQuery = ModelQuery.parse("Processes[].Threads[]");
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(tb.trace, "Init", true)) {
|
||||
try (UndoableTransaction tid = tb.startTransaction()) {
|
||||
DBTraceObjectManager objects = tb.trace.getObjectManager();
|
||||
|
||||
TraceObjectValue rootVal =
|
||||
|
|
|
@ -129,7 +129,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
|
||||
protected MemoryBlock addBlock() throws Exception,
|
||||
MemoryConflictException, AddressOverflowException, CancelledException {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
return program.getMemory()
|
||||
.createInitializedBlock(".text", tb.addr(0x00400000), 0x1000, (byte) 0, monitor,
|
||||
false);
|
||||
|
@ -226,7 +226,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
waitForSwing();
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
@ -355,7 +355,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
assertTrue(modulesProvider.actionMapIdentically.isEnabled());
|
||||
|
||||
// Need some substance in the program
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Populate")) {
|
||||
addBlock();
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
@ -390,7 +390,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
// Still
|
||||
assertFalse(modulesProvider.actionMapModules.isEnabled());
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setImageBase(addr(program, 0x00400000), true);
|
||||
program.setName(modExe.getName());
|
||||
|
||||
|
@ -458,7 +458,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
assertFalse(modulesProvider.actionMapSections.isEnabled());
|
||||
|
||||
MemoryBlock block = addBlock();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Change name")) {
|
||||
program.setName(modExe.getName());
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
|
|
@ -123,7 +123,7 @@ public class DebuggerStaticMappingProviderTest extends AbstractGhidraHeadedDebug
|
|||
}
|
||||
waitForDomainObject(tb.trace);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0xc0de1234L), 0x100, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
|
|
|
@ -478,7 +478,7 @@ public class DebuggerStackProviderTest extends AbstractGhidraHeadedDebuggerGUITe
|
|||
assertProviderPopulated();
|
||||
|
||||
Function func;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add Function", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add Function")) {
|
||||
program.getMemory()
|
||||
.createInitializedBlock(".text", addr(program, 0x00600000), 0x1000, (byte) 0,
|
||||
TaskMonitor.DUMMY, false);
|
||||
|
|
|
@ -536,7 +536,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
programManager.openProgram(program);
|
||||
|
||||
AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace();
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add block")) {
|
||||
Memory mem = program.getMemory();
|
||||
mem.createInitializedBlock(".data", tb.addr(stSpace, 0x00600000), 0x10000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
|
@ -617,7 +617,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
structDt.add(DWordDataType.dataType, "field0", "");
|
||||
structDt.add(DWordDataType.dataType, "field4", "");
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add data", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add data")) {
|
||||
program.getListing().createData(tb.addr(stSpace, 0x00600000), structDt);
|
||||
}
|
||||
|
||||
|
@ -658,7 +658,7 @@ public class DebuggerWatchesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
setupMappedDataSection();
|
||||
|
||||
Symbol symbol;
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add symbol", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Add symbol")) {
|
||||
symbol = program.getSymbolTable()
|
||||
.createLabel(tb.addr(0x00601234), "my_symbol", SourceType.USER_DEFINED);
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
|
||||
protected void addProgramTextBlock(Program p) throws Throwable {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(program, "Add .text block", true)) {
|
||||
UndoableTransaction.start(program, "Add .text block")) {
|
||||
p.getMemory()
|
||||
.createInitializedBlock(".text", addr(p, 0x00400000), 0x1000, (byte) 0,
|
||||
monitor, false);
|
||||
|
@ -281,7 +281,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
TraceMemoryRegion textRegion =
|
||||
waitFor(() -> r.getTraceMemoryRegion(region), "Recorder missed region: " + region);
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(t, "Add .text mapping", true)) {
|
||||
UndoableTransaction.start(t, "Add .text mapping")) {
|
||||
DebuggerStaticMappingUtils.addMapping(
|
||||
new DefaultTraceLocation(t, null, textRegion.getLifespan(),
|
||||
textRegion.getMinAddress()),
|
||||
|
@ -292,7 +292,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", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(t, "Remove .text mapping")) {
|
||||
TraceStaticMapping mapping =
|
||||
t.getStaticMappingManager().findContaining(addr(t, 0x55550000), r.getSnap());
|
||||
mapping.delete();
|
||||
|
@ -341,7 +341,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
}
|
||||
|
||||
protected void addProgramBreakpoints(Program p) throws Throwable {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(p, "Create bookmarks", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(p, "Create bookmarks")) {
|
||||
enBm = p.getBookmarkManager()
|
||||
.setBookmark(addr(p, 0x00400123),
|
||||
LogicalBreakpoint.BREAKPOINT_ENABLED_BOOKMARK_TYPE, "SW_EXECUTE;1", "");
|
||||
|
@ -362,7 +362,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
}
|
||||
|
||||
protected void removeProgramBreakpoints(Program p) throws Throwable {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(p, "Remove breakpoints", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(p, "Remove breakpoints")) {
|
||||
p.getBookmarkManager().removeBookmark(enBm);
|
||||
p.getBookmarkManager().removeBookmark(disBm);
|
||||
}
|
||||
|
@ -1160,12 +1160,13 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort")) {
|
||||
addTargetSoftwareBreakpoint(recorder1, text);
|
||||
waitForDomainObject(trace);
|
||||
|
||||
// Sanity
|
||||
assertLogicalBreakpointForMappedSoftwareBreakpoint(trace);
|
||||
tid.abort();
|
||||
}
|
||||
waitForDomainObject(trace);
|
||||
|
||||
|
@ -1197,7 +1198,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
waitForDomainObject(trace);
|
||||
changeListener.assertAgreesWithService();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort")) {
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
|
@ -1226,7 +1227,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
addProgramTextBlock(program);
|
||||
TestTargetMemoryRegion text = addTargetTextRegion(mb.testProcess1);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will abort")) {
|
||||
addTargetSoftwareBreakpoint(recorder1, text);
|
||||
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
|
@ -1260,12 +1261,13 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Will abort", false)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Will abort")) {
|
||||
addProgramBreakpoints(program);
|
||||
waitForDomainObject(program);
|
||||
|
||||
// Sanity
|
||||
assertLogicalBreakpointsForMappedBookmarks(trace);
|
||||
tid.abort();
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
||||
|
@ -1285,7 +1287,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
addProgramTextBlock(program);
|
||||
TestTargetMemoryRegion text = addTargetTextRegion(mb.testProcess1);
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will undo", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Will undo")) {
|
||||
addTargetSoftwareBreakpoint(recorder1, text);
|
||||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
}
|
||||
|
@ -1321,7 +1323,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe
|
|||
expectMappingChange(() -> addTextMapping(recorder1, text, program));
|
||||
waitForSwing();
|
||||
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Will undo", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Will undo")) {
|
||||
addProgramBreakpoints(program);
|
||||
}
|
||||
waitForDomainObject(program);
|
||||
|
|
|
@ -66,7 +66,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", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
|
@ -122,7 +122,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", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
|
@ -181,7 +181,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", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(program, "Initialize")) {
|
||||
MemoryBlock blockText = memory.createInitializedBlock(".text", addrText, 0x1000,
|
||||
(byte) 0, TaskMonitor.DUMMY, false);
|
||||
blockText.setExecute(true);
|
||||
|
|
|
@ -77,7 +77,7 @@ public class DefaultTraceRecorderTest extends AbstractGhidraHeadedDebuggerGUITes
|
|||
|
||||
protected TraceMemoryRegisterSpace createRegSpace(TraceThread thread) {
|
||||
try (UndoableTransaction tid =
|
||||
UndoableTransaction.start(thread.getTrace(), "Create register space", true)) {
|
||||
UndoableTransaction.start(thread.getTrace(), "Create register space")) {
|
||||
return thread.getTrace().getMemoryManager().getMemoryRegisterSpace(thread, true);
|
||||
}
|
||||
}
|
||||
|
@ -143,7 +143,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", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add PC type")) {
|
||||
TraceCodeRegisterSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
code.definedData().create(Range.atLeast(0L), pc, PointerDataType.dataType);
|
||||
}
|
||||
|
@ -192,7 +192,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", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add SP type")) {
|
||||
TraceCodeRegisterSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
code.definedData().create(Range.atLeast(0L), sp, PointerDataType.dataType);
|
||||
}
|
||||
|
@ -241,7 +241,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", true)) {
|
||||
try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add PC type")) {
|
||||
TraceCodeRegisterSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true);
|
||||
code.definedData().create(Range.atLeast(0L), pc, PointerDataType.dataType);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue