Sign in

username or email:

password:



Not a member?
Forgot your Password?

Search Comp.Arch.Embedded



Search tips

Ads

Discussion Groups

See Also

DSPFPGA

Discussion Groups | Comp.Arch.Embedded | source code analysis tools

There are 10 messages in this thread.

You are currently looking at messages 1 to 10.


So far in May, you have voted 0 times ou of a total of 22 votes by the community.
Please help us clean the archives from unuseful discussion threads by using the voting system! Details here.

source code analysis tools - piyushpandey - 2012-07-29 14:38:00

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 http://www.EmbeddedRelated.com

Re: source code analysis tools - Theo Markettos - 2012-07-29 14:55:00

piyushpandey <21398@embeddedrelated> wrote:
> 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.

Try LXR
http://lxr.sourceforge.net/en/index.shtml

Theo

Re: source code analysis tools - Glenn - 2012-07-29 14:56:00

On 29/07/12 20.38, piyushpandey wrote:
> 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 http://www.EmbeddedRelated.com


Normally an IDE, but some editors support Ctags:

Programmer's Notepad:
http://www.pnotepad.org/
http://www.pnotepad.org/features/
http://en.wikipedia.org/wiki/Programmer%27s_Notepad

Programming features:
http://en.wikipedia.org/wiki/Comparison_of_text_editors#Programming_features

Ctags:
http://en.wikipedia.org/wiki/Ctags
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.
..."
http://en.wikipedia.org/wiki/Ctags#Editors_that_support_ctags

Glenn

Re: source code analysis tools - Anton Erasmus - 2012-07-29 16:14:00

On Sun, 29 Jul 2012 13:38:04 -0500, "piyushpandey"
<21398@embeddedrelated> wrote:

>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.
>

Try

http://sourcenav.sourceforge.net/

Anton Erasmus

Re: source code analysis tools - Rich Webb - 2012-07-29 16:25:00

On Sun, 29 Jul 2012 20:56:27 +0200, Glenn <g...@gmail.com> wrote:

>On 29/07/12 20.38, piyushpandey wrote:
>> 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 http://www.EmbeddedRelated.com
>
>
>Normally an IDE, but some editors support Ctags:
>
>Programmer's Notepad:
>http://www.pnotepad.org/
>http://www.pnotepad.org/features/
>http://en.wikipedia.org/wiki/Programmer%27s_Notepad
>
>Programming features:
>http://en.wikipedia.org/wiki/Comparison_of_text_editors#Programming_features
>
>Ctags:
>http://en.wikipedia.org/wiki/Ctags
>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.
>..."
>http://en.wikipedia.org/wiki/Ctags#Editors_that_support_ctags

Ctags is good (vi represent, yo!).

For a "pretty" output, possibly running the source through doxygen
<http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc>
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.
<http://www.sgvsarc.com/Prods/CFLOW/Crystal_FLOW.htm>

-- 
Rich Webb     Norfolk, VA

Re: source code analysis tools - Dombo - 2012-07-29 16:44:00

Op 29-Jul-12 20:38, piyushpandey schreef:
> 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.

When confronted with an unfamiliar code base I use Doxygen 
(http://www.doxygen.org/) 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.



Re: source code analysis tools - Grant Edwards - 2012-07-29 17:35:00

On 2012-07-29, piyushpandey <21398@embeddedrelated> wrote:

> 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.

I use cscope (usalling from within emacs).

-- 
Grant

Re: source code analysis tools - David Brown - 2012-07-30 02:12:00

On 29/07/2012 22:44, Dombo wrote:
> Op 29-Jul-12 20:38, piyushpandey schreef:
>> 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.
>
> When confronted with an unfamiliar code base I use Doxygen
> (http://www.doxygen.org/) 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.
>

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.



Re: source code analysis tools - Nobody - 2012-07-30 06:07:00

On Sun, 29 Jul 2012 13:38:04 -0500, piyushpandey wrote:

> 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.

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.


Re: source code analysis tools - Oliver Betz - 2012-07-31 04:20:00

"piyushpandey" wrote:

>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.

Try http://www.sourceinsight.com/ if you are using Windows.

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