Debugging with GDB (February 2008)

Table Of Contents
170 Debugging with GDB
Type "show warranty" for warranty/support.
...
(gdb) b main
Breakpoint 1 at 0x4000a60:0: file execpath.c, line 7 from a.out.
(gdb) r
Starting program: a.out
Breakpoint 1, main () at execpath.c:7
7 int a = 3, b = 0, c = 4;
(gdb) n
9 if (a)
(gdb) i ep
Local execution path table for main():
empty
(gdb) i gep
Global execution path table:
empty
(gdb) n
10 printf("Value of a greater than 0\n");
(gdb) n
Value of a greater than 0
12 if (b)
(gdb) i ep
Local execution path table for main():
0 0x4000a80:2 (execpath.c:10)
(gdb) i gep
Global execution path table:
G0 0x4000a80:2 main (execpath.c:10)
(gdb) n
15 if (c)
(gdb) i ep
Local execution path table for main():
0 0x4000a80:2 (execpath.c:10)
(gdb) i gep
Global execution path table:
G0 0x4000a80:2 main (execpath.c:10)
(gdb) n
16 printf("Value of c greater than 0\n");
(gdb) n
Value of c greater than 0
18 printf("All condition checking done\n");
(gdb) i ep
Local execution path table for main():
0 0x4000a80:2 (execpath.c:10)
2 0x4000bd0:2 (execpath.c:16)
(gdb) i ep summary
Summary for local execution path table for main()