
Chapter 6. Tools in the Toolbox 239
}
The gdb example (Example 6-37), with the corrected and recompiled source
code above, starts by setting a breakpoint at the printf() subroutine (the b printf
command). Then we start the execution of the program, which stops at the
printf() breakpoint. Next we display the stack backtrace by issuing the bt
command, and gdb displays that we are at the printf() subroutine. Finally we
continue by using the c command and quit (q) the debugging session after the
process has terminated with the return code 015.
Example 6-37 Stepping though the executable
root@fenris:/home/work: gdb -q ourcode
(gdb) b printf
Breakpoint ...