Home > Archive > Software Engineering > May 2006 > C code analysing tool
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
C code analysing tool
|
|
|
| Hello,
I am looking for C code analysing tool,
My problem is:
To discover the portion of code that depends on(deals with) a number
of specified structures and variables.
Sample:
void funct(struct header* h)
{
.....
memcpy(buff,h,sizeof(struct header));
func2(buff)
.....
a kind of other code....
}
The idea is to detect all the code that depends on or deals with "h"
Do you know the tools that can solve the problem?
Thanks a lot.
Andrey
| |
|
| Hello Andrey,
On Thu, 11 May 2006 21:03:45 UTC, "kazak" <andrey.kazakov@gmail.com> wrote:
> Hello,
> I am looking for C code analysing tool,
>
> My problem is:
> To discover the portion of code that depends on(deals with) a number
> of specified structures and variables.
<sample snipped>
> The idea is to detect all the code that depends on or deals with "h"
Code that deals with "h" may be found by your IDE if you load all
the source into your project. Your code repository might also
have some search capabilities.
If all else fails use grep or a similar search utility to find
all of the code that has the "h" in it. Naturally searching for
such a short name would certainly be helped by a search tool that
has a "complete word" search capability.
This is just the first step in the process. Then you have to look
at all those references and find those that are of the value you
are looking for. Then examine all the code in that scope for
relevant references, copies, void pointers, and other ways to
use the value. Keep searching recursively as you find how this
value is used.
Now you most likely have all the code that deals with your
value and you can start to answer your original question of
what code actually deals with the value.
> Do you know the tools that can solve the problem?
A decent IDE, text processor, and search tool are useful computer
tools for the task. Your brain, memory, and time are the most
useful. Good documentation and notes might have answered the
question for you, but keeping that up-to-date and trusdting that
it is up-to-date can be a problem too.
> Thanks a lot.
> Andrey
David
| |
| Derek M. Jones 2006-05-12, 9:59 pm |
|
> My problem is:
> To discover the portion of code that depends on(deals with) a number
> of specified structures and variables.
The phrase you need to search on is "program slicing".
One such tool can be found here:
hissa.nist.gov/~jimmy/unravel.html
| |
|
|
|
|
|