__FILE__ __FUNCTION__ __LINE__实现调试跟踪[转]

1184阅读 0评论2010-04-15 zboom
分类:

//file:line_function_file.c
#include
2 
3 void test(void)
4 {
5         printf("%s:%s:%d:debug info:hello !\n",__FILE__,__FUNCTION__,__LINE__);
6 }

8 int main(void)
9 {
10         test();
11         return 0;
12 } 

[root@study]# vi line_function_file.c
[root@study]#
[root@study]#
 gcc -o line_function_file line_function_file.c 
[root@study]#
[root@study]#
 ./line_function_file 
line_function_file.c:test:5:debug info:hello !

上一篇:菜鸟杂谈2
下一篇:Linux抢占式内核