Ghidra is a software reverse engineering (SRE) framework
Updated analysis options to only show options that still have valid analyzers. This keeps old analyzer options saved in a program from appearing after the analyzer has been removed.
dragonmacher2ecee32a1310
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisPanel.javaindex a47cb4795c..b219827a8e 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisPanel.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisPanel.java@@ -137,12 +137,15 @@ class AnalysisPanel extends JPanel implements PropertyChangeListener {throw new AssertException("Analyzer enable property that is not boolean - " + analyzerName);}- analyzerNames.add(analyzerName);+Analyzer analyzer = manager.getAnalyzer(analyzerName);- if (analyzer != null && analyzer.isPrototype()) {- prototypeAnalyzers.add(analyzerName);+ if (analyzer != null) {+ analyzerNames.add(analyzerName);+ if (analyzer.isPrototype()) {+ prototypeAnalyzers.add(analyzerName);+ }+ analyzerEnablement.add(analysisOptions.getBoolean(analyzerName, false));}- analyzerEnablement.add(analysisOptions.getBoolean(analyzerName, false));}}}@@ -325,16 +328,17 @@ class AnalysisPanel extends JPanel implements PropertyChangeListener {if (e.getValueIsAdjusting()) {return;}- ListSelectionModel lsm = (ListSelectionModel) e.getSource();+ ListSelectionModel lsm = (ListSelectionModel) e.getSource();int selectedRow = lsm.getMinSelectionIndex();- if (selectedRow == -1) {//TODO+ if (selectedRow == -1) {analyzerOptionsPanel.removeAll();analyzerOptionsPanel.validate();analyzerOptionsPanel.repaint();descriptionComponent.setText("");return;}+String analyzerName = analyzerNames.get(selectedRow);setAnalyzerSelected(analyzerName);});