diff --git a/src/com/jpexs/decompiler/flash/gui/DebugPanel.java b/src/com/jpexs/decompiler/flash/gui/DebugPanel.java index 20f4427cd..ac1866fd6 100644 --- a/src/com/jpexs/decompiler/flash/gui/DebugPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/DebugPanel.java @@ -19,12 +19,7 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.debugger.flash.Variable; import com.jpexs.debugger.flash.messages.in.InBreakAtExt; import com.jpexs.debugger.flash.messages.in.InFrame; -import com.jpexs.decompiler.flash.gui.AppStrings; -import com.jpexs.decompiler.flash.gui.DebuggerHandler; import com.jpexs.decompiler.flash.gui.DebuggerHandler.BreakListener; -import com.jpexs.decompiler.flash.gui.HeaderLabel; -import com.jpexs.decompiler.flash.gui.Main; -import com.jpexs.decompiler.flash.gui.View; import com.jpexs.decompiler.flash.gui.abc.ABCPanel; import java.awt.BorderLayout; import java.awt.Color; @@ -51,15 +46,25 @@ import javax.swing.table.DefaultTableModel; public class DebugPanel extends JPanel { private JTable debugRegistersTable; + private JTable debugLocalsTable; + private JTable debugScopeTable; + private JTable callStackTable; + private JTable stackTable; + private JTabbedPane varTabs; + private BreakListener listener; + private JTextArea traceLogTextarea; + private int logLength = 0; + private List tabTypes = new ArrayList<>(); + private boolean loading = false; public static enum SelectedTab { @@ -314,5 +319,4 @@ public class DebugPanel extends JPanel { public void dispose() { Main.getDebugHandler().removeBreakListener(listener); } - } diff --git a/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java b/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java index afea91060..77239fb96 100644 --- a/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java +++ b/src/com/jpexs/decompiler/flash/gui/DebuggerHandler.java @@ -21,8 +21,6 @@ import com.jpexs.debugger.flash.DebugMessageListener; import com.jpexs.debugger.flash.Debugger; import com.jpexs.debugger.flash.DebuggerCommands; import com.jpexs.debugger.flash.DebuggerConnection; -import com.jpexs.debugger.flash.SWD; -import com.jpexs.debugger.flash.Variable; import com.jpexs.debugger.flash.messages.in.InAskBreakpoints; import com.jpexs.debugger.flash.messages.in.InBreakAt; import com.jpexs.debugger.flash.messages.in.InBreakAtExt; @@ -42,15 +40,11 @@ import com.jpexs.debugger.flash.messages.out.OutGetBreakReason; import com.jpexs.debugger.flash.messages.out.OutGetSwd; import com.jpexs.debugger.flash.messages.out.OutGetSwf; import com.jpexs.debugger.flash.messages.out.OutProcessedTag; -import com.jpexs.decompiler.flash.abc.ClassPath; -import com.jpexs.decompiler.flash.abc.ScriptPack; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.graph.DottedChain; -import com.jpexs.helpers.CancellableWorker; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -68,18 +62,27 @@ import java.util.regex.Pattern; public class DebuggerHandler implements DebugConnectionListener { private boolean connected = false; + private DebuggerCommands commands = null; + private List swfs = new ArrayList<>(); + private boolean paused = true; + private Map modulePaths = new HashMap<>(); + private Map classToModule = new HashMap<>(); private Map> toAddBPointMap = new HashMap<>(); + private Map> confirmedPointMap = new HashMap<>(); + private Map> invalidBreakPointMap = new HashMap<>(); + private Map> toRemoveBPointMap = new HashMap<>(); private int breakIp = -1; + private String breakScriptName = null; public int getBreakIp() { @@ -221,6 +224,7 @@ public class DebuggerHandler implements DebugConnectionListener { private InFrame frame; private InBreakAtExt breakInfo; + private InBreakReason breakReason; private final List breakListeners = new ArrayList<>(); @@ -255,13 +259,11 @@ public class DebuggerHandler implements DebugConnectionListener { public void connected(); public void disconnected(); - } public static interface TraceListener { public void trace(String... val); - } public static interface BreakListener { @@ -269,7 +271,6 @@ public class DebuggerHandler implements DebugConnectionListener { public void breakAt(String scriptName, int line); public void doContinue(); - } public void addBreakListener(BreakListener l) { diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java index f0a06af67..e68477e16 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.gui; -import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; import com.jpexs.helpers.Helper; @@ -29,9 +28,6 @@ import java.awt.event.ComponentEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowStateListener; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JFrame; /** @@ -141,5 +137,4 @@ public final class MainFrameClassic extends AppFrame implements MainFrame { public MainFrameMenu getMenu() { return mainMenu; } - } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java index 6c41bfd53..be4c9b92d 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java @@ -373,5 +373,4 @@ public class MainFrameClassicMenu extends MainFrameMenu { ((JComponent) me).setVisible(val); } } - } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java index 3a5081837..cc5a2986d 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.gui; -import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; import com.jpexs.decompiler.flash.treeitems.SWFList; @@ -33,10 +32,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowStateListener; import java.io.File; -import java.io.IOException; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JFrame; import org.pushingpixels.flamingo.api.ribbon.JRibbon; import org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton; @@ -199,5 +195,4 @@ public final class MainFrameRibbon extends AppRibbonFrame { public MainFrameMenu getMenu() { return mainMenu; } - } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java index cd6c33b07..86fdef902 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java @@ -37,7 +37,6 @@ import org.pushingpixels.flamingo.api.common.CommandToggleButtonGroup; import org.pushingpixels.flamingo.api.common.JCommandButton; import org.pushingpixels.flamingo.api.common.JCommandButtonPanel; import org.pushingpixels.flamingo.api.common.JCommandToggleButton; -import org.pushingpixels.flamingo.api.common.RichTooltip; import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; import org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback; import org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand; @@ -291,7 +290,7 @@ public class MainFrameRibbonMenu extends MainFrameMenu { cbut = new JCommandButton(fixCommandTitle(subTitle)); } if (subKey != null) { - //cbut.setActionRichTooltip(new RichTooltip(subTitle, subKey.toString())); + //cbut.setActionRichTooltip(new RichTooltip(subTitle, subKey.toString())); } if (subLoader != null) { cbut.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION); @@ -639,5 +638,4 @@ public class MainFrameRibbonMenu extends MainFrameMenu { } } - } diff --git a/src/com/jpexs/decompiler/flash/gui/MenuBuilder.java b/src/com/jpexs/decompiler/flash/gui/MenuBuilder.java index 12c4a4c91..764acf620 100644 --- a/src/com/jpexs/decompiler/flash/gui/MenuBuilder.java +++ b/src/com/jpexs/decompiler/flash/gui/MenuBuilder.java @@ -32,6 +32,7 @@ public interface MenuBuilder { public static class HotKey { private static Map keyCodesToNames = new HashMap<>(); + private static Map keyNamesToCodes = new HashMap<>(); { @@ -57,8 +58,11 @@ public interface MenuBuilder { } public int key; + public boolean shiftDown; + public boolean ctrlDown; + public boolean altDown; @Override @@ -163,7 +167,6 @@ public interface MenuBuilder { return s; } - } public static final int PRIORITY_LOW = 1; diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 642500109..40cc70650 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -16,11 +16,7 @@ */ package com.jpexs.decompiler.flash.gui.abc; -import com.jpexs.decompiler.flash.gui.DebugPanel; import com.jpexs.debugger.flash.Variable; -import com.jpexs.debugger.flash.messages.in.InBreakAtExt; -import com.jpexs.debugger.flash.messages.in.InBreakReason; -import com.jpexs.debugger.flash.messages.in.InFrame; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.ClassPath; @@ -45,6 +41,7 @@ import com.jpexs.decompiler.flash.abc.usages.TraitMultinameUsage; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.AppDialog; import com.jpexs.decompiler.flash.gui.AppStrings; +import com.jpexs.decompiler.flash.gui.DebugPanel; import com.jpexs.decompiler.flash.gui.DebuggerHandler; import com.jpexs.decompiler.flash.gui.HeaderLabel; import com.jpexs.decompiler.flash.gui.Main; @@ -87,7 +84,6 @@ import java.awt.event.MouseMotionListener; import java.io.File; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; @@ -105,7 +101,6 @@ import javax.swing.JTable; import javax.swing.JToggleButton; import javax.swing.SwingConstants; import javax.swing.border.BevelBorder; -import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; @@ -272,6 +267,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener tableListeners = new ArrayList<>(); + private List vars; public VariablesTableModel(List vars) { @@ -348,7 +344,6 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener parameters = new HashMap<>(); public static final int MSG_STRING = 0; + public static final int MSG_LOADER_URL = 1; + public static final int MSG_LOADER_BYTES = 2; public String getParameter(String name, String defValue) { diff --git a/src/com/jpexs/decompiler/flash/gui/editor/DebuggableEditorPane.java b/src/com/jpexs/decompiler/flash/gui/editor/DebuggableEditorPane.java index 15cdecf5e..71964246a 100644 --- a/src/com/jpexs/decompiler/flash/gui/editor/DebuggableEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/editor/DebuggableEditorPane.java @@ -35,25 +35,35 @@ import jsyntaxpane.components.LineNumbersBreakpointsRuler; public class DebuggableEditorPane extends LineMarkedEditorPane implements BreakPointListener, LineMarkerPainter { private static final Color BG_CURRENT_COLOR = new Color(0xd6, 0xe8, 0xe2); + private static final Color BG_RULER_COLOR = new Color(0xe9, 0xe8, 0xe2); private static final Color BG_BREAKPOINT_COLOR = new Color(0xfc, 0x9d, 0x9f); + private static final Color FG_BREAKPOINT_COLOR = null; + private static final int PRIORITY_BREAKPOINT = 20; private static final Color BG_IP_COLOR = new Color(0xbd, 0xe6, 0xaa); + private static final Color FG_IP_COLOR = null; + private static final int PRIORITY_IP = 0; private static final Color BG_INVALID_BREAKPOINT_COLOR = new Color(0xdc, 0xdc, 0xd8); + private static final Color FG_INVALID_BREAKPOINT_COLOR = null; + private static final int PRIORITY_INVALID_BREAKPOINT = 10; public static final LineMarker BREAKPOINT_MARKER = new LineMarker(FG_BREAKPOINT_COLOR, BG_BREAKPOINT_COLOR, PRIORITY_BREAKPOINT); + public static final LineMarker IP_MARKER = new LineMarker(FG_IP_COLOR, BG_IP_COLOR, PRIORITY_IP); + public static final LineMarker INVALID_BREAKPOINT_MARKER = new LineMarker(FG_INVALID_BREAKPOINT_COLOR, BG_INVALID_BREAKPOINT_COLOR, PRIORITY_INVALID_BREAKPOINT); protected String scriptName = null; + private LineNumbersBreakpointsRuler ruler; public synchronized void setScriptName(String scriptName) { @@ -180,5 +190,4 @@ public class DebuggableEditorPane extends LineMarkedEditorPane implements BreakP super.removeColorMarker(line, lm); ruler.repaint(); } - } diff --git a/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java b/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java index 062e1dbd5..c5b2d51e3 100644 --- a/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java @@ -65,6 +65,7 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan private static final int truncateLimit = 2 * 1024 * 1024; public static final Color BG_SELECTED_LINE = new Color(0xe9, 0xef, 0xf8); + public static final Color BG_ERROR_LINE = new Color(255, 200, 200); private int lastLine = -1; @@ -80,8 +81,11 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan public static class LineMarker implements Comparable { private Color bgColor; + private Color color; + private FgPainter fgPainter; + //private int line; private int priority; @@ -140,6 +144,7 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan } } //(Map>) + private Map> lineMarkers = Collections.synchronizedMap(new HashMap>()); public void setLineMarkers(Map> colorMarkers) { @@ -415,7 +420,7 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan t = t.substring(0, truncateLimit) + "\r\n" + AppStrings.translate("editorTruncateWarning").replace("%chars%", Integer.toString(truncateLimit)); } super.setText(t); - setCaretPosition(0); //scroll to top + setCaretPosition(0); //scroll to top } public static class FgPainter extends DefaultHighlighter.DefaultHighlightPainter { @@ -613,5 +618,4 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan } } } - }