diff --git a/CHANGELOG.md b/CHANGELOG.md index 66fa2d0ae..7605a292c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added +- Debugger - Debugged SWF file name in the session title + ### Fixed - [#2639] Export to FLA - missing sound streams - Debugger - Threading issues with multiple SWFs diff --git a/src/com/jpexs/decompiler/flash/gui/DebugStackPanel.java b/src/com/jpexs/decompiler/flash/gui/DebugStackPanel.java index a537c26c2..294e5662a 100644 --- a/src/com/jpexs/decompiler/flash/gui/DebugStackPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/DebugStackPanel.java @@ -275,7 +275,7 @@ public class DebugStackPanel extends JPanel { if (session == null) { return "-"; } - return AppStrings.translate("debug.session").replace("%id%", "" + id) + (session.isPaused() ? "" : " " + AppStrings.translate("debug.session.running")); + return AppStrings.translate("debug.session").replace("%id%", "" + id) + (session.getTitle().isEmpty() ? "" : " - " + session.getTitle()) + (session.isPaused() ? "" : " " + AppStrings.translate("debug.session.running")); } } @@ -305,13 +305,15 @@ public class DebugStackPanel extends JPanel { j++; } sessionComboBoxCreating = true; - sessionComboBox.setModel(model); if (itemIndex > -1) { final int fItemIndex = itemIndex; View.execInEventDispatchLater(new Runnable() { @Override public void run() { - sessionComboBox.setSelectedIndex(fItemIndex); + sessionComboBox.setModel(model); + if (fItemIndex < model.getSize()) { + sessionComboBox.setSelectedIndex(fItemIndex); + } lastSessionComboBoxIndex = fItemIndex; sessionComboBoxCreating = false; } diff --git a/src/com/jpexs/decompiler/flash/gui/DebuggerSession.java b/src/com/jpexs/decompiler/flash/gui/DebuggerSession.java index 4e26ad503..4df57d67c 100644 --- a/src/com/jpexs/decompiler/flash/gui/DebuggerSession.java +++ b/src/com/jpexs/decompiler/flash/gui/DebuggerSession.java @@ -136,12 +136,14 @@ public class DebuggerSession { private InSetBreakpoint inSetBreakpoint; private int id; + + private String title = ""; private List getSwfThreadList = Collections.synchronizedList(new ArrayList<>()); public DebuggerSession(DebuggerHandler handler, DebuggerConnection con, Map>> breakpoints) { - id = con.getId(); + id = con.getId(); toAddBPointMap = breakpoints; this.handler = handler; @@ -397,6 +399,9 @@ public class DebuggerSession { } if (!debuggedSwfs.isEmpty() && modulesEmptyBefore) { + if (title.isEmpty()) { + title = debuggedSwfs.values().iterator().next().toString(); + } if (con.isAS3) { //Widelines - only AS3, it hangs in AS1/2 and SWD does not support UI32 lines con.wideLines = commands.getOption("wide_line_player", "false").equals("true"); @@ -1274,4 +1279,8 @@ public class DebuggerSession { public String toString() { return "[s:" + id + "]"; } + + public String getTitle() { + return title; + } }