diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java index 01838c2ed7..d8a52fba89 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java @@ -1110,7 +1110,14 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl int answer = OptionDialog.showYesNoDialog(tool.getToolFrame(), "Analyze", "" + HTMLUtilities.escapeHTML(program.getDomainFile().getName()) + " has not been analyzed. Would you like to analyze it now?"); - return answer == OptionDialog.OPTION_ONE; // Analyze + //Set to false for now. ANALYZED is a tri-valued variable: + // null means not asked. + // false means asked but could still turn true when analysis happens. + // true means analysis has started. + //Setting false here only works due to this code only being reachable + // because of the behavior of GhidraProgramUtilities.shouldAskToAnalyze(program) above. + GhidraProgramUtilities.setAnalyzedFlag(program, false); + return answer == OptionDialog.OPTION_ONE; //Analyze } return false; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisPlugin.java index 13e4f68cfa..802540285e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisPlugin.java @@ -190,10 +190,12 @@ public class AutoAnalysisPlugin extends Plugin implements AutoAnalysisManagerLis if (!showOptionsDialog(program)) { return; } - GhidraProgramUtilities.setAnalyzedFlag(program, true); analysisMgr.initializeOptions(); // options may have changed + // At this point, any analysis that is done is consider to be true for analyzed. + GhidraProgramUtilities.setAnalyzedFlag(program, true); + // start analysis to set the flag, but it probably won't do more. A bit goofy but better // than the way it was //TODO simplify all this after creating a taskManager per program instead of per tool.