Ghidra is a software reverse engineering (SRE) framework
Merge remote-tracking branch 'origin/GP-544_ghidravore_default_analysis_options'
ghidra1da3a80f4fe86
diff --cc Ghidra/Features/Base/src/main/help/help/topics/AutoAnalysisPlugin/AutoAnalysis.htmindex fd3e5dc315,db9545857b..a3f98c399a--- a/Ghidra/Features/Base/src/main/help/help/topics/AutoAnalysisPlugin/AutoAnalysis.htm+++ b/Ghidra/Features/Base/src/main/help/help/topics/AutoAnalysisPlugin/AutoAnalysis.htm@@@ -158,12 -151,38 +158,48 @@@<P><IMG alt="" src="images/note.png"> A separate dialog showing the <I>Analysis</I>options is also displayed after a new program has been imported, or the <B>Analysis<IMGalt="" src="images/arrow.gif"> Auto Analysis</B> menu item is chosen.</P>-+--<P><IMG alt="" src="images/warning.help.png"> <FONT color="red">Some analyzers only workon certain processors. For example, the MIPS Instruction Analyzer only works on MIPSprocessors. Their options will only show up if the currently open program can be analyzedwith the analyzer.</FONT></P></BLOCKQUOTE>++++ <P style="background-color: #FFF0E0;">++ <IMG SRC="../../shared/warning.png" />Note that multi-user merge does not currently support++ merging of Program Options (including Analysis Options). Options stored in shared Program database++ following a conflicting checkin may not reflect option settings specified prior to checkin.++ </P>++ <H3>Saved Options Configurations</H3>+ <BLOCKQUOTE>+ <P>The Options Configurations combo box at bottom of the analyzer enablement panel can be used to quickly- switch between sets of analyzer option values. The combo box will always contain two standard sets of options as well as any sets of- any previously saved configurations. The two standard configurations are:++ switch between sets of analyzer option values. The combo box will always contain two standard sets of options as well as any++ previously saved configurations. The two standard configurations are:+ <UL>+ <LI>Standard Defaults - This setting will put all the analyzer enablements and options to the original default values.</LI>+ <LI>Current Program Options - This setting will put all the analyzer enablements and options to values as stored in+ the current program.</LI>+ </UL>++++ <P style="background-color: #FFF0E0;">++ <IMG SRC="../../shared/warning.png" />Access to stored configurations is not currently++ aupported across different versions of Ghidra.++ </P>+++ </BLOCKQUOTE>++ <H3>Analysis Panel Buttons</H3>+ <BLOCKQUOTE>+ <UL>+ <LI>Select All - Turns all analyzers on.</LI>+ <LI>Deselect All - Turns all analyzers off.</LI>+ <LI>Reset - Resets all the options to the currently selected configuration.</LI>- <LI>Save - Saves the current settings to a named configuration.</LI>++ <LI>Save... - Saves the current analysis options to a named configuration.</LI>+ <LI>Delete - Deletes the currently selected named configuration.</LI>+ </UL>+ </BLOCKQUOTE>+</BLOCKQUOTE><H2><A name="Auto_Analyzers"></A>Auto Analyzers</H2>diff --cc Ghidra/Features/Base/src/main/help/help/topics/AutoAnalysisPlugin/images/AutoAnalysisOptions.pngindex 0147f88acd,0147f88acd..aab2ca0b6bBinary files differdiff --cc Ghidra/Features/Base/src/main/help/help/topics/AutoAnalysisPlugin/images/ProgramOptions.pngindex fc1ea1286a,fc1ea1286a..6e4b20145fBinary files differdiff --cc Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisPanel.javaindex cfb2301424,ae0671d770..f5eaf75d30--- 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@@@ -158,6 -212,21 +212,27 @@@ class AnalysisPanel extends JPanel implconfigureBorder(analyzerOptionsPanel, "Options");}+ private Component buildOptionsComboBoxPanel() {+ JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER));++ Options[] defaultOptionsArray = getDefaultOptionsArray();+ defaultOptionsCombo = new GhidraComboBox<>(defaultOptionsArray);+ selectedOptions = findOptions(defaultOptionsArray, getLastUsedDefaultOptionsName());+ defaultOptionsCombo.setSelectedItem(selectedOptions);+ defaultOptionsCombo.addItemListener(this::analysisComboChanged);+ Dimension preferredSize = defaultOptionsCombo.getPreferredSize();+ defaultOptionsCombo.setPreferredSize(new Dimension(200, preferredSize.height));+ panel.add(defaultOptionsCombo);++++ deleteButton = new JButton("Delete");++ deleteButton.addActionListener(e -> deleteSelectedOptionsConfiguration());++ deleteButton.setToolTipText("Deletes the currently selected user configuration");++ panel.add(deleteButton);+++ panel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));+ return panel;+ }+private Component buildRightPanel() {JSplitPane splitpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, buildDescriptionPanel(),analyzerOptionsPanel);@@@ -204,12 -282,21 +288,17 @@@selectAllButton.addActionListener(e -> selectAll());JButton deselectAllButton = new JButton("Deselect All");deselectAllButton.addActionListener(e -> deselectAll());- JButton restoreDefaultsButton = new JButton("Restore Defaults");- restoreDefaultsButton.addActionListener(e -> restoreDefaults());+ JButton resetButton = new JButton("Reset");+ resetButton.setToolTipText("Resets the editors to the selected options configuration");+ resetButton.addActionListener(e -> loadCurrentOptionsIntoEditors());- JButton saveButton = new JButton("Save");++ JButton saveButton = new JButton("Save...");+ saveButton.setToolTipText("Saves the current editor settings to a named configuration");+ saveButton.addActionListener(e -> saveCurrentOptionsConfiguration());- deleteButton = new JButton("Delete");- deleteButton.addActionListener(e -> deleteSelectedOptionsConfiguration());- deleteButton.setToolTipText("Deletes the currently selected user configuration");JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));buttonPanel.add(selectAllButton);buttonPanel.add(deselectAllButton);- buttonPanel.add(restoreDefaultsButton);+ buttonPanel.add(resetButton);+ buttonPanel.add(saveButton);- buttonPanel.add(deleteButton);return buttonPanel;}diff --cc Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/analysis/AnalyzeAllOpenProgramsTaskTest.javaindex c20ebb1e18,204d2fbfd7..f9c136496b--- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/analysis/AnalyzeAllOpenProgramsTaskTest.java+++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/analysis/AnalyzeAllOpenProgramsTaskTest.java@@@ -296,8 -296,9 +296,9 @@@ public class AnalyzeAllOpenProgramsTaskAnalysisOptionsDialog optionsDialog = waitForDialogComponent(AnalysisOptionsDialog.class);AnalysisPanel panel =findComponent(optionsDialog.getComponent(), AnalysisPanel.class, false);- invokeInstanceMethod("deselectAll", panel);- panel.applyChanges();- waitForSwing();++ runSwing(() -> invokeInstanceMethod("deselectAll", panel));++ runSwing(() -> panel.applyChanges());close(optionsDialog);}