@Override
	protected void actionPerformed(ListingActionContext context) {
		// get the entry points for all the functions in the current selection/location
		Iterator<Function> iter = funcPlugin.getFunctions(context);
		if (iter.hasNext() == false) {
			String message = "No function at current location";
			ProgramSelection selection = context.getSelection();
			if (selection != null) {
				message = "No functions within current selection";
			}

			funcPlugin.getTool().setStatusInfo("Analyze Stack: " + message);
			return;
		}
		AddressSet funcSet = new AddressSet();
		while (iter.hasNext()) {
			Function func = iter.next();
			funcSet.addRange(func.getEntryPoint(), func.getEntryPoint());
		}

		boolean doNewStackAnalysis = true;
		boolean doLocalAnalysis = true;
		boolean doParameterAnalysis = true;

		Program program = context.getProgram();

		// TODO: THIS MAY NOT BE THE BEST WAY TO get the options to agree with the analysis options!  Advise.
		Options options = program.getOptions(Program.ANALYSIS_PROPERTIES).getOptions("Stack");
		options.registerOption(GhidraLanguagePropertyKeys.USE_NEW_FUNCTION_STACK_ANALYSIS,
			doNewStackAnalysis, null,
			"Use General Stack Reference Propogator (This works best on most processors)");

		options.registerOption("Create Local Variables", doLocalAnalysis, null,
			"Create Function Local stack variables and references");

		options.registerOption("Create Param Variables", doParameterAnalysis, null,
			"Create Function Parameter stack variables and references");
		doNewStackAnalysis = options.getBoolean(
			GhidraLanguagePropertyKeys.USE_NEW_FUNCTION_STACK_ANALYSIS, doNewStackAnalysis);
		doLocalAnalysis = options.getBoolean("Create Local Variables", doLocalAnalysis);

		doParameterAnalysis = options.getBoolean("Create Param Variables", doParameterAnalysis);

		BackgroundCommand<Program> cmd = null;
		if (doNewStackAnalysis) {
			cmd = new NewFunctionStackAnalysisCmd(funcSet, doParameterAnalysis, doLocalAnalysis,
				true);
		}
		else {
			cmd = new FunctionStackAnalysisCmd(funcSet, doParameterAnalysis, doLocalAnalysis, true);
		}
		funcPlugin.execute(program, cmd);
	}
Creates a new action with the given name and associated to the given
plugin.
@param plugin the plugin this action is associated with.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/AnalyzeStackRefsAction.java