next up previous


Points d'arręt

The command `info break' prints a list of all breakpoints set and not
cleared, showing their numbers, where in the program they are, and any
special features in use for them.  Disabled breakpoints are included in the
list, but marked as disabled.  `info break' with a breakpoint number
as argument lists only that breakpoint.  The convenience variable `$_'
and the default examining-address for the `x' command are set to the
address of the last breakpoint listed (*Note Memory::).

Setting Breakpoints
-------------------

Breakpoints are set with the `break' command (abbreviated `b').
You have several ways to say where the breakpoint should go.

`break FUNCTION'     
     Set a breakpoint at entry to function FUNCTION.
     
`break LINENUM'     
     Set a breakpoint at line LINENUM in the current source file.
     That file is the last file whose source text was printed.  This
     breakpoint will stop the program just before it executes any of the
     code on that line.
     
`break FILENAME:LINENUM'     
     Set a breakpoint at line LINENUM in source file FILENAME.
     
`break FILENAME:FUNCTION'     
     Set a breakpoint at entry to function FUNCTION found in file
     FILENAME.  Specifying a filename as well as a function name is
     superfluous except when multiple files contain similarly named
     functions.
     
`break *ADDRESS'     
     Set a breakpoint at address ADDRESS.  You can use this to set
     breakpoints in parts of the program which do not have debugging
     information or source files.
     
`break'     
     Set a breakpoint at the next instruction to be executed in the
     selected stack frame (*Note Stack::).  This is a silly thing to do in
     the innermost stack frame because the program would stop immediately
     after being started, but it is very useful with another stack frame,
     because it will cause the program to stop as soon as control returns
     to that frame.
     
`break ... if COND'     
     Set a breakpoint with condition COND; evaluate the expression
     COND each time the breakpoint is reached, and stop only if the
     value is nonzero.  `...' stands for one of the possible
     arguments described above (or no argument) specifying where to break.
     *Note Conditions::, for more information on breakpoint conditions.
     
`tbreak ARGS'     
     Set a breakpoint enabled only for one stop.  ARGS are the
     same as in the `break' command, and the breakpoint is set in the same
     way, but the breakpoint is automatically "disabled" the first time it
     is hit.

GDB allows you to set any number of breakpoints at the same place in the
program.  There is nothing silly or meaningless about this.  When the
breakpoints are conditional, this is even useful (*Note Conditions::).