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