GP-0: Fix tests.

This commit is contained in:
Dan
2026-07-06 14:45:46 +00:00
parent 20e37d9687
commit fc8288b657
4 changed files with 11 additions and 18 deletions

View File

@@ -40,7 +40,6 @@ import ghidra.trace.model.target.TraceObject;
import ghidra.trace.model.target.path.KeyPath;
import ghidra.trace.model.thread.TraceThread;
import ghidra.trace.model.time.TraceSnapshot;
import ghidra.trace.model.time.TraceTimeManager;
import ghidra.trace.model.time.schedule.TraceSchedule;
import ghidra.trace.model.time.schedule.TraceSchedule.TimeRadix;
import ghidra.util.Msg;
@@ -173,7 +172,7 @@ public class DebuggerCoordinates {
}
private static TraceThread resolveThread(Trace trace, TraceSchedule time) {
TraceThread eventThread = getEventThread(trace, time);
TraceThread eventThread = time.getLastThread(trace);
if (eventThread != null) {
return eventThread;
}
@@ -408,15 +407,6 @@ public class DebuggerCoordinates {
return new DebuggerCoordinates(trace, platform, target, thread, view, newTime, frame, path);
}
private static TraceThread getEventThread(Trace trace, TraceSchedule time) {
long snap = time.getSnap();
TraceTimeManager manager = trace.getTimeManager();
TraceSnapshot snapshot = time.isSnapOnly()
? manager.getSnapshot(snap, false)
: manager.findScratchSnapshot(time);
return snapshot == null ? null : snapshot.getEventThread();
}
/**
* Get these same coordinates with time replaced by the given schedule
*
@@ -431,7 +421,7 @@ public class DebuggerCoordinates {
return NOWHERE;
}
long snap = newTime.getSnap();
TraceThread eventThread = getEventThread(trace, newTime);
TraceThread eventThread = newTime.getLastThread(trace);
boolean isThreadValid = thread == null ? false : thread.isValid(snap);
TraceThread newThread = eventThread != null
? eventThread

View File

@@ -643,7 +643,7 @@ public class StackUnwinderTest extends AbstractGhidraHeadedDebuggerTest {
protected Function createInfiniteRecursionProgramArm() throws Throwable {
createProgram("ARM:LE:32:v8", "default");
intoProject(program);
try (Transaction tx = program.openTransaction("Assemble")) {
try (Transaction _ = program.openTransaction("Assemble")) {
Address entry = addr(program, 0x00400000);
program.getMemory()
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);

View File

@@ -519,7 +519,6 @@ public class TraceSchedule implements Comparable<TraceSchedule> {
/**
* Get the event thread for this schedule in the context of the given trace
*
* <p>
* This is the thread stepped when no thread is specified for the first step of the sequence.
*
@@ -923,6 +922,9 @@ public class TraceSchedule implements Comparable<TraceSchedule> {
/**
* Indicates a step and which kind (instruction or p-code)
*
* @param kind the kind of step
* @param step the actual step
*/
public record StepAndKind(StepKind kind, Step step) {}

View File

@@ -185,13 +185,14 @@ public class AssemblyBuffer {
return insBytes;
}
MemBuffer buf = new ByteMemBufferImpl(start, insBytes, language.isBigEndian());
ProcessorContext procCtx = new ProgramProcessorContext(progCtx, start);
try {
RegisterValue rvCtx = ctx.toRegisterValue(ctxreg);
progCtx.setRegisterValue(start, start, rvCtx);
ProcessorContext procCtx = new ProgramProcessorContext(progCtx, start);
InstructionPrototype prototype = language.parse(buf, procCtx, false);
PseudoInstruction ins = new PseudoInstruction(start, prototype, buf, procCtx);
if (ins.hasFallthrough()) {
RegisterValue rvCtx = ctx.toRegisterValue(ctxreg);
progCtx.setRegisterValue(start, start, rvCtx);
Address fall = ins.getFallThrough();
progCtx.setRegisterValue(fall, fall, flowBits.getFlowValue(rvCtx));
}
@@ -222,7 +223,7 @@ public class AssemblyBuffer {
result = result.assign(AssemblyPatternBlock.fromRegisterValue(fromProc));
}
if (override != null) {
result.assign(override);
result = result.assign(override);
}
return result.fillMask();
}