From f1960ffdde5e48aae488eec2041d66e4d80b53a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 14 Jul 2018 22:16:32 +0200 Subject: [PATCH] Properly terminating debug session on Flash player manual close --- src/com/jpexs/decompiler/flash/gui/DebugPanel.java | 2 +- src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java | 9 ++++----- .../decompiler/flash/gui/abc/DecompiledEditorPane.java | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/DebugPanel.java b/src/com/jpexs/decompiler/flash/gui/DebugPanel.java index 51c94d671..9611b8b66 100644 --- a/src/com/jpexs/decompiler/flash/gui/DebugPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/DebugPanel.java @@ -86,7 +86,7 @@ public class DebugPanel extends JPanel { private boolean loading = false; public ABCPanel.VariablesTableModel localsTable; - + public static enum SelectedTab { LOG, STACK, SCOPECHAIN, LOCALS, REGISTERS, CALLSTACK, CONSTANTPOOL diff --git a/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java b/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java index ccc1942ca..140fc80d6 100644 --- a/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java +++ b/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java @@ -632,8 +632,8 @@ public class DebuggerHandler implements DebugConnectionListener { @Override public void run() { try { - con.sendMessage(new OutGetSwf(con, (int) s.index), InGetSwf.class); - con.sendMessage(new OutGetSwd(con, (int) s.index), InGetSwd.class); + con.sendMessageWithTimeout(new OutGetSwf(con, (int) s.index), InGetSwf.class); + con.sendMessageWithTimeout(new OutGetSwd(con, (int) s.index), InGetSwd.class); } catch (IOException ex) { //ignore } @@ -693,8 +693,8 @@ public class DebuggerHandler implements DebugConnectionListener { } try { - breakInfo = con.getMessage(InBreakAtExt.class); - breakReason = con.sendMessage(new OutGetBreakReason(con), InBreakReason.class); + breakInfo = con.getMessage(InBreakAtExt.class, DebuggerConnection.PREF_RESPONSE_TIMEOUT); + breakReason = con.sendMessageWithTimeout(new OutGetBreakReason(con), InBreakReason.class); String newBreakScriptName = "unknown"; if (modulePaths.containsKey(message.file)) { @@ -764,7 +764,6 @@ public class DebuggerHandler implements DebugConnectionListener { } } catch (IOException ex) { - synchronized (this) { connected = false; } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 3bb718dc7..28c1cab69 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -811,7 +811,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL final String identifier = abcPanel.getMainPanel().getActionPanel().getStringUnderPosition(pos, abcPanel.decompiledTextArea); if (identifier != null && !identifier.isEmpty()) { - String tooltipText = abcPanel.getDebugPanel().localsTable.TryGetDebugHoverToolTipText(identifier); + String tooltipText = abcPanel.getDebugPanel().localsTable.tryGetDebugHoverToolTipText(identifier); return (tooltipText == null ? super.getToolTipText() : tooltipText); }