Overview of Breakpoints
A breakpoint is like a tripwire within a program: You set a breakpoint at a particular "place" within your program, and when execution reaches that point, the debugger will pause the program's execution (and will, in the case of a text-based debugger such as GDB, give you a command prompt).
GDB is very flexible about the meaning of "place"; it could mean things as varied as a line of source code, an address of code, a line number within a source file, or the entry into a function.
A snippet of a debug session is shown below to illustrate what happens when GDB breaks at a line of code. In the snippet, we list part of the source code, put a breakpoint at line 35 of the program, and then run the program. GDB hits the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access