Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/dev747368_GT-2698_hostile_html_whack_a_mole_UI_stuff'

ghidravore45222ad4d331
diff --cc Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisPanel.java
index 700ae2943b,48cde3b59b..c107b8731c
--- 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
@@@ -32,8 -32,8 +32,9 @@@ import org.apache.commons.collections4.
import docking.options.editor.GenericOptionsComponent;
import docking.widgets.OptionDialog;
+ import docking.widgets.label.GLabel;
import docking.widgets.table.*;
+import ghidra.GhidraOptions;
import ghidra.app.services.Analyzer;
import ghidra.framework.options.*;
import ghidra.program.model.listing.Program;
@@@ -71,7 -70,7 +71,7 @@@ class AnalysisPanel extends JPanel impl
/**
* Constructor
-- *
++ *
* @param program the programs to be analyzed
* @param editorStateFactory the editor factory
* @param propertyChangeListener subscriber for property change notifications
@@@ -80,18 -79,18 +80,18 @@@
PropertyChangeListener propertyChangeListener) {
this(List.of(program), editorStateFactory, propertyChangeListener);
}
-
+
/**
* Constructor
-- *
++ *
* @param programs list of programs that will be analyzed
* @param editorStateFactory the editor factory
* @param propertyChangeListener subscriber for property change notifications
*/
AnalysisPanel(List<Program> programs, EditorStateFactory editorStateFactory,
PropertyChangeListener propertyChangeListener) {
-
- // Do a quick check to make sure we have at least one program. If not, we
+
- // Do a quick check to make sure we have at least one program. If not, we
++ // Do a quick check to make sure we have at least one program. If not, we
// shouldn't even be here (the menus should be disabled).
if (CollectionUtils.isEmpty(programs)) {
throw new AssertException("Must provide a program to run analysis");
@@@ -479,14 -474,11 +479,14 @@@
boolean currEnabled = analyzerEnablement.get(i);
boolean origEnabled = analysisOptions.getBoolean(analyzerName, false);
if (currEnabled != origEnabled) {
+ changes = true;
propertyChangeListener.propertyChange(
- new PropertyChangeEvent(this, analyzerName, origEnabled, currEnabled));
+ new PropertyChangeEvent(this, analyzerName, origEnabled, currEnabled));
- return true;
}
}
+ if (changes) {
+ return true;
+ }
for (EditorState info : editorList) {
if (info.isValueChanged()) {
return true;
@@@ -500,10 -492,10 +500,10 @@@
* <p>
* Details: This loops over every analyzer name in this panel and for
* each, updates the associated enablement for all programs being
-- * analyzed.
++ * analyzed.
*/
void applyChanges() {
-
+
for (int i = 0; i < analyzerNames.size(); ++i) {
String analyzerName = analyzerNames.get(i);
boolean enabled = analyzerEnablement.get(i);
@@@ -595,33 -586,36 +594,33 @@@
* <OL>
* <LI>
* When a user toggles the status of an analyzer we need to update that status for
-- * EVERY open program. We don't want a situation where a user turns a particular
++ * EVERY open program. We don't want a situation where a user turns a particular
* analyzer off, but it's only turned off for the selected program.
* </LI>
* <LI>
-- * Programs with different architectures may have different available analyzers, but we
++ * Programs with different architectures may have different available analyzers, but we
* don't worry about that here because this class is only handed programs with
* similar architectures. If this were to ever change we would need to revisit this.
* </LI>
* </OL>
-- *
++ *
* @param analyzerName the name of the analyzer to update
* @param enabled if true, enable the analyzer; otherwise disable it
*/
public void updateOptionForAllPrograms(String analyzerName, boolean enabled) {
for (Program program : programs) {
- // Check to make sure we're only handling events that relate to analyzers. If we
++ // Check to make sure we're only handling events that relate to analyzers. If we
+ // receive something else (eg: "analyze.apply") ignore it.
+ Options options = program.getOptions(Program.ANALYSIS_PROPERTIES);
+ if (!options.getOptionNames().contains(analyzerName)) {
+ continue;
+ }
+
boolean commit = false;
- int id = program.startTransaction("Setting analysis property");
+ int id = program.startTransaction("Setting analysis property " + analyzerName);
try {
- Options options = program.getOptions(Program.ANALYSIS_PROPERTIES);
-
- // Sanity check to make sure that the analyzer is appropriate for
- // this program. This should always be the case but it doesn't
- // hurt to check.
- if (!options.getOptionNames().contains(analyzerName)) {
- continue;
- }
-
options.setBoolean(analyzerName, enabled);
-
commit = true;
}
finally {