__FILE__ __FUNCTION__ __LINE__实现调试跟踪
//file:line_function_file.c
1 #include
2
3 void test(void)
4 {
5 printf("%s:%s:%d:debug info:hello !\n",__FILE__,__FUNCTION__,__LINE__);
6 }
7
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 !
阅读(1309) | 评论(0) | 转发(0) |