Skip to content

Commit e87653a

Browse files
committed
Merge remote-tracking branch 'origin/GT-3197-dragonmacher-call-trees-navigation' into Ghidra_9.1
2 parents 5904b7d + da90d2f commit e87653a

File tree

5 files changed

+203
-57
lines changed

5 files changed

+203
-57
lines changed

Ghidra/Features/Base/src/main/help/help/topics/CallTreePlugin/Call_Tree_Plugin.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,31 @@ <H1><A name="Call_Tree_Plugin"></A>Call Tree Plugin</H1>
3737
right-clicking in the Listing and selecting
3838
<B>References<IMG src="../../shared/arrow.gif" alt="-&gt;" border="0">Show Call Trees</B>
3939
</P>
40+
41+
<BLOCKQUOTE>
42+
<P>
43+
<IMG border="0" src="../../shared/note.png">Unlike most widgets in Ghidra, the Call
44+
Trees display functions differently depending upon how you launch it.
45+
<UL>
46+
<LI>
47+
When launched from the toolbar icon, the provider that is shown will track the
48+
current location in the Listing (the <IMG src="images/locationIn.gif" border="1">
49+
<A href="#Call_Tree_Action_Incoming_Navigation">Navigate on Incoming Location Changes
50+
button</A> is on).
51+
</LI>
52+
<LI>
53+
When launched from the context popup menu, the provider that is shown will not track
54+
the current location in the Listing. This allows you to open multiple windows for
55+
different functions, functioning much like <A HREF="help/topics/Snapshots/Snapshots.html">
56+
snapshots</A>, allowing you to keep a watchful eye on particular functions, regardless
57+
of where you navigate within the tool.
58+
</LI>
59+
</UL>
60+
</P>
61+
</BLOCKQUOTE>
62+
63+
<BR><BR>
64+
4065

4166
<P><A name="Incoming_Call_Tree"></A>The <B>Incoming Calls</B> tree shows all caller
4267
functions. Each node in the tree has the incoming function call icon (<IMG src=
@@ -139,7 +164,8 @@ <H2><A name="Call_Tree_Actions"></A>Actions</H2>
139164
<!-- Home -->
140165

141166
<P align="left"><A name="Call_Tree_Action_Home"></A>The <IMG src="images/go-home.png"
142-
border="1"> home button will navigate to function label of the main function.</P>
167+
border="1"> home button will navigate to the function label of the main function
168+
for which the call trees are being displayed.</P>
143169

144170
<P align="left"><A name="Call_Tree_Action_Refresh"></A>The <IMG src="Icons.REFRESH_ICON"
145171
border="1"> refresh button will reload the trees. This is needed due to the fact that

Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/calltree/CallTreePlugin.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public CallTreePlugin(PluginTool tool) {
7070

7171
createActions();
7272
primaryProvider = new CallTreeProvider(this, true);
73+
providers.add(primaryProvider);
7374
}
7475

7576
@Override
@@ -108,8 +109,12 @@ protected void dispose() {
108109
}
109110
}
110111

111-
private CallTreeProvider findProviderForLocation(ProgramLocation location) {
112+
CallTreeProvider findTransientProviderForLocation(ProgramLocation location) {
112113
for (CallTreeProvider provider : providers) {
114+
if (!provider.isTransient()) {
115+
continue;
116+
}
117+
113118
if (provider.isShowingLocation(location)) {
114119
return provider;
115120
}
@@ -177,7 +182,7 @@ void showOrCreateNewCallTree(ProgramLocation location) {
177182
return; // no program; cannot show tool
178183
}
179184

180-
CallTreeProvider provider = findProviderForLocation(location);
185+
CallTreeProvider provider = findTransientProviderForLocation(location);
181186
if (provider != null) {
182187
tool.showComponentProvider(provider, true);
183188
return;

Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/calltree/CallTreeProvider.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ public CallTreeProvider(CallTreePlugin plugin, boolean isPrimary) {
107107
setWindowMenuGroup(TITLE);
108108
setDefaultWindowPosition(WindowPosition.BOTTOM);
109109

110+
if (isPrimary) {
111+
addToToolbar();
112+
}
113+
else {
114+
setTransient();
115+
}
110116
setIcon(CallTreePlugin.PROVIDER_ICON);
111-
addToToolbar();
112117
setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Plugin"));
113118

114119
addToTool();

0 commit comments

Comments
 (0)