Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

doxygen and tcl call/caller graphs

625 views
Skip to first unread message

wts

unread,
Oct 22, 2012, 4:39:49 PM10/22/12
to
Does anybody use doxygen (1.8.2) to generate call graphs?
It does not work for me, even for simple files like

proc foo {} {
return
}
proc bar {} {
foo
return
}

Maybe call graphs are not supported yet,
http://wiki.tcl.tk/27011 makes me think so.

rene

unread,
Oct 23, 2012, 4:31:25 PM10/23/12
to wtsch...@users.sourceforge.net
Am Montag, 22. Oktober 2012 22:41:04 UTC+2 schrieb wts:
> Does anybody use doxygen (1.8.2) to generate call graphs?
>
> It does not work for me, even for simple files like
> proc foo {} {
> return
> }
> proc bar {} {
> foo
> return
> }
It should work under the following assumptions:

1. put your code in a file p.e. t.tcl and add
as first line:

## @file t.tcl

2. Generate a Doxyfile (doxygen -g) and set the following vars:

EXTRACT_ALL=YES
INPUT = t.tcl
INLINE_SOURCES = YES
CALL_GRAPH = YES
CALLER_GRAPH = YES
HAVE_DOT = YES

3. Run doxygen and view the html code.


HTH
rene

wts

unread,
Oct 25, 2012, 3:07:15 PM10/25/12
to
Am 23.10.2012 22:31, schrieb rene:
> 1. put your code in a file p.e. t.tcl and add
> as first line:
>
> ## @file t.tcl
>
> 2. Generate a Doxyfile (doxygen -g) and set the following vars:
>
> EXTRACT_ALL=YES
> INPUT = t.tcl
> INLINE_SOURCES = YES
> CALL_GRAPH = YES
> CALLER_GRAPH = YES
> HAVE_DOT = YES
>
> 3. Run doxygen and view the html code.
>
>
> HTH
> rene

Thank you for the hint, rene.
INLINE_SOURCES = YES did the trick.

However, the inlined sources look ugly.
The keywords are coloured but the original line breaks are not preserved.
Would it be possible to have call graphs without inlined sources?
I would prefer to use SOURCE_BROWSER = YES.
This works with the know input filters for tcl.

wts

rene

unread,
Oct 26, 2012, 3:31:02 AM10/26/12
to wtsch...@users.sourceforge.net
Am Donnerstag, 25. Oktober 2012 21:08:32 UTC+2 schrieb wts:
> Thank you for the hint, rene.
> INLINE_SOURCES = YES did the trick.
> However, the inlined sources look ugly.
> The keywords are coloured but the original line breaks are not preserved.
If I use your code from above the line breaks still exist in the displayed code.
May be you have tested with some other code?
>
> Would it be possible to have call graphs without inlined sources?
> I would prefer to use SOURCE_BROWSER = YES.
You could use INLINE_SOURCES and SOURCE_BROWSER in any combination.
At least one of them need to set to YES.

HTH
rene

wts

unread,
Oct 26, 2012, 3:25:46 PM10/26/12
to
Am 26.10.2012 09:31, schrieb rene:
> If I use your code from above the line breaks still exist in the displayed code.
> May be you have tested with some other code?
Modified the code to:
proc foo {} {
return
}
proc bar {} {
foo
foo
foo
foo
return
}
Then used SOURCE_BROWSER = YES and INLINE_SOURCES = YES.
The inlined code results in the following html:
...
<p>Definition at line <a class="el"
href="t_8tcl_source.html#l00004">4</a> of file <a class="el"
href="t_8tcl_source.html">t.tcl</a>.</p>
<div class="fragment"></div>
<span class="keyword">proc</span> bar {} {</div>
<a class="code" href="t_8tcl.html#afdba98970961edb29f88241b9d99d890"
title="foo">foo</a><span class="comment"></div>
</span> <a class="code"
href="t_8tcl.html#afdba98970961edb29f88241b9d99d890"
title="foo">foo</a><span class="comment"></div>
</span> <a class="code"
href="t_8tcl.html#afdba98970961edb29f88241b9d99d890"
title="foo">foo</a><span class="comment"></div>
</span> <a class="code"
href="t_8tcl.html#afdba98970961edb29f88241b9d99d890"
title="foo">foo</a><span class="comment"></div>
</span> <span class="keyword">return</span><span class="comment"></div>
</span>}</div><!-- fragment -->
...
It looks like there are more </div> than <div>. The last to foo calls,
the return and the closing brace are on the same line.

> You could use INLINE_SOURCES and SOURCE_BROWSER in any combination.
> At least one of them need to set to YES.
If I use SOURCE_BROWSER = YES and INLINE_SOURCES = NO then
I definitely do not get the call graph. I do get the source browser.

wts


rene

unread,
Oct 27, 2012, 3:22:42 AM10/27/12
to wtsch...@users.sourceforge.net
Am Freitag, 26. Oktober 2012 21:27:11 UTC+2 schrieb wts:
> Am 26.10.2012 09:31, schrieb rene:
>
> > If I use your code from above the line breaks still exist in the displayed code.
>
> > May be you have tested with some other code?
>
> Modified the code to:
>
> proc foo {} {
> return
> }
> proc bar {} {
> foo
> foo
> foo
> foo
> return
> }
>
> Then used SOURCE_BROWSER = YES and INLINE_SOURCES = YES.
> The inlined code results in the following html:
>
I have done the same and it was working for me. Let's check
the environment. I'm using firefox 12.0 under suse 11.4 and
doxygen --version
1.8.0-20120429

