1 2 3 | static void step_1 (int skip_subroutines, int single_inst, char *count_string) |
1 2 3 4 5 6 7 | struct section_table { CORE_ADDR addr; /* Lowest address in section */ CORE_ADDR endaddr; /* 1+highest address in section */ sec_ptr the_bfd_section; bfd *bfd; /* BFD file pointer */ }; |
1 2 3 4 5 | int main(){ int i; for(i=0;i<10;i++) foo(); } |
1 2 3 4 5 | void foo() { int a; a=10; } |
1 2 3 4 5 6 7 8 | 00000000 <_fooh>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 04 sub $0x4,%esp 6: c7 45 fc 0a 00 00 00 movl $0xa,0xfffffffc(%ebp) d: c9 leave e: c3 ret f: 90 nop |
1 2 3 4 5 6 7 8 9 | //test1.c void foo() { printf(“test\n”); } int main(void) { int a = 1; if (a ==1) foo(); } |
1 2 3 4 5 6 7 8 9 | //test2.c void foo() { printf(“test\n”); } int main(void) { int a = 0; if (a ==1) foo(); } |
1 2 | $gcc –g –o test1 test1.c $gcc –g –o test2 test.c |
1 2 3 4 5 6 | $gdb test1 (gdb) b main (gdb) covertest test coverage rate: 100% (gdb) |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |