GP-2189: Add FlatDebuggerAPI interface

This commit is contained in:
Dan 2022-08-15 15:18:15 -04:00
parent 58066601fc
commit c7b464a0be
46 changed files with 4619 additions and 129 deletions

View file

@ -79,8 +79,9 @@ public class DBTraceStaticMappingManager implements TraceStaticMappingManager, D
@Override
public DBTraceStaticMapping add(AddressRange range, Range<Long> lifespan, URL toProgramURL,
String toAddress)
throws TraceConflictedMappingException {
String toAddress) throws TraceConflictedMappingException {
Objects.requireNonNull(toProgramURL,
"Program URL cannot be null. Program must be in a project to have a URL.");
if (lifespan.hasLowerBound() && lifespan.lowerBoundType() != BoundType.CLOSED) {
throw new IllegalArgumentException("Lower bound must be closed");
}

View file

@ -38,6 +38,13 @@ public enum TraceBreakpointKind {
SW_EXECUTE(1 << 3);
public static class TraceBreakpointKindSet extends AbstractSetDecorator<TraceBreakpointKind> {
public static final TraceBreakpointKindSet SW_EXECUTE = of(TraceBreakpointKind.SW_EXECUTE);
public static final TraceBreakpointKindSet HW_EXECUTE = of(TraceBreakpointKind.HW_EXECUTE);
public static final TraceBreakpointKindSet READ = of(TraceBreakpointKind.READ);
public static final TraceBreakpointKindSet WRITE = of(TraceBreakpointKind.WRITE);
public static final TraceBreakpointKindSet ACCESS =
of(TraceBreakpointKind.READ, TraceBreakpointKind.WRITE);
public static TraceBreakpointKindSet of(TraceBreakpointKind... kinds) {
return new TraceBreakpointKindSet(Set.of(kinds));
}

View file

@ -412,9 +412,6 @@ public interface TraceMemoryOperations {
/**
* Search the given address range at the given snap for a given byte pattern
*
* <p>
* TODO: Implement me
*
* @param snap the time to search
* @param range the address range to search
* @param data the values to search for
@ -422,7 +419,7 @@ public interface TraceMemoryOperations {
* @param forward true to return the match with the lowest address in {@code range}, false for
* the highest address.
* @param monitor a monitor for progress reporting and canceling
* @return the address of the match, or {@code null} if not found
* @return the minimum address of the matched bytes, or {@code null} if not found
*/
Address findBytes(long snap, AddressRange range, ByteBuffer data, ByteBuffer mask,
boolean forward, TaskMonitor monitor);

View file

@ -479,6 +479,19 @@ public class TraceSchedule implements Comparable<TraceSchedule> {
return new TraceSchedule(snap, steps.clone(), pTicks);
}
/**
* Behaves as in {@link #steppedPcodeForward(TraceThread, int)}, but by appending skips
*
* @param thread the thread to step, or null for the "last thread"
* @param pTickCount the number of p-code skips to take the thread forward
* @return the resulting schedule
*/
public TraceSchedule skippedPcodeForward(TraceThread thread, int pTickCount) {
Sequence pTicks = this.pSteps.clone();
pTicks.advance(new SkipStep(thread == null ? -1 : thread.getKey(), pTickCount));
return new TraceSchedule(snap, steps.clone(), pTicks);
}
/**
* Returns the equivalent of executing count p-code operations less than this schedule
*