C代码分析工具 [英] C code analisys tool
问题描述
您好,
我正在寻找C代码分析工具,
我的问题是:
发现部分代码依赖于(处理)一个数字
的指定结构和变量。
样本:
void funct( struct header * h)
{
.....
memcpy(buff,h,sizeof(struct header) );
func2(buff)
.....
a其他代码....
>
}
想法是检测依赖于或处理h的所有代码
你知道那些工具吗?可以解决问题吗?
非常感谢。
安德烈
kazakaécrit:您好,
我正在寻找C代码分析工具,
我的问题是:
要发现代码部分依赖于(处理)指定结构和变量的数量。
S.充足:
void funct(struct header * h)
{
....
memcpy(buff,h,sizeof(struct header) );
func2(buff)
....
一种其他代码....
}
想法是检测所有依赖于或处理h的代码
您是否知道可以解决问题的工具?
非常感谢。
Andrey
如果您使用的是lcc-win32 IDE,请将光标放在您的标识符中,按
按CTRL + F8。这将在所有
加载的文件中显示该标识符的所有用法。如果您想在功能中显示使用情况
右键单击标识符,然后从上下文中选择< function name>中的本地人>
选项出现的菜单。
第二个选项将显示使用给定
标识符的所有行的切片,忽略标识符未出现的所有行。这个
非常便于查看变量的实际用法
http://www.cs.virginia.edu/~lcc-win32
kazak写道:您好,
我正在寻找C代码分析工具,
这类东西可能由您的工具链提供,检查文档。
-
Ian Collins。
Ian Collinsaécrit:< blockquote class =post_quotes> kazak写道:
你好,
我正在寻找C代码分析工具,
这你可以通过工具链提供一些东西,查看文档。
可能不是。这个非常常见的选项是不存在的,例如,在
最新版本的Visual Studio(VC8)中,即使该软件占用3GB
磁盘空间和多种选项。
gcc IDE DevC ++也不会这样做。在linux下,大多数IDE都不会进行任何语法分析。
当然
grep MyId *。 c
会做(有点)但它不会消除评论而且不会跟随范围。
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
kazak a écrit :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
If you are using the lcc-win32 IDE put the cursor in your identifier and
press CTRL+F8. This will display all usages of that identifier in all
loaded files. If you want to display the usage just within a function
right click in the identifier and choose the "Locals in <function name>"
option from the context menu that appears.
The second option will show a slice of all lines that use the given
identifier ignoring all lines where the identifier does not appear. This
is very handy for seeing the actual usage of a variable
http://www.cs.virginia.edu/~lcc-win32
kazak wrote:Hello,
I am looking for C code analysing tool,
This sort of thing might be provided by you tool chain, check the docs.
--
Ian Collins.
Ian Collins a écrit :kazak wrote:Hello,
I am looking for C code analysing tool,
This sort of thing might be provided by you tool chain, check the docs.
Probably not. This very common option is absent, for instance, in the
latest version of Visual Studio (VC8) even if that software takes 3GB
disk space and as a zillion options.
The gcc IDE DevC++ doesn''t do it either. Under linux, most IDEs do not
do any syntax analysis.
Of course
grep MyId *.c
will do it (sort of) but it will not eliminate comments and doesn''t
follow scopes.
这篇关于C代码分析工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!