> > You could use INLINE_SOURCES and SOURCE_BROWSER in any combination.
> > At least one of them need to set to YES.

> If I use SOURCE_BROWSER = YES and INLINE_SOURCES = NO then
> I definitely do not get the call graph. I do get the source browser.

You are right here. I only was looking on the file source code.
So you need INLINE_SOURCES for the call graphs. I'm not so
familiar with these settings. I only maintain the tcl part
in doxygen.

wts

unread,
Oct 27, 2012, 7:35:49 AM10/27/12
to
Am 27.10.2012 09:22, schrieb rene:
> I have done the same and it was working for me. Let's check
> the environment. I'm using firefox 12.0 under suse 11.4 and
> doxygen --version
> 1.8.0-20120429

Just downloaded the 1.8.0 windows binary and the inlined code is ok
in firefox 12.0. I also checked 1.8.1, same as 1.8.2.

The doxygen sources itself can by inlined correctly
with 1.8.2. Each code line results in html like
...
<div class="line"> <span class="comment">//printf("----
transferFunctionDocumentation()\n");</span></div>
...
It seems that only tcl sources are not formatted correctly.
At least I checked for LF vs. CRLF line endings: no change.
Problem starts with doxygen 1.8.1.

Anyway, even if the code snippets where formatted well,
I would prefer the source browser only.

>> If I use SOURCE_BROWSER = YES and INLINE_SOURCES = NO then
>> I definitely do not get the call graph. I do get the source browser.
>
> You are right here. I only was looking on the file source code.
> So you need INLINE_SOURCES for the call graphs. I'm not so
> familiar with these settings. I only maintain the tcl part
> in doxygen.

Well, using an input filter for tcl files and processing the filtered
files like c code does produce call graphs for SOURCE_BROWSER = YES and
INLINE_SOURCES = NO. This is what I have used in the past.
Same for c projects.
Therefore, I expected the same for the native tcl support.

wts

rene

unread,
Oct 27, 2012, 3:52:02 PM10/27/12
to wtsch...@users.sourceforge.net
Am Samstag, 27. Oktober 2012 13:37:07 UTC+2 schrieb wts:
> Just downloaded the 1.8.0 windows binary and the inlined code is ok
> in firefox 12.0. I also checked 1.8.1, same as 1.8.2.
If I have some time I will check it. Because there are no changes
in my tcl related parts it can take a while for me.

> The doxygen sources itself can by inlined correctly
> with 1.8.2. Each code line results in html like
>
> ...
>
> <div class="line"> <span class="comment">//printf("----
>
> transferFunctionDocumentation()\n");</span></div>
> ...
> It seems that only tcl sources are not formatted correctly.
> At least I checked for LF vs. CRLF line endings: no change.
> Problem starts with doxygen 1.8.1.
Thank you for your effort. I will start from here

> Anyway, even if the code snippets where formatted well,
> I would prefer the source browser only.
>
>
>
> >> If I use SOURCE_BROWSER = YES and INLINE_SOURCES = NO then
>
> >> I definitely do not get the call graph. I do get the source browser.
>
> >
>
> > You are right here. I only was looking on the file source code.
>
> > So you need INLINE_SOURCES for the call graphs. I'm not so
>
> > familiar with these settings. I only maintain the tcl part
>
> > in doxygen.
>
>
>
> Well, using an input filter for tcl files and processing the filtered
>
> files like c code does produce call graphs for SOURCE_BROWSER = YES and
>
> INLINE_SOURCES = NO. This is what I have used in the past.
>
> Same for c projects.
>
> Therefore, I expected the same for the native tcl support.
>
I will also have a look at these issue. But like before it
can take a while.

Regards,
rene

wts

unread,
Oct 28, 2012, 4:00:44 PM10/28/12
to
Am 27.10.2012 21:52, schrieb rene:
>..
> I will also have a look at these issue. But like before it
> can take a while.
>
Thank you for the support so far.
Native tcl support in doxygen is great!

I poked around a little and found that doxygen 1.8.2 produces correctly
formatted inline snippets for rtf output and probably for latex.
The call graphs disappear for INLINE_SOURCES = NO also for rtf/latex.

Further, it seems that also "Referenced by .." listings depend on
INLINE_SOURCES = YES.

wts

andrew.ph...@gmail.com

unread,
Feb 27, 2013, 8:53:13 PM2/27/13
to wtsch...@users.sourceforge.net
I am using doxygen 1.8.3.1 and the calling graph is only partially working. It seems to be smart to the namespace, but embedding in a fairly mild construct (ie, foreach) loses it.

IE:

proc my_ns::get_all_procs { } { ... some code to return a list of all procs in all namespaces ... }

#Style 1: NO CALLING GRAPH EXTRACTED!
proc my_ns::checksum_procs { } {
foreach proc [get_all_procs] {
set md5str [md5::md5 -hex [info body proc]]
}
}

#Style 2: CALLING GRAPH EXTRACTED CORRECTLY
proc my_ns::checksum_procs { } {
set myprocs [get_all_procs]
foreach proc $myprocs {
set md5str [md5::md5 -hex [info body proc]]
}
}

wts

unread,
Jun 22, 2014, 6:55:46 AM6/22/14
to
Finally I pushed a couple of patches to the doxygen repo:

https://github.com/doxygen/doxygen/pull/181

should fix the discussed issues.

https://github.com/doxygen/doxygen/pull/187

adds support for more commands with script arguments to get more
complete call/caller graphs.


0 new messages