Merge remote-tracking branch 'origin/patch'

Conflicts:
	Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/graph/GraphDisplayBrokerPlugin.java
	Ghidra/Features/ProgramGraph/src/main/java/ghidra/graph/program/ProgramGraphPlugin.java
This commit is contained in:
Ryan Kurtz 2021-08-24 14:32:47 -04:00
commit 58ab016767
5 changed files with 40 additions and 42 deletions

View file

@ -46,7 +46,7 @@ import ghidra.util.task.TaskLauncher;
/**
* Plugin for generating program graphs. It uses the GraphServiceBroker to consume/display
* the graphs that it generates. This plugin generates several different types of program graphs.
* Both the "Block flow" and "code flow" actions generate graph of basic block flows. The only
* Both the "block flow" and "code flow" actions will generate a graph of basic block flows. The only
* difference is that the "code flow" action generates a graph that
* displays the assembly for for each basic block, whereas the "block flow" action generates a graph
* that displays the symbol or address at the start of the basic block. This plugin also
@ -64,7 +64,7 @@ import ghidra.util.task.TaskLauncher;
+ "Once a graph is created, it uses the currenly selected graph output to display "
+ "or export the graph. The plugin "
+ "also provides event handling to facilitate interaction between "
+ "the graph and the tool.",
+ "the graph and the tool.",
servicesRequired = { GoToService.class, BlockModelService.class, GraphDisplayBroker.class },
eventsProduced = { ProgramLocationPluginEvent.class, ProgramSelectionPluginEvent.class }
)
@ -83,7 +83,7 @@ public class ProgramGraphPlugin extends ProgramPlugin
private static final String FORCE_LOCATION_DISPLAY_OPTION =
OPTIONS_PREFIX + "Force Location Visible on Graph";
private static final String MAX_DEPTH_OPTION = OPTIONS_PREFIX + "Max Reference Depth";
public static final String MENU_GRAPH = "&Graph";
public static final String MENU_GRAPH = ToolConstants.MENU_GRAPH;
private BlockModelService blockModelService;
@ -168,18 +168,6 @@ public class ProgramGraphPlugin extends ProgramPlugin
}
}
/**
* Notification that an option changed.
*
* @param options
* options object containing the property that changed
* @param optionName
* name of option that changed
* @param oldValue
* old value of the option
* @param newValue
* new value of the option
*/
@Override
public void optionsChanged(ToolOptions options, String optionName, Object oldValue,
Object newValue) {
@ -200,21 +188,23 @@ public class ProgramGraphPlugin extends ProgramPlugin
private void createActions() {
new ActionBuilder("Graph Block Flow", getName()).menuPath(MENU_GRAPH, "&Block Flow")
.menuGroup("Graph", "A")
new ActionBuilder("Graph Block Flow", getName())
.menuPath(MENU_GRAPH, "&Block Flow")
.menuGroup(MENU_GRAPH, "A")
.onAction(c -> graphBlockFlow())
.enabledWhen(this::canGraph)
.buildAndInstall(tool);
new ActionBuilder("Graph Code Flow", getName()).menuPath(MENU_GRAPH, "C&ode Flow")
.menuGroup("Graph", "B")
new ActionBuilder("Graph Code Flow", getName())
.menuPath(MENU_GRAPH, "C&ode Flow")
.menuGroup(MENU_GRAPH, "B")
.onAction(c -> graphCodeFlow())
.enabledWhen(this::canGraph)
.buildAndInstall(tool);
new ActionBuilder("Graph Calls Using Default Model", getName())
.menuPath(MENU_GRAPH, "&Calls")
.menuGroup("Graph", "C")
.menuGroup(MENU_GRAPH, "C")
.onAction(c -> graphSubroutines())
.enabledWhen(this::canGraph)
.buildAndInstall(tool);
@ -247,7 +237,8 @@ public class ProgramGraphPlugin extends ProgramPlugin
.buildAndInstall(tool);
reuseGraphAction =
new ToggleActionBuilder("Reuse Graph", getName()).menuPath(MENU_GRAPH, "Reuse Graph")
new ToggleActionBuilder("Reuse Graph", getName())
.menuPath(MENU_GRAPH, "Reuse Graph")
.menuGroup("Graph Options")
.selected(reuseGraph)
.onAction(c -> reuseGraph = reuseGraphAction.isSelected())
@ -255,7 +246,8 @@ public class ProgramGraphPlugin extends ProgramPlugin
.buildAndInstall(tool);
appendGraphAction =
new ToggleActionBuilder("Append Graph", getName()).menuPath(MENU_GRAPH, "Append Graph")
new ToggleActionBuilder("Append Graph", getName())
.menuPath(MENU_GRAPH, "Append Graph")
.menuGroup("Graph Options")
.selected(false)
.onAction(c -> updateAppendAndReuseGraph())