mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-10-06 04:59:23 +08:00
Merge remote-tracking branch 'origin/GP-7282_d-millar_wkshop--SQUASHED'
This commit is contained in:
@@ -49,6 +49,7 @@ import ghidra.program.model.symbol.SymbolIterator;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.trace.model.Lifespan;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind.CommonSet;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind.TraceBreakpointKindSet;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointLocation;
|
||||
@@ -415,6 +416,15 @@ public class DapDebugAdapter implements IDebugProtocolServer {
|
||||
// unclear whether it receives/filters client.breakpoint messages. Until it does, seems
|
||||
// unwise to clear breakpoints possible only know to Ghidra
|
||||
List<CompletableFuture<Void>> deletionFutures = new ArrayList<>();
|
||||
Collection<? extends TraceBreakpointLocation> locations =
|
||||
manager.getCurrentTrace().getBreakpointManager().getAllBreakpointLocations();
|
||||
for (TraceBreakpointLocation loc : locations) {
|
||||
Set<TraceBreakpointKind> kinds = loc.getKinds(manager.getCurrentSnap());
|
||||
if ((kinds.equals(CommonSet.HWX.kinds()) && dataBreakpoints) ||
|
||||
(kinds.equals(CommonSet.SWX.kinds()) && !dataBreakpoints)) {
|
||||
target.deleteBreakpointAsync(loc);
|
||||
}
|
||||
}
|
||||
return CompletableFuture.allOf(deletionFutures.toArray(new CompletableFuture[0]));
|
||||
}
|
||||
|
||||
@@ -767,7 +777,8 @@ public class DapDebugAdapter implements IDebugProtocolServer {
|
||||
}
|
||||
|
||||
private TraceBreakpointKindSet kind(String mode) {
|
||||
return mode.equals("hardware") ? CommonSet.HWX.kinds() : CommonSet.SWX.kinds();
|
||||
return mode == null || !mode.equals("hardware") ? CommonSet.SWX.kinds()
|
||||
: CommonSet.HWX.kinds();
|
||||
}
|
||||
|
||||
private TraceBreakpointKindSet kinds(DataBreakpointAccessType accessType) {
|
||||
|
||||
@@ -75,6 +75,7 @@ public class DapPlugin extends ProgramPlugin {
|
||||
private DapServer server;
|
||||
private final Map<Trace, ListenerForChanges> listeners = new HashMap<>();
|
||||
private IDebugProtocolClient client;
|
||||
private long lastSnap = -1L;
|
||||
|
||||
public DapPlugin(PluginTool tool) {
|
||||
super(tool);
|
||||
@@ -282,8 +283,11 @@ public class DapPlugin extends ProgramPlugin {
|
||||
trace.getTimeManager().getSnapshot(currentSnap, false);
|
||||
args.setDescription(
|
||||
snapshot == null ? "STOPPED" : snapshot.getDescription());
|
||||
args.setReason(ThreadEventArgumentsReason.STARTED);
|
||||
client.stopped(args);
|
||||
args.setReason(StoppedEventArgumentsReason.STEP);
|
||||
if (lastSnap != currentSnap) {
|
||||
client.stopped(args);
|
||||
lastSnap = currentSnap;
|
||||
}
|
||||
}
|
||||
case RUNNING -> {
|
||||
ContinuedEventArguments args = new ContinuedEventArguments();
|
||||
|
||||
Reference in New Issue
Block a user