我能夠使用gnu -cflow生成一個文件的調用圖,但我無法找到如何使用cflow爲多個文件生成調用圖。如何給多個c文件作爲輸入到GNU Cflow?
我嘗試以下
的cflow test.c的,hello.c的
它爲test.c的調用圖,而不是爲了hello.c的
cflow的測試創建。 c hello.c
它爲hello.c生成callgraph並且不爲test.c創建它c
我不知道如何將多個文件傳遞給cflow。
對此有何想法?
的hello.c
int
who_am_i (void)
{
struct passwd *pw;
char *user = NULL;
pw = getpwuid (geteuid());
if (pw)
user = pw->pw_name;
else if ((user = getenv ("USER")) == NULL)
{
fprintf (stderr, "I don't know!\n");
return 1;
}
printf ("%s\n", user);
unused_function();
return 0;
}
int
main (int argc, char **argv)
{
if (argc > 1)
{
fprintf (stderr, "usage: whoami\n");
return 1;
}
return who_am_i();
}
void unused_function()
{
printf();
error1();
printf();
}
void error1()
{
error2();
}
void error2()
{
}
test.c的
int tests()
{ return 0;}
你可以發佈hello.c和test.c的內容嗎? – 2013-03-07 07:43:44
@AndreasGrapentin我添加了代碼。我只是不知道如何傳遞多個文件名到cflow。 – Ganeshkumar 2013-03-07 08:44:01
你的第二次調用是正確的。 'tests()'不會顯示在你的調用圖中,因爲它永遠不會被調用。 – 2013-03-07 08:57:45