linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* development tools for interpreting code
@ 2004-12-21 16:17 soraberri
  2004-12-21 16:35 ` Nir Dremer
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: soraberri @ 2004-12-21 16:17 UTC (permalink / raw)
  To: linux-c-programming

Hi all,

In this stage of my learning I am basically trying to understand some 
code that others have develop. The code is about bluetooth tools but 
this is unrelevant at this moment. Rigth now I'm using Kdevelop for this 
task with the source that I want to understand loaded into a new 
project, and I always find the same problem which I will describe you in 
terms of an example:

at some point of the code I find a call to a function or a typedef name 
(for exmple str2ba) and I would like to find the header file or even the 
source file where this function (or type) is defined. I can only use the 
Grep:str2ba command found under "Find in files..." dialog but sometimes 
this is not suitable because I have to tell manually the path from the 
starting point of the search, and if I don't know exactly the rigth 
folder, the number of results searched can be too many for examining. I 
guess it may be a better way, since the program compiles and has the 
appropiate includes (#include <header>), so the compiler must know where 
the function is defined.

So, every suggestions would be wellcome,

thaks in advance


^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: development tools for interpreting code
@ 2004-12-21 18:39 Huber, George K RDECOM CERDEC STCD SRI
  0 siblings, 0 replies; 9+ messages in thread
From: Huber, George K RDECOM CERDEC STCD SRI @ 2004-12-21 18:39 UTC (permalink / raw)
  To: 'soraberri', linux-c-programming

soraberri wrote:

>at some point of the code I find a call to a function or a typedef name 
>(for exmple str2ba) and I would like to find the header file or even the 
>source file where this function (or type) is defined. I can only use the 
>Grep:str2ba command found under "Find in files..." dialog but sometimes 
>this is not suitable because I have to tell manually the path from the 
>starting point of the search, and if I don't know exactly the rigth 
>folder, the number of results searched can be too many for examining. I 
>guess it may be a better way, since the program compiles and has the 
>appropiate includes (#include <header>), so the compiler must know where 
>the function is defined.

As others have suggested, ctags, cflow and cscope are three very useful programs for 
dealing with this.  In addition to the these two, I also find `calltree'
(see ftp://ftp.berlios.de/pub/calltree/) to be very useful.  `calltree' produces
a call graph for given set of input files - useful to understand the static structure
of a program.

In addition, valgrind using the calltree (or is it now callgrind) skin along with 
cachegrind produces useful information during the execution of the program.


Hope this helps,
George



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-12-21 18:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-21 16:17 development tools for interpreting code soraberri
2004-12-21 16:35 ` Nir Dremer
2004-12-21 16:53   ` soraberri
2004-12-21 17:02     ` Nir Dremer
2004-12-21 17:38       ` José Ricardo
2004-12-21 18:45       ` soraberri
2004-12-21 18:08 ` Jan-Benedict Glaw
2004-12-21 18:48 ` soraberri
  -- strict thread matches above, loose matches on Subject: below --
2004-12-21 18:39 Huber, George K RDECOM CERDEC STCD SRI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).