source code analysis tools

Hi guys

I don't know that how much valid my question is but I think you guys might be .

having some answer to it .

actually what I want to know is that if there is any source code analysis tool such that suppose I have a source code rared or zipped and in that I have all the c,c++ source files and also all the related header files and than if I want to analyse the code so that if I am at any source file and I am not able to get any variable declared in that file and want to find out that where it is decalared than how I can do that.

Is there any software for that or some other procedures because I want to know that how the big packages of softwares are deciphered I mean how their logic flow is decoded from the source code.

Thanks

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey
Loading thread data ...

Try LXR

formatting link

Theo

Reply to
Theo Markettos

Normally an IDE, but some editors support Ctags:

Programmer's Notepad:

formatting link
formatting link
formatting link

Programming features:

formatting link

Ctags:

formatting link
Quote: "... Ctags is a program that generates an index (or tag) file of names found in source and header files of various programming languages. Depending on the language, functions, variables, class members, macros and so on may be indexed. These tags allow definitions to be quickly and easily located by a text editor or other utility. ..."
formatting link

Glenn

Reply to
Glenn

Try

formatting link

Anton Erasmus

Reply to
Anton Erasmus

Ctags is good (vi represent, yo!).

For a "pretty" output, possibly running the source through doxygen

The output is improved if the source has comment tags formatted for doxygen but even without those it can be useful.

I've used "Crystal FLOW" and liked it but it's commercial and requires annual maintenance fees for updates/fixes. Also to move to a new machine. It was nice but not *that* nice, so my last maintenanced version sits on the older notebook.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

When confronted with an unfamiliar code base I use Doxygen

formatting link
to get a better understanding of it.

Doxygen (when used in combination with Graphviz) can generate dependency-, inheritance-, call- and include graphs, can tell you which functions refer to a particular function or variable and can generate hyperlinked source browser. Doxygen ain't perfect, it may get confused by complex macro's or templates, but it is free and has done a wonderful job for me so far.

Reply to
Dombo

I use cscope (usalling from within emacs).

--
Grant
Reply to
Grant Edwards

Another vote for Doxygen here. You can use the wizard to quickly set it up to generate "documentation" for all code (headers and source), including the source in the "documentation" and including all the graphs. You end up with a large set of html documents with all the identifiers being clickable to trace usage and dependencies.

If you are using doxygen for this sort of thing (rather than using doxygen for proper documentation), make sure you only generate html - avoid pdf, rtf, chm formats or you can end up trying to generate books of thousands of pages!

The other tool that comes to mind is Eclipse - with modern versions, its indexer is pretty good, and can help with such cross-referencing.

Reply to
David Brown

You've had several suggestions which work on the source code. But such approaches won't always work in the presence of extensive preprocessor use. An IDE which uses information generated during compilation may produce better results.

On one particularly large project, I resorted to using "nm" to dump the symbol tables from the object files; these were processed with "sed" then imported into an SQL database.

Reply to
Nobody

Try

formatting link
if you are using Windows.

Oliver

--
Oliver Betz, Munich
despammed.com is broken, use Reply-To:
Reply to
Oliver Betz

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.