Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#213210 - 14/04/2004 10:20 automatic function listing
RobotCaleb
pooh-bah

Registered: 15/01/2002
Posts: 1866
Loc: Austin
ive recently been tasked with taking over a several year old project that is about a year from completion. it has been developed in Borland C++ Builder 3, and must stay that way. since this program is several hundred thousand lines long it is a pain to try to imagine what the previous coders may have named functions.

i am looking for a program that will parse the source code and create a function listing/flowchart-ish document. inputs and outputs would be nice, but not necessary.

does anything like this exist?

Top
#213211 - 14/04/2004 10:28 Re: automatic function listing [Re: RobotCaleb]
JeffS
carpal tunnel

Registered: 14/01/2002
Posts: 2858
Loc: Atlanta, GA
There was a program by Power Builder called Sleuth QA that would profile the functions in Delphi and C++ Builder applications. I'm certain there would be a way to output these functions in a usable format, plus allow you to determine some valuable stats about each. Unfortunatly Power Builder has gone under, but I believe they open-sourced all of their code and made their products available, I’m just not sure where. A little searching around might find this out though.
_________________________
-Jeff
Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.

Top
#213212 - 14/04/2004 10:35 Re: automatic function listing [Re: RobotCaleb]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4175
Loc: Cambridge, England
http://www.doxygen.org (that is, if it's mainly standard C++, I don't know whether Borland is full of crummy extensions).

Peter

Top
#213213 - 14/04/2004 10:40 Re: automatic function listing [Re: RobotCaleb]
JeffS
carpal tunnel

Registered: 14/01/2002
Posts: 2858
Loc: Atlanta, GA
Alternatively, if you're feeling a bit clever you can create a map file (at least I believe you can do this in C++ builder 3). Select the option under the "linker" tab for your project options and it will generate a .map file when you compile and output it in the directory where your exe goes.

The map file isn't quite what you're looking for, as it gives the addresses of ALL functions the program accesses, including those in the VCL. However, I believe all user-defined functions should be grouped together, so you can use this data to create your flowchart. Just remember this is kind of an atomic bomb approach and you'll get WAY more information in this file than you actually need. The trick is whether or not you can isolate just the user created functions. I'd suggest doing a search on a known function name and then seeing how the other user functions are arranged in the file around it.
_________________________
-Jeff
Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.

Top
#213214 - 14/04/2004 10:40 Re: automatic function listing [Re: RobotCaleb]
mschrag
pooh-bah

Registered: 09/09/2000
Posts: 2303
Loc: Richmond, VA
Probably not exactly what you want, but the Linux Cross-Reference Tool might be handy for such a situation too ... http://sourceforge.net/projects/lxr

Top
#213215 - 14/04/2004 23:09 Re: automatic function listing [Re: peter]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
I'll second doxygen!

Top
#213216 - 15/04/2004 12:47 Re: automatic function listing [Re: peter]
RobotCaleb
pooh-bah

Registered: 15/01/2002
Posts: 1866
Loc: Austin
i took doxygen (Doxygen? they use both) for a test drive. this program is pretty sweet.
it has done what i was hoping it would. thank you for pointing me there

Top
#213217 - 15/04/2004 13:10 Re: automatic function listing [Re: RobotCaleb]
JeffS
carpal tunnel

Registered: 14/01/2002
Posts: 2858
Loc: Atlanta, GA
Glad you got a good solution!

FWIW, if you can get a hold of Sleuth QA (and you should since it's free now) I would. It's an invaluable tool for detecting memory leaks and locating bottle-necks.
_________________________
-Jeff
Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.

Top