mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-24 20:50:46 +00:00
Debugging in the browser, improved
This commit is contained in:
@@ -197,16 +197,16 @@ public class BreakpointListDialog extends AppDialog {
|
|||||||
defaultTableModel.addColumn(translate("breakpoint.line"));
|
defaultTableModel.addColumn(translate("breakpoint.line"));
|
||||||
defaultTableModel.addColumn(translate("breakpoint.status"));
|
defaultTableModel.addColumn(translate("breakpoint.status"));
|
||||||
|
|
||||||
Map<String, Set<Integer>> breakpoints = Main.getDebugHandler().getAllBreakPoints(swf, false);
|
Map<String, Set<Integer>> breakpoints = Main.getDebugHandler().getAllSessionsBreakPoints(swf);
|
||||||
|
|
||||||
List<Breakpoint> newBreakpointList = new ArrayList<>();
|
List<Breakpoint> newBreakpointList = new ArrayList<>();
|
||||||
for (String scriptName : breakpoints.keySet()) {
|
for (String scriptName : breakpoints.keySet()) {
|
||||||
for (int line : breakpoints.get(scriptName)) {
|
for (int line : breakpoints.get(scriptName)) {
|
||||||
newBreakpointList.add(new Breakpoint(scriptName, line));
|
newBreakpointList.add(new Breakpoint(scriptName, line));
|
||||||
String status = "unknown";
|
String status = "unknown";
|
||||||
if (Main.getDebugHandler().isBreakpointInvalid(swf, scriptName, line)) {
|
if (Main.getCurrentDebugSession().isBreakpointInvalid(swf, scriptName, line)) {
|
||||||
status = "invalid";
|
status = "invalid";
|
||||||
} else if (Main.getDebugHandler().isBreakpointConfirmed(swf, scriptName, line)) {
|
} else if (Main.getCurrentDebugSession().isBreakpointConfirmed(swf, scriptName, line)) {
|
||||||
status = "confirmed";
|
status = "confirmed";
|
||||||
}
|
}
|
||||||
defaultTableModel.addRow(new Object[]{scriptName, line, translate("breakpoint.status." + status)});
|
defaultTableModel.addRow(new Object[]{scriptName, line, translate("breakpoint.status." + status)});
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import java.awt.event.MouseEvent;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -89,6 +90,8 @@ public class DebugPanel extends JPanel {
|
|||||||
private boolean loading = false;
|
private boolean loading = false;
|
||||||
|
|
||||||
public ABCPanel.VariablesTableModel localsTable;
|
public ABCPanel.VariablesTableModel localsTable;
|
||||||
|
|
||||||
|
private WeakReference<DebuggerSession> currentSessionRef = null;
|
||||||
|
|
||||||
public static enum SelectedTab {
|
public static enum SelectedTab {
|
||||||
|
|
||||||
@@ -140,7 +143,7 @@ public class DebugPanel extends JPanel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void logAdd(String message) {
|
private void logAdd(DebuggerSession session, String message) {
|
||||||
boolean wasEmpty = logLength == 0;
|
boolean wasEmpty = logLength == 0;
|
||||||
String add = message + "\r\n";
|
String add = message + "\r\n";
|
||||||
logLength += add.length();
|
logLength += add.length();
|
||||||
@@ -151,7 +154,7 @@ public class DebugPanel extends JPanel {
|
|||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
if (wasEmpty) {
|
if (wasEmpty) {
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,6 +180,15 @@ public class DebugPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void dopop(MouseEvent e) {
|
private void dopop(MouseEvent e) {
|
||||||
|
|
||||||
|
if (currentSessionRef == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DebuggerSession session = currentSessionRef.get();
|
||||||
|
if (session == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (debugLocalsTable.getSelectedRow() == -1) {
|
if (debugLocalsTable.getSelectedRow() == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -241,8 +253,8 @@ public class DebugPanel extends JPanel {
|
|||||||
}*/
|
}*/
|
||||||
//Variant using comma separated bytes, pretty fast
|
//Variant using comma separated bytes, pretty fast
|
||||||
try {
|
try {
|
||||||
Variable debugConnectionClass = Main.getDebugHandler().getVariable(0, Main.currentDebuggerPackage + "::DebugConnection", false, false).parent;
|
Variable debugConnectionClass = session.getVariable(0, Main.currentDebuggerPackage + "::DebugConnection", false, false).parent;
|
||||||
String dataStr = (String) Main.getDebugHandler().callMethod(debugConnectionClass, "readCommaSeparatedFromByteArray", Arrays.asList(v)).variables.get(0).value;
|
String dataStr = (String) session.callMethod(debugConnectionClass, "readCommaSeparatedFromByteArray", Arrays.asList(v)).variables.get(0).value;
|
||||||
String[] parts = dataStr.split(",");
|
String[] parts = dataStr.split(",");
|
||||||
byte[] data = new byte[parts.length];
|
byte[] data = new byte[parts.length];
|
||||||
for (int i = 0; i < parts.length; i++) {
|
for (int i = 0; i < parts.length; i++) {
|
||||||
@@ -313,9 +325,9 @@ public class DebugPanel extends JPanel {
|
|||||||
splitter = ",";
|
splitter = ",";
|
||||||
}
|
}
|
||||||
String dataStr = sb.toString();
|
String dataStr = sb.toString();
|
||||||
Variable debugConnectionClass = Main.getDebugHandler().getVariable(0, Main.currentDebuggerPackage + "::DebugConnection", false, false).parent;
|
Variable debugConnectionClass = session.getVariable(0, Main.currentDebuggerPackage + "::DebugConnection", false, false).parent;
|
||||||
try {
|
try {
|
||||||
Main.getDebugHandler().callMethod(debugConnectionClass, "writeCommaSeparatedToByteArray", Arrays.asList(dataStr, v));
|
session.callMethod(debugConnectionClass, "writeCommaSeparatedToByteArray", Arrays.asList(dataStr, v));
|
||||||
} catch (DebuggerHandler.ActionScriptException ex) {
|
} catch (DebuggerHandler.ActionScriptException ex) {
|
||||||
Logger.getLogger(DebugPanel.class.getName()).log(Level.SEVERE, "Error exporting ByteArray", ex);
|
Logger.getLogger(DebugPanel.class.getName()).log(Level.SEVERE, "Error exporting ByteArray", ex);
|
||||||
}
|
}
|
||||||
@@ -334,19 +346,19 @@ public class DebugPanel extends JPanel {
|
|||||||
JMenu addWatchMenu = new JMenu(AppStrings.translate("debug.watch.add").replace("%name%", v.name));
|
JMenu addWatchMenu = new JMenu(AppStrings.translate("debug.watch.add").replace("%name%", v.name));
|
||||||
JMenuItem watchReadMenuItem = new JMenuItem(AppStrings.translate("debug.watch.add.read"));
|
JMenuItem watchReadMenuItem = new JMenuItem(AppStrings.translate("debug.watch.add.read"));
|
||||||
watchReadMenuItem.addActionListener((ActionEvent e1) -> {
|
watchReadMenuItem.addActionListener((ActionEvent e1) -> {
|
||||||
if (!Main.addWatch(v, watchParentId, true, false)) {
|
if (!Main.addWatch(session, v, watchParentId, true, false)) {
|
||||||
ViewMessages.showMessageDialog(DebugPanel.this, AppStrings.translate("error.debug.watch.add"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
ViewMessages.showMessageDialog(DebugPanel.this, AppStrings.translate("error.debug.watch.add"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
JMenuItem watchWriteMenuItem = new JMenuItem(AppStrings.translate("debug.watch.add.write"));
|
JMenuItem watchWriteMenuItem = new JMenuItem(AppStrings.translate("debug.watch.add.write"));
|
||||||
watchWriteMenuItem.addActionListener((ActionEvent e1) -> {
|
watchWriteMenuItem.addActionListener((ActionEvent e1) -> {
|
||||||
if (!Main.addWatch(v, watchParentId, false, true)) {
|
if (!Main.addWatch(session, v, watchParentId, false, true)) {
|
||||||
ViewMessages.showMessageDialog(DebugPanel.this, AppStrings.translate("error.debug.watch.add"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
ViewMessages.showMessageDialog(DebugPanel.this, AppStrings.translate("error.debug.watch.add"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
JMenuItem watchReadWriteMenuItem = new JMenuItem(AppStrings.translate("debug.watch.add.readwrite"));
|
JMenuItem watchReadWriteMenuItem = new JMenuItem(AppStrings.translate("debug.watch.add.readwrite"));
|
||||||
watchReadWriteMenuItem.addActionListener((ActionEvent e1) -> {
|
watchReadWriteMenuItem.addActionListener((ActionEvent e1) -> {
|
||||||
if (!Main.addWatch(v, watchParentId, true, true)) {
|
if (!Main.addWatch(session, v, watchParentId, true, true)) {
|
||||||
ViewMessages.showMessageDialog(DebugPanel.this, AppStrings.translate("error.debug.watch.add"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
ViewMessages.showMessageDialog(DebugPanel.this, AppStrings.translate("error.debug.watch.add"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -376,41 +388,41 @@ public class DebugPanel extends JPanel {
|
|||||||
Main.getDebugHandler().addTraceListener(new DebuggerHandler.TraceListener() {
|
Main.getDebugHandler().addTraceListener(new DebuggerHandler.TraceListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void trace(String... val) {
|
public void trace(DebuggerSession session, String... val) {
|
||||||
for (String s : val) {
|
for (String s : val) {
|
||||||
logAdd("trace: " + s);
|
logAdd(session, "trace: " + s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Main.getDebugHandler().addErrorListener(new DebuggerHandler.ErrorListener() {
|
Main.getDebugHandler().addErrorListener(new DebuggerHandler.ErrorListener() {
|
||||||
@Override
|
@Override
|
||||||
public void errorException(String message, Variable thrownVar) {
|
public void errorException(DebuggerSession session, String message, Variable thrownVar) {
|
||||||
logAdd("unhandled exception: " + message);
|
logAdd(session, "unhandled exception: " + message);
|
||||||
selectedTab = tabTypes.get(tabTypes.size() - 1);
|
selectedTab = tabTypes.get(tabTypes.size() - 1);
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void connected() {
|
public void connected(DebuggerSession session) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected() {
|
public void disconnected(DebuggerSession session) {
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Main.getDebugHandler().addFrameChangeListener(frameChangeListener = new DebuggerHandler.FrameChangeListener() {
|
Main.getDebugHandler().addFrameChangeListener(frameChangeListener = new DebuggerHandler.FrameChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void frameChanged() {
|
public void frameChanged(DebuggerSession session) {
|
||||||
View.execInEventDispatchLater(new Runnable() {
|
View.execInEventDispatchLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -419,17 +431,17 @@ public class DebugPanel extends JPanel {
|
|||||||
Main.getDebugHandler().addBreakListener(breakListener = new DebuggerHandler.BreakListener() {
|
Main.getDebugHandler().addBreakListener(breakListener = new DebuggerHandler.BreakListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doContinue() {
|
public void doContinue(DebuggerSession session) {
|
||||||
View.execInEventDispatch(new Runnable() {
|
View.execInEventDispatch(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakAt(String scriptName, int line, int classIndex, int traitIndex, int methodIndex) {
|
public void breakAt(DebuggerSession session, String scriptName, int line, int classIndex, int traitIndex, int methodIndex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -484,8 +496,9 @@ public class DebugPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
return v.getMembers(this);
|
return v.getMembers(this);
|
||||||
}*/
|
}*/
|
||||||
public void refresh() {
|
public void refresh(DebuggerSession session) {
|
||||||
|
|
||||||
|
currentSessionRef = session == null ? null : new WeakReference<>(session);
|
||||||
View.execInEventDispatch(new Runnable() {
|
View.execInEventDispatch(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -495,19 +508,14 @@ public class DebugPanel extends JPanel {
|
|||||||
|
|
||||||
SelectedTab oldSel = selectedTab;
|
SelectedTab oldSel = selectedTab;
|
||||||
localsTable = null;
|
localsTable = null;
|
||||||
SWF swf = Main.getDebuggedSWF();
|
InFrame f = session == null ? null : session.getFrame();
|
||||||
if (swf == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean as3 = swf.isAS3();
|
|
||||||
InFrame f = Main.getDebugHandler().getFrame();
|
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
|
|
||||||
|
|
||||||
List<Variable> locals = new ArrayList<>();
|
List<Variable> locals = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
Map<String, Long> placedObjects = Main.getDebugHandler().getPlacedObjects();
|
Map<String, Long> placedObjects = session.getPlacedObjects();
|
||||||
for (String poName : placedObjects.keySet()) {
|
for (String poName : placedObjects.keySet()) {
|
||||||
String realName = poName;
|
String realName = poName;
|
||||||
if ("/".equals(realName)) {
|
if ("/".equals(realName)) {
|
||||||
@@ -515,7 +523,7 @@ public class DebugPanel extends JPanel {
|
|||||||
} else if (realName.startsWith("/")) {
|
} else if (realName.startsWith("/")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Variable placedVar = Main.getDebugHandler().getVariable(0, realName, false, false).parent;
|
Variable placedVar = session.getVariable(0, realName, false, false).parent;
|
||||||
if (placedVar != null) {
|
if (placedVar != null) {
|
||||||
locals.add(placedVar);
|
locals.add(placedVar);
|
||||||
}
|
}
|
||||||
@@ -540,26 +548,26 @@ public class DebugPanel extends JPanel {
|
|||||||
TreeModelListener refreshListener = new TreeModelListener() {
|
TreeModelListener refreshListener = new TreeModelListener() {
|
||||||
@Override
|
@Override
|
||||||
public void treeNodesChanged(TreeModelEvent e) {
|
public void treeNodesChanged(TreeModelEvent e) {
|
||||||
Main.getDebugHandler().refreshFrame();
|
session.refreshFrame();
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void treeNodesInserted(TreeModelEvent e) {
|
public void treeNodesInserted(TreeModelEvent e) {
|
||||||
Main.getDebugHandler().refreshFrame();
|
session.refreshFrame();
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void treeNodesRemoved(TreeModelEvent e) {
|
public void treeNodesRemoved(TreeModelEvent e) {
|
||||||
Main.getDebugHandler().refreshFrame();
|
session.refreshFrame();
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void treeStructureChanged(TreeModelEvent e) {
|
public void treeStructureChanged(TreeModelEvent e) {
|
||||||
Main.getDebugHandler().refreshFrame();
|
session.refreshFrame();
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
debugLocalsTable.getTreeTableModel().addTreeModelListener(refreshListener);
|
debugLocalsTable.getTreeTableModel().addTreeModelListener(refreshListener);
|
||||||
@@ -569,7 +577,7 @@ public class DebugPanel extends JPanel {
|
|||||||
debugLocalsTable.setTreeModel(new ABCPanel.VariablesTableModel(debugLocalsTable, new ArrayList<>()));
|
debugLocalsTable.setTreeModel(new ABCPanel.VariablesTableModel(debugLocalsTable, new ArrayList<>()));
|
||||||
debugScopeTable.setTreeModel(new ABCPanel.VariablesTableModel(debugScopeTable, new ArrayList<>()));
|
debugScopeTable.setTreeModel(new ABCPanel.VariablesTableModel(debugScopeTable, new ArrayList<>()));
|
||||||
}
|
}
|
||||||
InConstantPool cpool = Main.getDebugHandler().getConstantPool();
|
InConstantPool cpool = session == null ? null : session.getConstantPool();
|
||||||
if (cpool != null) {
|
if (cpool != null) {
|
||||||
Object[][] data2 = new Object[cpool.vars.size()][2];
|
Object[][] data2 = new Object[cpool.vars.size()][2];
|
||||||
for (int i = 0; i < cpool.vars.size(); i++) {
|
for (int i = 0; i < cpool.vars.size(); i++) {
|
||||||
@@ -635,7 +643,7 @@ public class DebugPanel extends JPanel {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
traceLogTextarea.setText("");
|
traceLogTextarea.setText("");
|
||||||
logLength = 0;
|
logLength = 0;
|
||||||
refresh();
|
refresh(session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
JPanel butPanel = new JPanel(new FlowLayout());
|
JPanel butPanel = new JPanel(new FlowLayout());
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.awt.Component;
|
|||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JTable;
|
import javax.swing.JTable;
|
||||||
@@ -46,35 +47,40 @@ public class DebugStackPanel extends JPanel {
|
|||||||
private int[] classIndices = new int[0];
|
private int[] classIndices = new int[0];
|
||||||
private int[] methodIndices = new int[0];
|
private int[] methodIndices = new int[0];
|
||||||
private int[] traitIndices = new int[0];
|
private int[] traitIndices = new int[0];
|
||||||
|
private WeakReference<DebuggerSession> currentSessionRef = null;
|
||||||
|
|
||||||
public DebugStackPanel() {
|
public DebugStackPanel() {
|
||||||
stackTable = new JTable();
|
stackTable = new JTable();
|
||||||
Main.getDebugHandler().addFrameChangeListener(new DebuggerHandler.FrameChangeListener() {
|
Main.getDebugHandler().addFrameChangeListener(new DebuggerHandler.FrameChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void frameChanged() {
|
public void frameChanged(DebuggerSession session) {
|
||||||
depth = Main.getDebugHandler().getDepth();
|
if (session == null) {
|
||||||
refresh();
|
refresh(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
depth = session.getDepth();
|
||||||
|
refresh(session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Main.getDebugHandler().addBreakListener(new DebuggerHandler.BreakListener() {
|
Main.getDebugHandler().addBreakListener(new DebuggerHandler.BreakListener() {
|
||||||
@Override
|
@Override
|
||||||
public void breakAt(String scriptName, int line, int classIndex, int traitIndex, int methodIndex) {
|
public void breakAt(DebuggerSession session, String scriptName, int line, int classIndex, int traitIndex, int methodIndex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doContinue() {
|
public void doContinue(DebuggerSession session) {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void connected() {
|
public void connected(DebuggerSession session) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected() {
|
public void disconnected(DebuggerSession session) {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -96,7 +102,13 @@ public class DebugStackPanel extends JPanel {
|
|||||||
SWF swf = swfHash == null ? Main.getRunningSWF() : Main.getSwfByHash(swfHash);
|
SWF swf = swfHash == null ? Main.getRunningSWF() : Main.getSwfByHash(swfHash);
|
||||||
Main.getMainFrame().getPanel().gotoScriptLine(swf,
|
Main.getMainFrame().getPanel().gotoScriptLine(swf,
|
||||||
scriptName, line, classIndices[row], traitIndices[row], methodIndices[row], Main.isDebugPCode());
|
scriptName, line, classIndices[row], traitIndices[row], methodIndices[row], Main.isDebugPCode());
|
||||||
Main.getDebugHandler().setDepth(row);
|
DebuggerSession session = null;
|
||||||
|
if (currentSessionRef != null) {
|
||||||
|
session = currentSessionRef.get();
|
||||||
|
}
|
||||||
|
if (session != null) {
|
||||||
|
session.setDepth(row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,8 +124,12 @@ public class DebugStackPanel extends JPanel {
|
|||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refresh() {
|
public void refresh(DebuggerSession session) {
|
||||||
InBreakAtExt info = Main.getDebugHandler().getBreakInfo();
|
if (session == null) {
|
||||||
|
clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
InBreakAtExt info = session.getBreakInfo();
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
clear();
|
clear();
|
||||||
return;
|
return;
|
||||||
@@ -126,7 +142,7 @@ public class DebugStackPanel extends JPanel {
|
|||||||
int[] newTraitIndices = new int[info.files.size()];
|
int[] newTraitIndices = new int[info.files.size()];
|
||||||
for (int i = 0; i < info.files.size(); i++) {
|
for (int i = 0; i < info.files.size(); i++) {
|
||||||
int f = info.files.get(i);
|
int f = info.files.get(i);
|
||||||
String moduleName = Main.getDebugHandler().moduleToString(f);
|
String moduleName = session.moduleToString(f);
|
||||||
String swfHash = null;
|
String swfHash = null;
|
||||||
if (moduleName.contains(":")) {
|
if (moduleName.contains(":")) {
|
||||||
swfHash = moduleName.substring(0, moduleName.indexOf(":"));
|
swfHash = moduleName.substring(0, moduleName.indexOf(":"));
|
||||||
@@ -137,11 +153,11 @@ public class DebugStackPanel extends JPanel {
|
|||||||
data[i][1] = moduleName;
|
data[i][1] = moduleName;
|
||||||
data[i][2] = info.lines.get(i);
|
data[i][2] = info.lines.get(i);
|
||||||
data[i][3] = info.stacks.get(i);
|
data[i][3] = info.stacks.get(i);
|
||||||
Integer newClassIndex = Main.getDebugHandler().moduleToClassIndex(f);
|
Integer newClassIndex = session.moduleToClassIndex(f);
|
||||||
newClassIndices[i] = newClassIndex == null ? -1 : newClassIndex;
|
newClassIndices[i] = newClassIndex == null ? -1 : newClassIndex;
|
||||||
Integer newMethodIndex = Main.getDebugHandler().moduleToMethodIndex(f);
|
Integer newMethodIndex = session.moduleToMethodIndex(f);
|
||||||
newMethodIndices[i] = newMethodIndex == null ? -1 : newMethodIndex;
|
newMethodIndices[i] = newMethodIndex == null ? -1 : newMethodIndex;
|
||||||
Integer newTraitIndex = Main.getDebugHandler().moduleToTraitIndex(f);
|
Integer newTraitIndex = session.moduleToTraitIndex(f);
|
||||||
;
|
;
|
||||||
newTraitIndices[i] = newTraitIndex == null ? -1 : newTraitIndex;
|
newTraitIndices[i] = newTraitIndex == null ? -1 : newTraitIndex;
|
||||||
}
|
}
|
||||||
@@ -184,6 +200,7 @@ public class DebugStackPanel extends JPanel {
|
|||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
currentSessionRef = new WeakReference<>(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDepth() {
|
public int getDepth() {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -105,6 +105,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Proxy;
|
import java.net.Proxy;
|
||||||
@@ -231,49 +232,60 @@ public class Main {
|
|||||||
public static String currentDebuggerPackage = null;
|
public static String currentDebuggerPackage = null;
|
||||||
|
|
||||||
private static SWF runningSWF = null;
|
private static SWF runningSWF = null;
|
||||||
|
|
||||||
private static SWF debuggedSWF = null;
|
private static SWF debuggedSWF = null;
|
||||||
|
|
||||||
private static String preparedHashSha256 = null;
|
private static String preparedHashSha256 = null;
|
||||||
|
|
||||||
private static SwfPreparation runningPreparation = null;
|
private static SwfPreparation runningPreparation = null;
|
||||||
|
|
||||||
private static boolean loggingFileLoaded = false;
|
private static boolean loggingFileLoaded = false;
|
||||||
|
|
||||||
private static boolean debugListening = false;
|
private static boolean debugListening = false;
|
||||||
|
|
||||||
public static SWF getDebuggedSWF() {
|
public static SWF getDebuggedSWF() {
|
||||||
return debuggedSWF;
|
return debuggedSWF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setDebuggedSWF(SWF swf) {
|
||||||
public static void findDebuggedSwf(String hashSha256) {
|
debuggedSWF = swf;
|
||||||
|
}
|
||||||
System.err.println("Searching for hash " + hashSha256 + "...");
|
|
||||||
|
/**
|
||||||
|
* Searches opened swfs for swf with sha256 hash of its decompressed form
|
||||||
|
*
|
||||||
|
* @param hashSha256 Hex sha 256
|
||||||
|
* @return SWF or null if not found
|
||||||
|
*/
|
||||||
|
public static SWF findOpenedSwfByHash(String hashSha256) {
|
||||||
|
Logger.getLogger(Main.class.getName()).log(Level.FINE, "Searching for hash {0}...", hashSha256);
|
||||||
|
|
||||||
for (SWF swf : mainFrame.getPanel().getAllSwfs()) {
|
for (SWF swf : mainFrame.getPanel().getAllSwfs()) {
|
||||||
System.err.println("Checking " + swf +" with hash " + swf.getHashSha256());
|
Logger.getLogger(Main.class.getName()).log(Level.FINE, "Checking {0} with hash {1}", new Object[]{swf.toString(), swf.getHashSha256()});
|
||||||
if (Objects.equals(hashSha256, swf.getHashSha256())) {
|
if (Objects.equals(hashSha256, swf.getHashSha256())) {
|
||||||
Main.debuggedSWF = swf;
|
Logger.getLogger(Main.class.getName()).log(Level.FINE, "RECEIVED SWF FOUND");
|
||||||
System.err.println("RECEIVED SWF FOUND");
|
return swf;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preparedHashSha256 != null && hashSha256.equals(preparedHashSha256)) {
|
if (preparedHashSha256 != null && hashSha256.equals(preparedHashSha256)) {
|
||||||
System.err.println("RECEIVED SWF IS ONE THAT WAS PREPARED FOR RUN...");
|
Logger.getLogger(Main.class.getName()).log(Level.FINE, "RECEIVED SWF IS ONE THAT WAS PREPARED FOR RUN...");
|
||||||
Main.debuggedSWF = runningSWF;
|
return runningSWF;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.err.println("RECEIVED SWF IS NOT ANY OF OURS");
|
Logger.getLogger(Main.class.getName()).log(Level.FINE, "RECEIVED SWF IS NOT ANY OF OURS");
|
||||||
Main.debuggedSWF = null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SWF getRunningSWF() {
|
public static SWF getRunningSWF() {
|
||||||
//System.err.println("debuggedSWF: " + (debuggedSWF == null ? "NOT SET" : debuggedSWF));
|
//System.err.println("debuggedSWF: " + (debuggedSWF == null ? "NOT SET" : debuggedSWF));
|
||||||
//return runningSWF;
|
//return runningSWF;
|
||||||
return debuggedSWF;
|
//return debuggedSWF;
|
||||||
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
if (session != null) {
|
||||||
|
return session.getDebuggedSwfs().get(0);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WatchService getWatcher() {
|
public static WatchService getWatcher() {
|
||||||
@@ -331,12 +343,16 @@ public class Main {
|
|||||||
mainFrame.getPanel().clearDebuggerColors();
|
mainFrame.getPanel().clearDebuggerColors();
|
||||||
}
|
}
|
||||||
if (runProcessDebug) {
|
if (runProcessDebug) {
|
||||||
Main.getDebugHandler().disconnect();
|
Main.getDebugHandler().terminateAllSessions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean isDebugPaused() {
|
public static synchronized boolean isDebugPaused() {
|
||||||
return (runProcess != null && runProcessDebug || !flashDebugger.isStopped()) && getDebugHandler().isPaused();
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
if (session == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (runProcess != null && runProcessDebug || !flashDebugger.isStopped()) && session.isPaused();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean isDebugRunning() {
|
public static synchronized boolean isDebugRunning() {
|
||||||
@@ -348,60 +364,60 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean isDebugConnected() {
|
public static synchronized boolean isDebugConnected() {
|
||||||
return getDebugHandler().isConnected();
|
return getDebugHandler().isAnySessionConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean isRunning() {
|
public static synchronized boolean isRunning() {
|
||||||
return runProcess != null && !runProcessDebug;
|
return runProcess != null && !runProcessDebug;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void debugExportByteArray(Variable v, OutputStream os) throws IOException {
|
public static synchronized void debugExportByteArray(DebuggerSession session, Variable v, OutputStream os) throws IOException {
|
||||||
try {
|
try {
|
||||||
long objectId = 0L;
|
long objectId = 0L;
|
||||||
if ((v.vType == VariableType.OBJECT || v.vType == VariableType.MOVIECLIP)) {
|
if ((v.vType == VariableType.OBJECT || v.vType == VariableType.MOVIECLIP)) {
|
||||||
objectId = (Long) v.value;
|
objectId = (Long) v.value;
|
||||||
}
|
}
|
||||||
Object oldPos = getDebugHandler().getVariable(objectId, "position", false, true).parent.value;
|
Object oldPos = session.getVariable(objectId, "position", false, true).parent.value;
|
||||||
getDebugHandler().setVariable(objectId, "position", VariableType.NUMBER, 0);
|
session.setVariable(objectId, "position", VariableType.NUMBER, 0);
|
||||||
int length = (int) (double) (Double) getDebugHandler().getVariable(objectId, "length", false, true).parent.value;
|
int length = (int) (double) (Double) session.getVariable(objectId, "length", false, true).parent.value;
|
||||||
|
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
int b = (int) (double) (Double) getDebugHandler().callFunction(false, "readByte", v, new ArrayList<>()).variables.get(0).value;
|
int b = (int) (double) (Double) session.callFunction(false, "readByte", v, new ArrayList<>()).variables.get(0).value;
|
||||||
os.write(b);
|
os.write(b);
|
||||||
}
|
}
|
||||||
getDebugHandler().setVariable(objectId, "position", VariableType.NUMBER, oldPos);
|
session.setVariable(objectId, "position", VariableType.NUMBER, oldPos);
|
||||||
} catch (DebuggerHandler.ActionScriptException ex) {
|
} catch (DebuggerHandler.ActionScriptException ex) {
|
||||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void debugImportByteArray(Variable v, InputStream is) throws IOException {
|
public static synchronized void debugImportByteArray(DebuggerSession session, Variable v, InputStream is) throws IOException {
|
||||||
try {
|
try {
|
||||||
long objectId = 0L;
|
long objectId = 0L;
|
||||||
if ((v.vType == VariableType.OBJECT || v.vType == VariableType.MOVIECLIP)) {
|
if ((v.vType == VariableType.OBJECT || v.vType == VariableType.MOVIECLIP)) {
|
||||||
objectId = (Long) v.value;
|
objectId = (Long) v.value;
|
||||||
}
|
}
|
||||||
Double oldPos = (Double) getDebugHandler().getVariable(objectId, "position", false, true).parent.value;
|
Double oldPos = (Double) session.getVariable(objectId, "position", false, true).parent.value;
|
||||||
getDebugHandler().setVariable(objectId, "length", VariableType.NUMBER, 0);
|
session.setVariable(objectId, "length", VariableType.NUMBER, 0);
|
||||||
getDebugHandler().setVariable(objectId, "position", VariableType.NUMBER, 0);
|
session.setVariable(objectId, "position", VariableType.NUMBER, 0);
|
||||||
|
|
||||||
int length = 0;
|
int length = 0;
|
||||||
int b;
|
int b;
|
||||||
while ((b = is.read()) > -1) {
|
while ((b = is.read()) > -1) {
|
||||||
getDebugHandler().callFunction(false, "writeByte", v, Arrays.asList((Double) (double) b));
|
session.callFunction(false, "writeByte", v, Arrays.asList((Double) (double) b));
|
||||||
length++;
|
length++;
|
||||||
}
|
}
|
||||||
if (oldPos > length) {
|
if (oldPos > length) {
|
||||||
oldPos = (Double) (double) length;
|
oldPos = (Double) (double) length;
|
||||||
}
|
}
|
||||||
getDebugHandler().setVariable(objectId, "position", VariableType.NUMBER, oldPos);
|
session.setVariable(objectId, "position", VariableType.NUMBER, oldPos);
|
||||||
} catch (DebuggerHandler.ActionScriptException ex) {
|
} catch (DebuggerHandler.ActionScriptException ex) {
|
||||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean addWatch(Variable v, long v_id, boolean watchRead, boolean watchWrite) {
|
public static synchronized boolean addWatch(DebuggerSession session, Variable v, long v_id, boolean watchRead, boolean watchWrite) {
|
||||||
DebuggerCommands.Watch w = getDebugHandler().addWatch(v, v_id, watchRead, watchWrite);
|
DebuggerCommands.Watch w = session.addWatch(v, v_id, watchRead, watchWrite);
|
||||||
return w != null;
|
return w != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -591,9 +607,9 @@ public class Main {
|
|||||||
});
|
});
|
||||||
startWork(AppStrings.translate("work.generating_swd"), swfPrepareWorker, true);
|
startWork(AppStrings.translate("work.generating_swd"), swfPrepareWorker, true);
|
||||||
if (doPCode) {
|
if (doPCode) {
|
||||||
instrSWF.generatePCodeSwdFile(swdFile, getPackBreakPoints(true, swfHash), swfHash);
|
instrSWF.generatePCodeSwdFile(swdFile, getAllSessionPackBreakPoints(swfHash), swfHash);
|
||||||
} else {
|
} else {
|
||||||
instrSWF.generateSwdFile(swdFile, getPackBreakPoints(true, swfHash), swfHash);
|
instrSWF.generateSwdFile(swdFile, getAllSessionPackBreakPoints(swfHash), swfHash);
|
||||||
}
|
}
|
||||||
tempFiles.add(swdFile);
|
tempFiles.add(swdFile);
|
||||||
}
|
}
|
||||||
@@ -647,12 +663,12 @@ public class Main {
|
|||||||
try (FileOutputStream fos = new FileOutputStream(toPrepareFile)) {
|
try (FileOutputStream fos = new FileOutputStream(toPrepareFile)) {
|
||||||
instrSWF.saveTo(fos);
|
instrSWF.saveTo(fos);
|
||||||
}
|
}
|
||||||
if ("main".equals(swfHash)) {
|
if ("main".equals(swfHash)) {
|
||||||
preparedHashSha256 = instrSWF.getHashSha256();
|
preparedHashSha256 = instrSWF.getHashSha256();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void prepareForDebug(SWF swf, File fTempFile, File tempRunDir, List<File> tempFiles, boolean doPCode) throws IOException, InterruptedException {
|
public static void prepareForDebug(SWF swf, File fTempFile, File tempRunDir, List<File> tempFiles, boolean doPCode) throws IOException, InterruptedException {
|
||||||
SWF swfToSave = swf;
|
SWF swfToSave = swf;
|
||||||
if (swf.gfx) {
|
if (swf.gfx) {
|
||||||
@@ -661,9 +677,9 @@ public class Main {
|
|||||||
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(fTempFile))) {
|
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(fTempFile))) {
|
||||||
swfToSave.saveTo(fos, false, swf.gfx);
|
swfToSave.saveTo(fos, false, swf.gfx);
|
||||||
}
|
}
|
||||||
prepareSwf("main", new SwfDebugPrepare(doPCode), fTempFile, swf.getFile() == null ? null : new File(swf.getFile()), tempRunDir, tempFiles);
|
prepareSwf("main", new SwfDebugPrepare(doPCode), fTempFile, swf.getFile() == null ? null : new File(swf.getFile()), tempRunDir, tempFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File createTempFileInDir(File tempFilesDir, String prefix, String suffix) throws IOException {
|
private static File createTempFileInDir(File tempFilesDir, String prefix, String suffix) throws IOException {
|
||||||
if (tempFilesDir == null || !tempFilesDir.isDirectory()) {
|
if (tempFilesDir == null || !tempFilesDir.isDirectory()) {
|
||||||
return File.createTempFile(prefix, suffix);
|
return File.createTempFile(prefix, suffix);
|
||||||
@@ -847,10 +863,10 @@ public class Main {
|
|||||||
Main.startWork(AppStrings.translate("work.debugging.start") + "...", null, true);
|
Main.startWork(AppStrings.translate("work.debugging.start") + "...", null, true);
|
||||||
Main.startDebugger();
|
Main.startDebugger();
|
||||||
Main.startWork(AppStrings.translate("work.debugging.listening"), null);
|
Main.startWork(AppStrings.translate("work.debugging.listening"), null);
|
||||||
mainFrame.getMenu().hilightPath("/debugging");
|
mainFrame.getMenu().hilightPath("/debugging");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void runDebug(SWF swf, final boolean doPCode) {
|
public static void runDebug(SWF swf, final boolean doPCode) {
|
||||||
String flashVars = ""; //key=val&key2=val2
|
String flashVars = ""; //key=val&key2=val2
|
||||||
String playerLocation = Configuration.playerDebugLocation.get();
|
String playerLocation = Configuration.playerDebugLocation.get();
|
||||||
if (playerLocation.isEmpty() || (!new File(playerLocation).exists())) {
|
if (playerLocation.isEmpty() || (!new File(playerLocation).exists())) {
|
||||||
@@ -861,7 +877,7 @@ public class Main {
|
|||||||
if (swf == null) {
|
if (swf == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
debugHandler.setMainDebuggedSwf(swf);
|
//debugHandler.setMainDebuggedSwf(swf); ???
|
||||||
File tempRunDir = swf.getFile() == null ? null : new File(swf.getFile()).getParentFile();
|
File tempRunDir = swf.getFile() == null ? null : new File(swf.getFile()).getParentFile();
|
||||||
File tempFile = null;
|
File tempFile = null;
|
||||||
|
|
||||||
@@ -930,61 +946,121 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized int getIp(Object pack) {
|
public static synchronized int getIp(Object pack) {
|
||||||
return getDebugHandler().getBreakIp();
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
if (session == null) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return session.getBreakIp();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized String getIpClass() {
|
public static synchronized String getIpClass() {
|
||||||
return getDebugHandler().getBreakScriptName();
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
if (session == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return session.getBreakScriptName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized List<Integer> getStackLines() {
|
public static synchronized List<Integer> getStackLines() {
|
||||||
return getDebugHandler().getStackLines();
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
if (session == null) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return session.getStackLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized List<String> getStackClasses() {
|
public static synchronized List<String> getStackClasses() {
|
||||||
return getDebugHandler().getStackScripts();
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
if (session == null) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return session.getStackScripts();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean isBreakPointValid(String scriptName, int line) {
|
public static synchronized boolean isBreakPointValid(String scriptName, int line) {
|
||||||
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
if (session == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
||||||
return !getDebugHandler().isBreakpointInvalid(swf, scriptName, line);
|
return !session.isBreakpointInvalid(swf, scriptName, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void addBreakPoint(String scriptName, int line) {
|
public static synchronized void addBreakPoint(DebuggerSession session, String scriptName, int line) {
|
||||||
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
||||||
getDebugHandler().addBreakPoint(swf, scriptName, line);
|
session.addBreakPoint(swf, scriptName, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void removeBreakPoint(String scriptName, int line) {
|
public static synchronized void removeBreakPoint(DebuggerSession session, String scriptName, int line) {
|
||||||
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
||||||
getDebugHandler().removeBreakPoint(swf, scriptName, line);
|
session.removeBreakPoint(swf, scriptName, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean toggleBreakPoint(String scriptName, int line) {
|
public static synchronized boolean toggleBreakPoint(String scriptName, int line) {
|
||||||
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
||||||
if (getDebugHandler().isBreakpointToAdd(swf, scriptName, line) || getDebugHandler().isBreakpointConfirmed(swf, scriptName, line) || getDebugHandler().isBreakpointInvalid(swf, scriptName, line)) {
|
Map<String, Set<Integer>> breakPoints = getDebugHandler().getAllSessionsBreakPoints(swf);
|
||||||
|
|
||||||
|
if (breakPoints.containsKey(scriptName) && breakPoints.get(scriptName).contains(line)) {
|
||||||
getDebugHandler().removeBreakPoint(swf, scriptName, line);
|
getDebugHandler().removeBreakPoint(swf, scriptName, line);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
getDebugHandler().addBreakPoint(swf, scriptName, line);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDebugHandler().addBreakPoint(swf, scriptName, line);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/*if (session.isBreakpointToAdd(swf, scriptName, line) || session.isBreakpointConfirmed(swf, scriptName, line) || session.isBreakpointInvalid(swf, scriptName, line)) {
|
||||||
|
session.removeBreakPoint(swf, scriptName, line);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
session.addBreakPoint(swf, scriptName, line);
|
||||||
|
return true;
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized Map<String, Set<Integer>> getPackBreakPoints(boolean validOnly, String swfHash) {
|
public static synchronized Map<String, Set<Integer>> getAllSessionPackBreakPoints(String swfHash) {
|
||||||
SWF swf = Main.getSwfByHash(swfHash);
|
SWF swf = Main.getSwfByHash(swfHash);
|
||||||
return getDebugHandler().getAllBreakPoints(swf, validOnly);
|
return getDebugHandler().getAllSessionsBreakPoints(swf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized Set<Integer> getScriptBreakPoints(String pack, boolean onlyValid) {
|
public static synchronized Map<String, Set<Integer>> getPackBreakPoints(DebuggerSession session, boolean validOnly, String swfHash) {
|
||||||
|
SWF swf = Main.getSwfByHash(swfHash);
|
||||||
|
return session.getAllBreakPoints(swf, validOnly);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static synchronized Set<Integer> getScriptBreakPoints(String pack) {
|
||||||
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
SWF swf = getMainFrame().getPanel().getCurrentSwf();
|
||||||
return getDebugHandler().getBreakPoints(swf, pack, onlyValid);
|
return getDebugHandler().getAllSessionsScriptBreakPoints(swf, pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DebuggerHandler getDebugHandler() {
|
public static DebuggerHandler getDebugHandler() {
|
||||||
return debugHandler;
|
return debugHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DebuggerSession getCurrentDebugSession() {
|
||||||
|
if (mainFrame == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (mainFrame.getPanel() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
SWF currentSwf = mainFrame.getPanel().getCurrentSwf();
|
||||||
|
if (currentSwf == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return getDebugHandler().getSessionContainingSwf(currentSwf);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateSession() {
|
||||||
|
DebuggerSession session = getCurrentDebugSession();
|
||||||
|
for (DebuggerHandler.FrameChangeListener l : getDebugHandler().getFrameChangeListeners()) {
|
||||||
|
l.frameChanged(session);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDebugHandler().getNumberOfPausedSessions() > 0) {
|
||||||
|
mainFrame.getPanel().showDebugStackFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void ensureMainFrame() {
|
public static void ensureMainFrame() {
|
||||||
if (mainFrame == null) {
|
if (mainFrame == null) {
|
||||||
synchronized (Main.class) {
|
synchronized (Main.class) {
|
||||||
@@ -1027,8 +1103,8 @@ public class Main {
|
|||||||
loadFromMemoryFrame.setVisible(true);
|
loadFromMemoryFrame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setVariable(long parentId, String varName, int valueType, Object value) {
|
public static void setVariable(DebuggerSession session, long parentId, String varName, int valueType, Object value) {
|
||||||
getDebugHandler().setVariable(parentId, varName, valueType, value);
|
session.setVariable(parentId, varName, valueType, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setSubLimiter(boolean value) {
|
public static void setSubLimiter(boolean value) {
|
||||||
@@ -1100,7 +1176,7 @@ public class Main {
|
|||||||
public static void startWork(final String name, final int percent, final CancellableWorker worker, boolean force) {
|
public static void startWork(final String name, final int percent, final CancellableWorker worker, boolean force) {
|
||||||
working = true;
|
working = true;
|
||||||
long nowTime = System.currentTimeMillis();
|
long nowTime = System.currentTimeMillis();
|
||||||
if (mainFrame != null && nowTime < lastTimeStartWork + 1000) {
|
if (!force && mainFrame != null && nowTime < lastTimeStartWork + 1000) {
|
||||||
mainFrame.getPanel().setWorkStatusHidden(name, worker);
|
mainFrame.getPanel().setWorkStatusHidden(name, worker);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1117,7 +1193,7 @@ public class Main {
|
|||||||
if (loadingDialog != null) {
|
if (loadingDialog != null) {
|
||||||
loadingDialog.setDetail(name);
|
loadingDialog.setDetail(name);
|
||||||
loadingDialog.setPercent(percent);
|
loadingDialog.setPercent(percent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (CommandLineArgumentParser.isCommandLineMode()) {
|
if (CommandLineArgumentParser.isCommandLineMode()) {
|
||||||
System.out.println(name);
|
System.out.println(name);
|
||||||
@@ -1470,7 +1546,7 @@ public class Main {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
fc.addChoosableFileFilter(swtFilter);
|
fc.addChoosableFileFilter(swtFilter);
|
||||||
|
|
||||||
FileFilter gfxFilter = new FileFilter() {
|
FileFilter gfxFilter = new FileFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File f) {
|
public boolean accept(File f) {
|
||||||
@@ -1767,7 +1843,7 @@ public class Main {
|
|||||||
private final OpenableOpened executeAfterOpen;
|
private final OpenableOpened executeAfterOpen;
|
||||||
|
|
||||||
private final int[] reloadIndices;
|
private final int[] reloadIndices;
|
||||||
|
|
||||||
private final boolean loadSession;
|
private final boolean loadSession;
|
||||||
|
|
||||||
public OpenFileWorker(OpenableSourceInfo sourceInfo, boolean loadSession) {
|
public OpenFileWorker(OpenableSourceInfo sourceInfo, boolean loadSession) {
|
||||||
@@ -1891,6 +1967,14 @@ public class Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<String> breakpointsList = conf.getCustomDataAsList(CustomConfigurationKeys.KEY_BREAKPOINTS);
|
||||||
|
for (String breakpoint : breakpointsList) {
|
||||||
|
if (breakpoint.matches("^.*:[0-9]+$")) {
|
||||||
|
int line = Integer.parseInt(breakpoint.substring(breakpoint.lastIndexOf(":") + 1));
|
||||||
|
String scriptName = breakpoint.substring(0, breakpoint.lastIndexOf(":"));
|
||||||
|
getDebugHandler().addBreakPoint(swf, scriptName, line);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1901,7 +1985,7 @@ public class Main {
|
|||||||
View.execInEventDispatch(() -> {
|
View.execInEventDispatch(() -> {
|
||||||
if (mainFrame == null) {
|
if (mainFrame == null) {
|
||||||
ensureMainFrame();
|
ensureMainFrame();
|
||||||
Main.startWork(AppStrings.translate("work.creatingwindow") + "...", null);
|
Main.startWork(AppStrings.translate("work.creatingwindow") + "...", null);
|
||||||
}
|
}
|
||||||
loadingDialog.setVisible(false);
|
loadingDialog.setVisible(false);
|
||||||
|
|
||||||
@@ -1926,14 +2010,6 @@ public class Main {
|
|||||||
if (swfCustomConf != null) {
|
if (swfCustomConf != null) {
|
||||||
resourcesPathStr = swfCustomConf.getCustomData(CustomConfigurationKeys.KEY_LAST_SELECTED_PATH_RESOURCES, resourcesPathStr);
|
resourcesPathStr = swfCustomConf.getCustomData(CustomConfigurationKeys.KEY_LAST_SELECTED_PATH_RESOURCES, resourcesPathStr);
|
||||||
tagListPathStr = swfCustomConf.getCustomData(CustomConfigurationKeys.KEY_LAST_SELECTED_PATH_TAGLIST, null);
|
tagListPathStr = swfCustomConf.getCustomData(CustomConfigurationKeys.KEY_LAST_SELECTED_PATH_TAGLIST, null);
|
||||||
List<String> breakpointsList = swfCustomConf.getCustomDataAsList(CustomConfigurationKeys.KEY_BREAKPOINTS);
|
|
||||||
for (String breakpoint : breakpointsList) {
|
|
||||||
if (breakpoint.matches("^.*:[0-9]+$")) {
|
|
||||||
int line = Integer.parseInt(breakpoint.substring(breakpoint.lastIndexOf(":") + 1));
|
|
||||||
String scriptName = breakpoint.substring(0, breakpoint.lastIndexOf(":"));
|
|
||||||
getDebugHandler().addBreakPoint(fswf, scriptName, line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loadSession) {
|
if (loadSession) {
|
||||||
@@ -1954,7 +2030,7 @@ public class Main {
|
|||||||
mainFrame.getPanel().tagListTree.setSelectionPath(tp);
|
mainFrame.getPanel().tagListTree.setSelectionPath(tp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mainFrame.getPanel().tagListTree.setSelectionPathString(tagListPathStr);
|
mainFrame.getPanel().tagListTree.setSelectionPathString(tagListPathStr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mainFrame.getPanel().tagTree.setExpandPathString(resourcesPathStr);
|
mainFrame.getPanel().tagTree.setExpandPathString(resourcesPathStr);
|
||||||
@@ -2108,7 +2184,7 @@ public class Main {
|
|||||||
executeAfterOpen.run();
|
executeAfterOpen.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, loadSession
|
}, loadSession
|
||||||
);
|
);
|
||||||
return openResult;
|
return openResult;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -2139,7 +2215,7 @@ public class Main {
|
|||||||
|
|
||||||
return openFile(new OpenableSourceInfo[]{sourceInfo}, executeAfterOpen, new int[]{reloadIndex}, loadSession);
|
return openFile(new OpenableSourceInfo[]{sourceInfo}, executeAfterOpen, new int[]{reloadIndex}, loadSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OpenFileResult openFile(OpenableSourceInfo[] newSourceInfos) {
|
public static OpenFileResult openFile(OpenableSourceInfo[] newSourceInfos) {
|
||||||
View.checkAccess();
|
View.checkAccess();
|
||||||
|
|
||||||
@@ -2298,7 +2374,7 @@ public class Main {
|
|||||||
}
|
}
|
||||||
fc.setSelectedFile(fc.getCurrentDirectory().toPath().resolve(fileTitle).toFile());
|
fc.setSelectedFile(fc.getCurrentDirectory().toPath().resolve(fileTitle).toFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
FileFilter swcFilter = new FileFilter() {
|
FileFilter swcFilter = new FileFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File f) {
|
public boolean accept(File f) {
|
||||||
@@ -2312,31 +2388,31 @@ public class Main {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
fc.setFileFilter(swcFilter);
|
fc.setFileFilter(swcFilter);
|
||||||
|
|
||||||
if (fc.showSaveDialog(getDefaultMessagesComponent()) != JFileChooser.APPROVE_OPTION) {
|
if (fc.showSaveDialog(getDefaultMessagesComponent()) != JFileChooser.APPROVE_OPTION) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
File file = Helper.fixDialogFile(fc.getSelectedFile());
|
File file = Helper.fixDialogFile(fc.getSelectedFile());
|
||||||
String fileName = file.getAbsolutePath();
|
String fileName = file.getAbsolutePath();
|
||||||
|
|
||||||
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(".swc")) {
|
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(".swc")) {
|
||||||
fileName += ".swc";
|
fileName += ".swc";
|
||||||
}
|
}
|
||||||
|
|
||||||
SwfToSwcExporter exporter = new SwfToSwcExporter();
|
SwfToSwcExporter exporter = new SwfToSwcExporter();
|
||||||
try {
|
try {
|
||||||
exporter.exportSwf(swf, new File(fileName), false);
|
exporter.exportSwf(swf, new File(fileName), false);
|
||||||
} catch (IOException iex) {
|
} catch (IOException iex) {
|
||||||
ViewMessages.showMessageDialog(getDefaultMessagesComponent(), iex.getMessage(), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
ViewMessages.showMessageDialog(getDefaultMessagesComponent(), iex.getMessage(), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||||
return false;
|
return false;
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Configuration.lastSaveDir.set(file.getParentFile().getAbsolutePath());
|
Configuration.lastSaveDir.set(file.getParentFile().getAbsolutePath());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean saveFileDialog(Openable openable, final SaveFileMode mode) {
|
public static boolean saveFileDialog(Openable openable, final SaveFileMode mode) {
|
||||||
|
|
||||||
String ext = ".swf";
|
String ext = ".swf";
|
||||||
@@ -2387,7 +2463,7 @@ public class Main {
|
|||||||
return AppStrings.translate("filter.swt");
|
return AppStrings.translate("filter.swt");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FileFilter gfxFilter = new FileFilter() {
|
FileFilter gfxFilter = new FileFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File f) {
|
public boolean accept(File f) {
|
||||||
@@ -2492,14 +2568,14 @@ public class Main {
|
|||||||
} else if (openable instanceof SWF) {
|
} else if (openable instanceof SWF) {
|
||||||
SWF swf = (SWF) openable;
|
SWF swf = (SWF) openable;
|
||||||
if (swf.getFile() != null && swf.getFile().toLowerCase(Locale.ENGLISH).endsWith(".swt")) {
|
if (swf.getFile() != null && swf.getFile().toLowerCase(Locale.ENGLISH).endsWith(".swt")) {
|
||||||
fc.setFileFilter(swtFilter);
|
fc.setFileFilter(swtFilter);
|
||||||
fc.addChoosableFileFilter(swfFilter);
|
fc.addChoosableFileFilter(swfFilter);
|
||||||
} else {
|
} else {
|
||||||
fc.setFileFilter(swfFilter);
|
fc.setFileFilter(swfFilter);
|
||||||
fc.addChoosableFileFilter(swtFilter);
|
fc.addChoosableFileFilter(swtFilter);
|
||||||
}
|
}
|
||||||
fc.addChoosableFileFilter(gfxFilter);
|
fc.addChoosableFileFilter(gfxFilter);
|
||||||
|
|
||||||
} else if (openable instanceof ABC) {
|
} else if (openable instanceof ABC) {
|
||||||
fc.setFileFilter(abcFilter);
|
fc.setFileFilter(abcFilter);
|
||||||
}
|
}
|
||||||
@@ -2523,7 +2599,7 @@ public class Main {
|
|||||||
}
|
}
|
||||||
((SWF) openable).gfx = true;
|
((SWF) openable).gfx = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selFilter == swtFilter) {
|
if (selFilter == swtFilter) {
|
||||||
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(".swt")) {
|
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(".swt")) {
|
||||||
fileName += ".swt";
|
fileName += ".swt";
|
||||||
@@ -2662,7 +2738,7 @@ public class Main {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
fc.addChoosableFileFilter(swtFilter);
|
fc.addChoosableFileFilter(swtFilter);
|
||||||
|
|
||||||
FileFilter swcFilter = new FileFilter() {
|
FileFilter swcFilter = new FileFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File f) {
|
public boolean accept(File f) {
|
||||||
@@ -2805,7 +2881,7 @@ public class Main {
|
|||||||
initUiLang();
|
initUiLang();
|
||||||
|
|
||||||
initLookAndFeel();
|
initLookAndFeel();
|
||||||
|
|
||||||
View.execInEventDispatch(() -> {
|
View.execInEventDispatch(() -> {
|
||||||
ErrorLogFrame.createNewInstance();
|
ErrorLogFrame.createNewInstance();
|
||||||
|
|
||||||
@@ -2976,13 +3052,15 @@ public class Main {
|
|||||||
flashDebugger = new Debugger();
|
flashDebugger = new Debugger();
|
||||||
debugHandler = new DebuggerHandler();
|
debugHandler = new DebuggerHandler();
|
||||||
debugHandler.addBreakListener(new DebuggerHandler.BreakListener() {
|
debugHandler.addBreakListener(new DebuggerHandler.BreakListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doContinue() {
|
public void doContinue(DebuggerSession session) {
|
||||||
mainFrame.getPanel().clearDebuggerColors();
|
mainFrame.getPanel().clearDebuggerColors();
|
||||||
|
mainFrame.getMenu().updateComponents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakAt(String scriptName, int line, final int classIndex, final int traitIndex, final int methodIndex) {
|
public void breakAt(DebuggerSession session, String scriptName, int line, final int classIndex, final int traitIndex, final int methodIndex) {
|
||||||
View.execInEventDispatch(new Runnable() {
|
View.execInEventDispatch(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -2992,7 +3070,17 @@ public class Main {
|
|||||||
hash = scriptName.substring(0, scriptName.indexOf(":"));
|
hash = scriptName.substring(0, scriptName.indexOf(":"));
|
||||||
scriptNameNoHash = scriptName.substring(scriptName.indexOf(":") + 1);
|
scriptNameNoHash = scriptName.substring(scriptName.indexOf(":") + 1);
|
||||||
}
|
}
|
||||||
SWF swf = Main.getSwfByHash(hash);
|
SWF swf = "main".equals(hash) ? session.getDebuggedSwfs().get(0) : Main.getSwfByHash(hash);
|
||||||
|
Logger.getLogger(Main.class.getName()).log(Level.FINE, "Break. Current session: {0}, New break session: {1}", new Object[]{Main.getCurrentDebugSession(), session});
|
||||||
|
|
||||||
|
if (
|
||||||
|
Main.getDebugHandler().getNumberOfPausedSessions() > 1
|
||||||
|
&& Main.getCurrentDebugSession() != session
|
||||||
|
) {
|
||||||
|
Logger.getLogger(Main.class.getName()).log(Level.INFO, "Another SWF ({0}) has reached breakpoint meanwhile", swf.toString());
|
||||||
|
mainFrame.getPanel().refreshBreakPoints();
|
||||||
|
return;
|
||||||
|
}
|
||||||
mainFrame.getPanel().gotoScriptLine(swf, scriptNameNoHash, line, classIndex, traitIndex, methodIndex, Main.isDebugPCode());
|
mainFrame.getPanel().gotoScriptLine(swf, scriptNameNoHash, line, classIndex, traitIndex, methodIndex, Main.isDebugPCode());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -3000,12 +3088,12 @@ public class Main {
|
|||||||
});
|
});
|
||||||
debugHandler.addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
debugHandler.addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void connected() {
|
public void connected(DebuggerSession session) {
|
||||||
Main.mainFrame.getMenu().updateComponents();
|
Main.mainFrame.getMenu().updateComponents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected() {
|
public void disconnected(DebuggerSession session) {
|
||||||
if (Main.mainFrame != null) {
|
if (Main.mainFrame != null) {
|
||||||
Main.mainFrame.getMenu().updateComponents();
|
Main.mainFrame.getMenu().updateComponents();
|
||||||
}
|
}
|
||||||
@@ -3028,10 +3116,11 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void startDebugger() {
|
public static void startDebugger() {
|
||||||
flashDebugger.startDebugger();
|
flashDebugger.startDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void stopDebugger() {
|
public static void stopDebugger() {
|
||||||
|
getDebugHandler().terminateAllSessions();
|
||||||
flashDebugger.stopDebugger();
|
flashDebugger.stopDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3288,7 +3377,7 @@ public class Main {
|
|||||||
AppStrings.updateLanguage();
|
AppStrings.updateLanguage();
|
||||||
|
|
||||||
Helper.decompilationErrorAdd = AppStrings.translate(Configuration.autoDeobfuscate.get() ? "deobfuscation.comment.failed" : "deobfuscation.comment.tryenable");
|
Helper.decompilationErrorAdd = AppStrings.translate(Configuration.autoDeobfuscate.get() ? "deobfuscation.comment.failed" : "deobfuscation.comment.tryenable");
|
||||||
|
|
||||||
ResourceBundle advancedSettingsBundle = ResourceBundle.getBundle(AppStrings.getResourcePath(AdvancedSettingsDialog.class));
|
ResourceBundle advancedSettingsBundle = ResourceBundle.getBundle(AppStrings.getResourcePath(AdvancedSettingsDialog.class));
|
||||||
Set<String> configurationNames = Configuration.getConfigurationFields(false, true).keySet();
|
Set<String> configurationNames = Configuration.getConfigurationFields(false, true).keySet();
|
||||||
Map<String, String> titles = new LinkedHashMap<>();
|
Map<String, String> titles = new LinkedHashMap<>();
|
||||||
@@ -3298,7 +3387,7 @@ public class Main {
|
|||||||
titles.put(name, advancedSettingsBundle.getString("config.name." + name));
|
titles.put(name, advancedSettingsBundle.getString("config.name." + name));
|
||||||
}
|
}
|
||||||
if (advancedSettingsBundle.containsKey("config.description." + name)) {
|
if (advancedSettingsBundle.containsKey("config.description." + name)) {
|
||||||
descriptions.put(name, advancedSettingsBundle.getString("config.description." + name));
|
descriptions.put(name, advancedSettingsBundle.getString("config.description." + name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Configuration.setConfigurationDescriptions(descriptions);
|
Configuration.setConfigurationDescriptions(descriptions);
|
||||||
@@ -3358,11 +3447,11 @@ public class Main {
|
|||||||
*/
|
*/
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
decodeLaunch5jArgs(args);
|
decodeLaunch5jArgs(args);
|
||||||
preInitLogging();
|
preInitLogging();
|
||||||
setSessionLoaded(false);
|
setSessionLoaded(false);
|
||||||
|
|
||||||
System.setProperty("sun.io.serialization.extendedDebugInfo", "true");
|
System.setProperty("sun.io.serialization.extendedDebugInfo", "true");
|
||||||
|
|
||||||
clearTemp();
|
clearTemp();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -3638,17 +3727,17 @@ public class Main {
|
|||||||
if (!showStable && !showNightly) {
|
if (!showStable && !showNightly) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String stableTagName = "version" + ApplicationInfo.version_major + "." + ApplicationInfo.version_minor + "." + ApplicationInfo.version_release;
|
String stableTagName = "version" + ApplicationInfo.version_major + "." + ApplicationInfo.version_minor + "." + ApplicationInfo.version_release;
|
||||||
String ignoreVersion = "-";
|
String ignoreVersion = "-";
|
||||||
|
|
||||||
String currentTagName;
|
String currentTagName;
|
||||||
if (ApplicationInfo.nightly) {
|
if (ApplicationInfo.nightly) {
|
||||||
currentTagName = "nightly" + ApplicationInfo.version_build;
|
currentTagName = "nightly" + ApplicationInfo.version_build;
|
||||||
} else {
|
} else {
|
||||||
currentTagName = stableTagName;
|
currentTagName = stableTagName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showNightly) {
|
if (!showNightly) {
|
||||||
//prereleases are not shown as latest, when checking latest nightly, this is useless
|
//prereleases are not shown as latest, when checking latest nightly, this is useless
|
||||||
JsonValue latestVersionInfoJson = urlGetJson(ApplicationInfo.GITHUB_RELEASES_LATEST_URL);
|
JsonValue latestVersionInfoJson = urlGetJson(ApplicationInfo.GITHUB_RELEASES_LATEST_URL);
|
||||||
@@ -3799,7 +3888,7 @@ public class Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initLogging(boolean debug) {
|
public static void initLogging(boolean debug) {
|
||||||
if (loggingFileLoaded) {
|
if (loggingFileLoaded) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1756,11 +1756,11 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
|||||||
|
|
||||||
public boolean pauseActionPerformed(ActionEvent evt) {
|
public boolean pauseActionPerformed(ActionEvent evt) {
|
||||||
try {
|
try {
|
||||||
DebuggerCommands cmd = Main.getDebugHandler().getCommands();
|
DebuggerCommands cmd = Main.getCurrentDebugSession().getCommands();
|
||||||
//TODO
|
//TODO
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Main.getDebugHandler().disconnect();
|
Main.getCurrentDebugSession().disconnect();
|
||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -1770,13 +1770,13 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
DebuggerCommands cmd = Main.getDebugHandler().getCommands();
|
DebuggerCommands cmd = Main.getCurrentDebugSession().getCommands();
|
||||||
mainFrame.getPanel().clearDebuggerColors();
|
mainFrame.getPanel().clearDebuggerColors();
|
||||||
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
||||||
|
|
||||||
cmd.stepOver();
|
cmd.stepOver();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Main.getDebugHandler().disconnect();
|
Main.getCurrentDebugSession().disconnect();
|
||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -1784,13 +1784,13 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
|||||||
|
|
||||||
public boolean stepIntoActionPerformed(ActionEvent evt) {
|
public boolean stepIntoActionPerformed(ActionEvent evt) {
|
||||||
try {
|
try {
|
||||||
DebuggerCommands cmd = Main.getDebugHandler().getCommands();
|
DebuggerCommands cmd = Main.getCurrentDebugSession().getCommands();
|
||||||
mainFrame.getPanel().clearDebuggerColors();
|
mainFrame.getPanel().clearDebuggerColors();
|
||||||
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
||||||
|
|
||||||
cmd.stepInto();
|
cmd.stepInto();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Main.getDebugHandler().disconnect();
|
Main.getCurrentDebugSession().disconnect();
|
||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1799,12 +1799,12 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
|||||||
|
|
||||||
public boolean stepOutActionPerformed(ActionEvent evt) {
|
public boolean stepOutActionPerformed(ActionEvent evt) {
|
||||||
try {
|
try {
|
||||||
DebuggerCommands cmd = Main.getDebugHandler().getCommands();
|
DebuggerCommands cmd = Main.getCurrentDebugSession().getCommands();
|
||||||
mainFrame.getPanel().clearDebuggerColors();
|
mainFrame.getPanel().clearDebuggerColors();
|
||||||
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
||||||
cmd.stepOut();
|
cmd.stepOut();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Main.getDebugHandler().disconnect();
|
Main.getCurrentDebugSession().disconnect();
|
||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1813,12 +1813,12 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
|||||||
|
|
||||||
public boolean continueActionPerformed(ActionEvent evt) {
|
public boolean continueActionPerformed(ActionEvent evt) {
|
||||||
try {
|
try {
|
||||||
DebuggerCommands cmd = Main.getDebugHandler().getCommands();
|
DebuggerCommands cmd = Main.getCurrentDebugSession().getCommands();
|
||||||
mainFrame.getPanel().clearDebuggerColors();
|
mainFrame.getPanel().clearDebuggerColors();
|
||||||
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
Main.startWork(AppStrings.translate("work.debugging") + "...", null);
|
||||||
cmd.sendContinue();
|
cmd.sendContinue();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Main.getDebugHandler().disconnect();
|
Main.getCurrentDebugSession().disconnect();
|
||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -451,6 +451,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
private boolean loadingScrollPosEnabled = true;
|
private boolean loadingScrollPosEnabled = true;
|
||||||
|
|
||||||
private static final DataFlavor TREE_FILE_FLAVOR = new DataFlavor(TreeFileFlavor.class, "TreeFile");
|
private static final DataFlavor TREE_FILE_FLAVOR = new DataFlavor(TreeFileFlavor.class, "TreeFile");
|
||||||
|
|
||||||
|
private boolean editingStatusSet = false;
|
||||||
|
|
||||||
public synchronized void setLoadingScrollPosEnabled(boolean loadingScrollPosEnabled) {
|
public synchronized void setLoadingScrollPosEnabled(boolean loadingScrollPosEnabled) {
|
||||||
this.loadingScrollPosEnabled = loadingScrollPosEnabled;
|
this.loadingScrollPosEnabled = loadingScrollPosEnabled;
|
||||||
@@ -972,11 +974,15 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setEditingStatus() {
|
public void setEditingStatus() {
|
||||||
|
editingStatusSet = true;
|
||||||
statusPanel.setStatus(translate(Configuration.autoSaveTagModifications.get() ? "status.editing.autosave" : "status.editing"));
|
statusPanel.setStatus(translate(Configuration.autoSaveTagModifications.get() ? "status.editing.autosave" : "status.editing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearEditingStatus() {
|
public void clearEditingStatus() {
|
||||||
statusPanel.setStatus("");
|
if (editingStatusSet) {
|
||||||
|
statusPanel.setStatus("");
|
||||||
|
editingStatusSet = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWorkStatus(String s, CancellableWorker worker) {
|
public void setWorkStatus(String s, CancellableWorker worker) {
|
||||||
@@ -1116,7 +1122,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
debugStackPanel = new DebugStackPanel();
|
debugStackPanel = new DebugStackPanel();
|
||||||
Main.getDebugHandler().addBreakListener(new DebuggerHandler.BreakListener() {
|
Main.getDebugHandler().addBreakListener(new DebuggerHandler.BreakListener() {
|
||||||
@Override
|
@Override
|
||||||
public void breakAt(String scriptName, int line, int classIndex, int traitIndex, int methodIndex) {
|
public void breakAt(DebuggerSession session, String scriptName, int line, int classIndex, int traitIndex, int methodIndex) {
|
||||||
View.execInEventDispatchLater(new Runnable() {
|
View.execInEventDispatchLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -1126,23 +1132,25 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doContinue() {
|
public void doContinue(DebuggerSession session) {
|
||||||
View.execInEventDispatchLater(new Runnable() {
|
View.execInEventDispatchLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
showDetail(DETAILCARDEMPTYPANEL);
|
if (Main.getDebugHandler().getNumberOfPausedSessions() == 0) {
|
||||||
|
showDetail(DETAILCARDEMPTYPANEL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void connected() {
|
public void connected(DebuggerSession session) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected() {
|
public void disconnected(DebuggerSession session) {
|
||||||
View.execInEventDispatchLater(new Runnable() {
|
View.execInEventDispatchLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -1628,6 +1636,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
|
|
||||||
private void updateUi(final Openable openable) {
|
private void updateUi(final Openable openable) {
|
||||||
View.checkAccess();
|
View.checkAccess();
|
||||||
|
Main.updateSession();
|
||||||
SWF swf = null;
|
SWF swf = null;
|
||||||
if (openable instanceof SWF) {
|
if (openable instanceof SWF) {
|
||||||
swf = (SWF) openable;
|
swf = (SWF) openable;
|
||||||
@@ -1646,7 +1655,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
if (!abcFound) {
|
if (!abcFound) {
|
||||||
getABCPanel().setAbc(abcList.get(0).getABC());
|
getABCPanel().setAbc(abcList.get(0).getABC());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mainMenu.updateComponents(openable);
|
mainMenu.updateComponents(openable);
|
||||||
|
|
||||||
@@ -5766,7 +5775,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
|
|
||||||
private void valueChanged(Object source, TreePath selectedPath) {
|
private void valueChanged(Object source, TreePath selectedPath) {
|
||||||
TreeItem treeItem = selectedPath == null ? null : (TreeItem) selectedPath.getLastPathComponent();
|
TreeItem treeItem = selectedPath == null ? null : (TreeItem) selectedPath.getLastPathComponent();
|
||||||
|
|
||||||
|
Main.updateSession();
|
||||||
if (treeItem == null) {
|
if (treeItem == null) {
|
||||||
updateUi(null);
|
updateUi(null);
|
||||||
reload(false);
|
reload(false);
|
||||||
@@ -6360,7 +6370,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
if (openable instanceof SWF) {
|
if (openable instanceof SWF) {
|
||||||
SwfSpecificCustomConfiguration swfCustomConf = Configuration.getOrCreateSwfSpecificCustomConfiguration(openable.getShortPathTitle());
|
SwfSpecificCustomConfiguration swfCustomConf = Configuration.getOrCreateSwfSpecificCustomConfiguration(openable.getShortPathTitle());
|
||||||
SWF swf = (SWF) openable;
|
SWF swf = (SWF) openable;
|
||||||
Map<String, Set<Integer>> breakpoints = Main.getDebugHandler().getAllBreakPoints(swf, false);
|
Map<String, Set<Integer>> breakpoints = Main.getDebugHandler().getAllSessionsBreakPoints(swf);
|
||||||
List<String> breakpointList = new ArrayList<>();
|
List<String> breakpointList = new ArrayList<>();
|
||||||
for (String scriptName : breakpoints.keySet()) {
|
for (String scriptName : breakpoints.keySet()) {
|
||||||
for (int line : breakpoints.get(scriptName)) {
|
for (int line : breakpoints.get(scriptName)) {
|
||||||
@@ -7053,4 +7063,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
public EasyPanel getEasyPanel() {
|
public EasyPanel getEasyPanel() {
|
||||||
return easyPanel;
|
return easyPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showDebugStackFrame() {
|
||||||
|
showDetail(DETAILCARDDEBUGSTACKFRAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.jpexs.decompiler.flash.gui.AppDialog;
|
|||||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||||
import com.jpexs.decompiler.flash.gui.DebugPanel;
|
import com.jpexs.decompiler.flash.gui.DebugPanel;
|
||||||
import com.jpexs.decompiler.flash.gui.DebuggerHandler;
|
import com.jpexs.decompiler.flash.gui.DebuggerHandler;
|
||||||
|
import com.jpexs.decompiler.flash.gui.DebuggerSession;
|
||||||
import com.jpexs.decompiler.flash.gui.FasterScrollPane;
|
import com.jpexs.decompiler.flash.gui.FasterScrollPane;
|
||||||
import com.jpexs.decompiler.flash.gui.HeaderLabel;
|
import com.jpexs.decompiler.flash.gui.HeaderLabel;
|
||||||
import com.jpexs.decompiler.flash.gui.Main;
|
import com.jpexs.decompiler.flash.gui.Main;
|
||||||
@@ -388,9 +389,9 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
|||||||
boolean isAS3 = (Main.getMainFrame().getPanel().getCurrentSwf().isAS3());
|
boolean isAS3 = (Main.getMainFrame().getPanel().getCurrentSwf().isAS3());
|
||||||
|
|
||||||
if (parentObjectId == 0 && objectId != 0L && isAS3) {
|
if (parentObjectId == 0 && objectId != 0L && isAS3) {
|
||||||
igv = Main.getDebugHandler().getVariable(objectId, "", true, useGetter);
|
igv = Main.getCurrentDebugSession().getVariable(objectId, "", true, useGetter);
|
||||||
} else {
|
} else {
|
||||||
igv = Main.getDebugHandler().getVariable(parentObjectId, var.name, true, useGetter);
|
igv = Main.getCurrentDebugSession().getVariable(parentObjectId, var.name, true, useGetter);
|
||||||
}
|
}
|
||||||
|
|
||||||
//current var is getter function - set it to value really got
|
//current var is getter function - set it to value really got
|
||||||
@@ -782,7 +783,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Main.getDebugHandler().setVariable(((VariableNode) node).parentObjectId, ((VariableNode) node).var.name, valType, symb.value);
|
Main.getCurrentDebugSession().setVariable(((VariableNode) node).parentObjectId, ((VariableNode) node).var.name, valType, symb.value);
|
||||||
//((VariableNode) node).refresh();
|
//((VariableNode) node).refresh();
|
||||||
Object[] path = new Object[((VariableNode) node).path.size()];
|
Object[] path = new Object[((VariableNode) node).path.size()];
|
||||||
for (int i = 0; i < path.length; i++) {
|
for (int i = 0; i < path.length; i++) {
|
||||||
@@ -1422,13 +1423,15 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
|||||||
|
|
||||||
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void connected() {
|
public void connected(DebuggerSession session) {
|
||||||
decButtonsPan.setVisible(false);
|
decButtonsPan.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected() {
|
public void disconnected(DebuggerSession session) {
|
||||||
decButtonsPan.setVisible(true);
|
if (!Main.getDebugHandler().isAnySessionConnected()) {
|
||||||
|
decButtonsPan.setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Trait;
|
|||||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||||
import com.jpexs.decompiler.flash.gui.DebuggerHandler;
|
import com.jpexs.decompiler.flash.gui.DebuggerHandler;
|
||||||
|
import com.jpexs.decompiler.flash.gui.DebuggerSession;
|
||||||
import com.jpexs.decompiler.flash.gui.HeaderLabel;
|
import com.jpexs.decompiler.flash.gui.HeaderLabel;
|
||||||
import com.jpexs.decompiler.flash.gui.Main;
|
import com.jpexs.decompiler.flash.gui.Main;
|
||||||
import com.jpexs.decompiler.flash.gui.MainPanel;
|
import com.jpexs.decompiler.flash.gui.MainPanel;
|
||||||
@@ -146,7 +147,7 @@ public class DetailPanel extends JPanel implements TagEditorPanel {
|
|||||||
|
|
||||||
conListener = new DebuggerHandler.ConnectionListener() {
|
conListener = new DebuggerHandler.ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void connected() {
|
public void connected(DebuggerSession session) {
|
||||||
synchronized (DetailPanel.this) {
|
synchronized (DetailPanel.this) {
|
||||||
debugRunning = true;
|
debugRunning = true;
|
||||||
if (buttonsPanel != null) {
|
if (buttonsPanel != null) {
|
||||||
@@ -156,7 +157,10 @@ public class DetailPanel extends JPanel implements TagEditorPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected() {
|
public void disconnected(DebuggerSession session) {
|
||||||
|
if (Main.getDebugHandler().isAnySessionConnected()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
synchronized (DetailPanel.this) {
|
synchronized (DetailPanel.this) {
|
||||||
debugRunning = false;
|
debugRunning = false;
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
|||||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||||
import com.jpexs.decompiler.flash.gui.DebugPanel;
|
import com.jpexs.decompiler.flash.gui.DebugPanel;
|
||||||
import com.jpexs.decompiler.flash.gui.DebuggerHandler;
|
import com.jpexs.decompiler.flash.gui.DebuggerHandler;
|
||||||
|
import com.jpexs.decompiler.flash.gui.DebuggerSession;
|
||||||
import com.jpexs.decompiler.flash.gui.DocsPanel;
|
import com.jpexs.decompiler.flash.gui.DocsPanel;
|
||||||
import com.jpexs.decompiler.flash.gui.FasterScrollPane;
|
import com.jpexs.decompiler.flash.gui.FasterScrollPane;
|
||||||
import com.jpexs.decompiler.flash.gui.GraphDialog;
|
import com.jpexs.decompiler.flash.gui.GraphDialog;
|
||||||
@@ -1065,12 +1066,15 @@ public class ActionPanel extends JPanel implements SearchListener<ScriptSearchRe
|
|||||||
//decPanel.add(searchPanel, BorderLayout.NORTH);
|
//decPanel.add(searchPanel, BorderLayout.NORTH);
|
||||||
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
Main.getDebugHandler().addConnectionListener(new DebuggerHandler.ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void connected() {
|
public void connected(DebuggerSession session) {
|
||||||
decButtonsPan.setVisible(false);
|
decButtonsPan.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected() {
|
public void disconnected(DebuggerSession session) {
|
||||||
|
if (Main.getDebugHandler().isAnySessionConnected()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
decButtonsPan.setVisible(true);
|
decButtonsPan.setVisible(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class DebuggableEditorPane extends LineMarkedEditorPane implements BreakP
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Integer> bkptLines = Main.getScriptBreakPoints(breakPointScriptName, false);
|
Set<Integer> bkptLines = Main.getScriptBreakPoints(breakPointScriptName);
|
||||||
|
|
||||||
for (int line : bkptLines) {
|
for (int line : bkptLines) {
|
||||||
if (Main.isBreakPointValid(breakPointScriptName, line)) {
|
if (Main.isBreakPointValid(breakPointScriptName, line)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user