diff --git a/CHANGELOG.md b/CHANGELOG.md index 193247d67..f10d77beb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fixed +- Debugger - getting children of top level variables ## [20.1.0] - 2023-12-30 ### Added diff --git a/src/com/jpexs/decompiler/flash/gui/DebugPanel.java b/src/com/jpexs/decompiler/flash/gui/DebugPanel.java index 39599c272..f7a7e219e 100644 --- a/src/com/jpexs/decompiler/flash/gui/DebugPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/DebugPanel.java @@ -164,8 +164,8 @@ public class DebugPanel extends JPanel { public DebugPanel() { super(new BorderLayout()); - debugRegistersTable = new MyTreeTable(new ABCPanel.VariablesTableModel(debugRegistersTable, new ArrayList<>(), new ArrayList<>()), false); - debugLocalsTable = new MyTreeTable(new ABCPanel.VariablesTableModel(debugLocalsTable, new ArrayList<>(), new ArrayList<>()), false); + debugRegistersTable = new MyTreeTable(new ABCPanel.VariablesTableModel(debugRegistersTable, new ArrayList<>()), false); + debugLocalsTable = new MyTreeTable(new ABCPanel.VariablesTableModel(debugLocalsTable, new ArrayList<>()), false); MouseAdapter watchHandler = new MouseAdapter() { @@ -372,7 +372,7 @@ public class DebugPanel extends JPanel { debugLocalsTable.addMouseListener(watchHandler); //debugScopeTable.addMouseListener(watchHandler); - debugScopeTable = new MyTreeTable(new ABCPanel.VariablesTableModel(debugScopeTable, new ArrayList<>(), new ArrayList<>()), false); + debugScopeTable = new MyTreeTable(new ABCPanel.VariablesTableModel(debugScopeTable, new ArrayList<>()), false); constantPoolTable = new JTable(); traceLogTextarea = new JTextArea(); @@ -516,11 +516,7 @@ public class DebugPanel extends JPanel { if (!as3) { root = Main.getDebugHandler().getVariable(0, "_root", false, false).parent; } - List regVarIds = new ArrayList<>(); - for (int i = 0; i < f.registers.size(); i++) { - regVarIds.add(0L); - } - safeSetTreeModel(debugRegistersTable, new ABCPanel.VariablesTableModel(debugRegistersTable, f.registers, regVarIds)); + safeSetTreeModel(debugRegistersTable, new ABCPanel.VariablesTableModel(debugRegistersTable, f.registers)); List locals = new ArrayList<>(); if (root != null) { locals.add(root); @@ -528,13 +524,9 @@ public class DebugPanel extends JPanel { locals.addAll(f.arguments); locals.addAll(f.variables); - List localIds = new ArrayList<>(); - localIds.addAll(f.argumentFrameIds); - localIds.addAll(f.frameIds); - - localsTable = new ABCPanel.VariablesTableModel(debugLocalsTable, locals, localIds); + localsTable = new ABCPanel.VariablesTableModel(debugLocalsTable, locals); safeSetTreeModel(debugLocalsTable, localsTable); - safeSetTreeModel(debugScopeTable, new ABCPanel.VariablesTableModel(debugScopeTable, f.scopeChain, f.scopeChainFrameIds)); + safeSetTreeModel(debugScopeTable, new ABCPanel.VariablesTableModel(debugScopeTable, f.scopeChain)); /*TableModelListener refreshListener = new TableModelListener() { @Override @@ -571,9 +563,9 @@ public class DebugPanel extends JPanel { debugLocalsTable.getTreeTableModel().addTreeModelListener(refreshListener); debugScopeTable.getTreeTableModel().addTreeModelListener(refreshListener); } else { - debugRegistersTable.setTreeModel(new ABCPanel.VariablesTableModel(debugRegistersTable, new ArrayList<>(), new ArrayList<>())); - debugLocalsTable.setTreeModel(new ABCPanel.VariablesTableModel(debugLocalsTable, new ArrayList<>(), new ArrayList<>())); - debugScopeTable.setTreeModel(new ABCPanel.VariablesTableModel(debugScopeTable, new ArrayList<>(), new ArrayList<>())); + debugRegistersTable.setTreeModel(new ABCPanel.VariablesTableModel(debugRegistersTable, new ArrayList<>())); + debugLocalsTable.setTreeModel(new ABCPanel.VariablesTableModel(debugLocalsTable, new ArrayList<>())); + debugScopeTable.setTreeModel(new ABCPanel.VariablesTableModel(debugScopeTable, new ArrayList<>())); } InConstantPool cpool = Main.getDebugHandler().getConstantPool(); if (cpool != null) { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index ac40d57b3..3acbcd4cd 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -360,15 +360,15 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener 0) { @@ -467,13 +467,13 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener vars, List parentIds) { + public VariablesTableModel(MyTreeTable ttable, List vars) { this.ttable = ttable; List childs = new ArrayList<>(); for (int i = 0; i < vars.size(); i++) { - childs.add(new VariableNode(new ArrayList<>(), 1, vars.get(i), 0L/*parentIds.get(i)*/, null)); + childs.add(new VariableNode(new ArrayList<>(), 1, vars.get(i), 0L, null)); } root = new VariableNode(new ArrayList<>(), 0, null, 0L, null, childs); }