Fixed #2131 Debugger - Breakpoints can be added while SWF is running (not just on pause)

This commit is contained in:
Jindra Petřík
2023-11-24 20:13:29 +01:00
parent e371372392
commit 5d85dee6f8
2 changed files with 10 additions and 11 deletions

View File

@@ -50,6 +50,7 @@ All notable changes to this project will be documented in this file.
- Retain AS3 script selection in the tree after its editation and saving whole SWF
- [#2131] AS1/2 Debugger - Breakpoint handling - incorrect script names
- [#2131] Debugger - Correct walking variables tree
- [#2131] Debugger - Breakpoints can be added while SWF is running (not just on pause)
### Changed
- [#2120] Exported assets no longer take names from assigned classes if there is more than 1 assigned class

View File

@@ -213,7 +213,7 @@ public class DebuggerHandler implements DebugConnectionListener {
toRemoveBPointMap.get(scriptName).add(line);
}
try {
sendBreakPoints(false);
sendBreakPoints();
} catch (IOException ex) {
//ignore
}
@@ -310,12 +310,10 @@ public class DebuggerHandler implements DebugConnectionListener {
toAddBPointMap.put(scriptName, new TreeSet<>());
}
toAddBPointMap.get(scriptName).add(line);
Logger
.getLogger(DebuggerHandler.class
.getName()).log(Level.FINE, "bp {0}:{1} added to todo", new Object[]{scriptName, line});
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINE, "bp {0}:{1} added to todo", new Object[]{scriptName, line});
}
try {
sendBreakPoints(false);
sendBreakPoints();
} catch (IOException ex) {
//ignored
}
@@ -797,7 +795,7 @@ public class DebuggerHandler implements DebugConnectionListener {
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINE, "break at {0}:{1}, reason: {2}", new Object[]{newBreakScriptName, message.line, reason});
sendBreakPoints(false);
sendBreakPoints();
synchronized (DebuggerHandler.this) {
breakScriptName = newBreakScriptName;
breakIp = message.line;
@@ -877,12 +875,12 @@ public class DebuggerHandler implements DebugConnectionListener {
}
}
private void sendBreakPoints(boolean force) throws IOException {
if (!force && !isPaused()) {
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINEST, "not sending bps, not paused");
private void sendBreakPoints() throws IOException {
if (!isConnected()) {
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINEST, "not sending bps, not connected");
return;
}
synchronized (this) {
}
synchronized (this) {
for (String scriptName : toRemoveBPointMap.keySet()) {
int file = moduleIdOf(scriptName);
if (file > -1) {