Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: ThomasG on January 05, 2006, 09:06:03 pm

Title: FlowCharts from Source Code
Post by: ThomasG on January 05, 2006, 09:06:03 pm
Hi,

I got a huge project assigned for maintenance. In order to get an idea what is going on, I would like to chart out the project or at least parts of it.

Can you guys give some advices? Maybe some software packages that can do the job?

Thanks,
Thomas
Title: Re: FlowCharts from Source Code
Post by: Michael on January 05, 2006, 11:31:24 pm
Hello,

Did you try a fast Google search :)? For example this (http://www.google.it/search?sourceid=navclient&hl=it&ie=UTF-8&rls=GGLG,GGLG:2005-40,GGLG:it&q=FlowCharts+from+Source+Code) is what I get.

Michael
Title: Re: FlowCharts from Source Code
Post by: ThomasG on January 06, 2006, 03:37:17 pm
Hi,

yes I did a search on google. I even tried most of these programs. But so far I couldn't find one that is really satisfying. The programs are either limited in functionality or are very expensive. Now I'm curious if these kind of tools are even used by open source developer. Since I couldn't find any open source solution I'm tempted to say it's not a commonly used tool.

Maybe you guys can point out methods on how get a grip on unknown programs/source code.

Thanks in advance.

Thomas
Title: Re: FlowCharts from Source Code
Post by: Ceniza on January 06, 2006, 04:37:28 pm
If the program is well structured and designed it should just be a matter of reading comments and follow the code, if that isn't the case it'll just be a nightmare, even with a flowchart.
Title: Re: FlowCharts from Source Code
Post by: ThomasG on January 06, 2006, 05:59:54 pm
Yeah, you are right, unfurtunately it's "structured" in a way only the original programmer can understand what's going on because he programmed it over the last 20 years.

I guess there is only the hard way of trial and error to figure out the source code and the refactor it.

Thanks,
Thomas
Title: Re: FlowCharts from Source Code
Post by: Michael on January 06, 2006, 06:14:01 pm
You can also try to search in sourceforge (http://sourceforge.net/), if you find something useful. May be also in wxCode (http://wxcode.sourceforge.net/) (but I am not sure).

Michael
Title: Re: FlowCharts from Source Code
Post by: Game_Ender on January 06, 2006, 06:29:41 pm
The reason those tools are expensive is because the of the difficulties of the C++ language.  It is quite hard to parse and work with, which is why leads to much longer tool developement time, and it is why you won't find much in the way of open source tools that work with it.  I know Umbrello is able to generate class diagrams from C++ code.
Title: Re: FlowCharts from Source Code
Post by: Michael on January 06, 2006, 06:39:51 pm
I know Umbrello is able to generate class diagrams from C++ code.

Umbrello looks interesting :), but it works only under Linux, or?

Michael
Title: Re: FlowCharts from Source Code
Post by: rudin on January 06, 2006, 07:02:02 pm
Maybe StarUML (http://staruml.tigris.org (http://staruml.tigris.org)) can help you refactor your code. It runs on Windows, freeware, and open source.
Title: Re: FlowCharts from Source Code
Post by: Ceniza on January 06, 2006, 07:05:47 pm
Well, Umbrello is for KDE, and two ways to bring KDE to Windows are: Cygwin and Virtualization.

Tricky to get working under Windows anyway.
Title: Re: FlowCharts from Source Code
Post by: Michael on January 06, 2006, 08:14:05 pm
Well, Umbrello is for KDE, and two ways to bring KDE to Windows are: Cygwin and Virtualization.

Cygwin is relatively huge. I have tried it for sometimes, but not liked too much. MinGW/MYSYS is IMHO better :), at least for what I needed it. Virtualization is a bit new concept for me :oops:.

I have not tried it, but may be StarUML (suggested by rudin) is a better option under Windows. A search within Tigris.org (http://www.tigris.org/) could also lead to some interesting alternatives.

Michael
Title: Re: FlowCharts from Source Code
Post by: ThomasG on January 06, 2006, 08:46:57 pm
Thanks, I will try out the suggested programs. I don't care if Linux or Windows, have both running and use whatever does the job done.

I would already happy with a tool that gets plain C right. I just had another look at the code, haven't seen that many goto's since my days of programming BASIC on my Sharp E500s pocket calculator. Any help/tool/hint is appreciated.

Thomas