fix: debugger concurrency issues
This commit is contained in:
parent
4c53689d9c
commit
9ce0504948
@ -159,8 +159,10 @@ public class DebugServer {
|
||||
}
|
||||
|
||||
public void awaitConnection() throws InterruptedException {
|
||||
synchronized (connNotifier) {
|
||||
connNotifier.wait();
|
||||
}
|
||||
}
|
||||
|
||||
public void run(InetSocketAddress address) {
|
||||
try {
|
||||
|
@ -1032,15 +1032,20 @@ public class SimpleDebugger implements Debugger {
|
||||
}
|
||||
mappings.put(body, map);
|
||||
}
|
||||
|
||||
private boolean instructionLock;
|
||||
|
||||
@Override public boolean onInstruction(Environment env, Frame cf, Instruction instruction, Value returnVal, EngineException error, boolean caught) {
|
||||
if (!enabled) return false;
|
||||
if (instructionLock) return false;
|
||||
instructionLock = true;
|
||||
|
||||
try {
|
||||
boolean isBreakpointable;
|
||||
Location loc;
|
||||
DebugFrame frame;
|
||||
BreakpointType bptType;
|
||||
|
||||
synchronized (this) {
|
||||
frame = getFrame(cf);
|
||||
|
||||
var map = DebugContext.get(env).getMap(frame.frame.function);
|
||||
@ -1077,6 +1082,8 @@ public class SimpleDebugger implements Debugger {
|
||||
instruction.params.length == 1 &&
|
||||
instruction.get(0).equals("debug")
|
||||
) pauseDebug(env, null);
|
||||
|
||||
synchronized (this) {
|
||||
}
|
||||
|
||||
while (enabled) {
|
||||
@ -1121,6 +1128,10 @@ public class SimpleDebugger implements Debugger {
|
||||
|
||||
return false;
|
||||
}
|
||||
finally {
|
||||
instructionLock = false;
|
||||
}
|
||||
}
|
||||
@Override public synchronized void onFramePush(Environment env, Frame frame) {
|
||||
var prevFrame = currFrame;
|
||||
updateFrames(env, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user