dependency tree / call graph in idl (cscope for idl)? [message #63673] |
Wed, 19 November 2008 07:51  |
Sven Utcke
Messages: 10 Registered: October 2007
|
Junior Member |
|
|
Hi,
what's the recommended way to do dependency tracking in IDL, you know,
FUNCTION X depeneds on PRO Y which calls FUNCTIONs A, B, and C. That
stuff. Preferably, but not necessarily from emacs?
In C, I would for example use cscope <http://cscope.sourceforge.net/>.
Reason I'm asking: I inherited a project with quite a few
interdependent files (79 files so far, with 14000 lines, but I'm sure
to find I missed some once dependency tracking works), and in order to
get any idea at all what this is doing I would like to look at some
sort of call graph.
So what is the IDL-way of doing this?
Sven
--
___ _ _____ ___ Dr.-Ing. Sven Utcke ___ ___ _____ __
/ __| |/ / __| __| phone: +49 40 899-8-5317 | \| __/ __\ \ / /
| (_ | ' <\__ \__ \ fax : +49 40 899-4-5317 | |) | _|\__ \\ V /
\___|_|\_\___|___/ http://www.desy.de/~utcke (to come)|___/|___|___/ |_|
|
|
|
|
|
|
Re: dependency tree / call graph in idl (cscope for idl)? [message #63787 is a reply to message #63673] |
Thu, 20 November 2008 00:51   |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Sven Utcke schrieb:
> Hi,
>
> what's the recommended way to do dependency tracking in IDL, you know,
> FUNCTION X depeneds on PRO Y which calls FUNCTIONs A, B, and C. That
> stuff. Preferably, but not necessarily from emacs?
>
> In C, I would for example use cscope <http://cscope.sourceforge.net/>.
>
> Reason I'm asking: I inherited a project with quite a few
> interdependent files (79 files so far, with 14000 lines, but I'm sure
> to find I missed some once dependency tracking works), and in order to
> get any idea at all what this is doing I would like to look at some
> sort of call graph.
>
> So what is the IDL-way of doing this?
>
> Sven
Hi Sven,
you may be interested in
http://www.fz-juelich.de/icg/icg-1/idl_icglib/idl_source/idl _html/dbase/tar_gz_dependencies_dbase.pro.html
This procedure founds all dependent routines from a given routine. They
are saved into a tar.gz file Additional Informations about the routines
are saved into an html file.
cheers
Reimar
|
|
|
|
Re: dependency tree / call graph in idl (cscope for idl)? [message #63801 is a reply to message #63673] |
Wed, 19 November 2008 13:08   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Nov 19, 11:30 am, Sven Utcke <utcke+n...@informatik.uni-hamburg.de>
wrote:
> "mgal...@gmail.com" <mgal...@gmail.com> writes:
>> On Nov 19, 8:51 am, Sven Utcke <utcke+n...@informatik.uni-hamburg.de>
>> wrote:
>>> So what is the IDL-way of doing this?
>
>> There is nothing I know in IDL that would do this currently. The only
>> suggestion I have is to start a fresh IDL session. Compile the 79
>> files that you have so far
>
> Any easy< way to do that, as they are in several (sub) directories?
>
>> and then use RESOLVE_ALL. This will compile
>> routines that are called by the original 79 (and the routines that are
>> called by those routines, etc.). There should be messages in the
>> output log like "% Compiled module: ..." that should give an
>> indication of the needed routines. Of course, this is far short of a
>> call graph, but might serve depending on your requirements.
>
> It would at least tell me which routines I had missed so far, but
> alas:
>
> IDL> RESOLVE_ALL
> % Attempt to call undefined procedure/function: 'HALT'.
> % Error occurred at: RESOLVE_ALL_BODY 290
> /opt/products/idl/7.0/idl70/lib/resolve_all.pro
> % RESOLVE_ALL 351
> /opt/products/idl/7.0/idl70/lib/resolve_all.pro
> % $MAIN$
> % Execution halted at: $MAIN$
>
> Does not look to good, does it?
This is telling you that you are missing HALT. And furthermore,
halt.pro is not in your !path.
Mike
--
www.michaelgalloy.com
Tech-X Corporation
Associate Research Scientist
|
|
|
Re: dependency tree / call graph in idl (cscope for idl)? [message #63802 is a reply to message #63673] |
Wed, 19 November 2008 10:34   |
Sven Utcke
Messages: 10 Registered: October 2007
|
Junior Member |
|
|
Paolo <pgrigis@gmail.com> writes:
> David Fanning wrote:
>> Sven Utcke writes:
>>
>>> what's the recommended way to do dependency tracking in IDL, you know,
>>> FUNCTION X depeneds on PRO Y which calls FUNCTIONs A, B, and C. That
>>> stuff. Preferably, but not necessarily from emacs?
>>>
>>> In C, I would for example use cscope <http://cscope.sourceforge.net/>.
>>>
>>> Reason I'm asking: I inherited a project with quite a few
>>> interdependent files (79 files so far, with 14000 lines, but I'm sure
>>> to find I missed some once dependency tracking works), and in order to
>>> get any idea at all what this is doing I would like to look at some
>>> sort of call graph.
>>>
>>> So what is the IDL-way of doing this?
>>
>> Whew! Don't you just hate it when someone comes to IDL for
>> the first time from a modern programming language. :-(
>
> This task may not even be *feasible* if the program does not
> consistently use square brackets for array!
Well, it might not be that bad. [c,e,idl]tags at least finds all
function and procedure definitions (although I would wish it would
also find each place where a function is called, but there). Would be
nice to also have global variables (which are used extensively within
the code in question --- is this good IDL praxis?), but I guess it
ought to be possible to hack [e,idl]tags to do that. But again this
leaves the problem of finding all uses...
Sven
--
___ _ _____ ___ Dr.-Ing. Sven Utcke ___ ___ _____ __
/ __| |/ / __| __| phone: +49 40 899-8-5317 | \| __/ __\ \ / /
| (_ | ' <\__ \__ \ fax : +49 40 899-4-5317 | |) | _|\__ \\ V /
\___|_|\_\___|___/ http://www.desy.de/~utcke (to come)|___/|___|___/ |_|
|
|
|
|
Re: dependency tree / call graph in idl (cscope for idl)? [message #63818 is a reply to message #63673] |
Wed, 19 November 2008 08:35   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Nov 19, 8:51 am, Sven Utcke <utcke+n...@informatik.uni-hamburg.de>
wrote:
> what's the recommended way to do dependency tracking in IDL, you know,
> FUNCTION X depeneds on PRO Y which calls FUNCTIONs A, B, and C. That
> stuff. Preferably, but not necessarily from emacs?
>
> In C, I would for example use cscope <http://cscope.sourceforge.net/>.
>
> Reason I'm asking: I inherited a project with quite a few
> interdependent files (79 files so far, with 14000 lines, but I'm sure
> to find I missed some once dependency tracking works), and in order to
> get any idea at all what this is doing I would like to look at some
> sort of call graph.
>
> So what is the IDL-way of doing this?
There is nothing I know in IDL that would do this currently. The only
suggestion I have is to start a fresh IDL session. Compile the 79
files that you have so far and then use RESOLVE_ALL. This will compile
routines that are called by the original 79 (and the routines that are
called by those routines, etc.). There should be messages in the
output log like "% Compiled module: ..." that should give an
indication of the needed routines. Of course, this is far short of a
call graph, but might serve depending on your requirements.
I have thought about adding such a feature to IDLdoc. At some point, I
think I will need a full blown IDL parser to extract all the
information I want to get from a code base.
Mike
--
www.michaelgalloy.com
Tech-X Corporation
Associate Research Scientist
|
|
|
Re: dependency tree / call graph in idl (cscope for idl)? [message #63845 is a reply to message #63673] |
Thu, 20 November 2008 09:47  |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On Nov 20, 10:55 am, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> On Nov 20, 3:11 am, Sven Utcke <utcke+n...@informatik.uni-hamburg.de>
> wrote:
>
>> Craig Markwardt <cbmarkwa...@gmail.com> writes:
>>> Really you want to do something like,
>>> RESOLVE_ALL, /CONTINUE, UNRESOLVED=unresolved
>
>> So I do. BTW, how do I tell IDL to rescan the PATH to find any
>> routines I might have added since it last looked?
>
> IDL> path_cache, /rebuild
>
> Mike
> --www.michaelgalloy.com
> Tech-X Corporation
> Associate Research Scientist
There's my "nugget" for the day! Thanks Mike!
|
|
|
Re: dependency tree / call graph in idl (cscope for idl)? [message #63849 is a reply to message #63774] |
Thu, 20 November 2008 08:55  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Nov 20, 3:11 am, Sven Utcke <utcke+n...@informatik.uni-hamburg.de>
wrote:
> Craig Markwardt <cbmarkwa...@gmail.com> writes:
>> Really you want to do something like,
>> RESOLVE_ALL, /CONTINUE, UNRESOLVED=unresolved
>
> So I do. BTW, how do I tell IDL to rescan the PATH to find any
> routines I might have added since it last looked?
IDL> path_cache, /rebuild
Mike
--
www.michaelgalloy.com
Tech-X Corporation
Associate Research Scientist
|
|
|