
Stopping and Continuing
Motorola
GNU Debugger (GDB)
For More Information On This Product,
Go to: www.freescale.com
D-21
Aside from the automatic disablement or deletion of a breakpoint when it stops the
program, which happens only in certain states, the state of enablement of a breakpoint
changes only when one of the commands above is used.
D.6.2.4 Break Conditions
The simplest sort of breakpoint breaks every time the program reaches a specified place.
You can also specify a
condition
for a breakpoint. A condition is just a boolean expression
in your programming language. (See section Expressions). A breakpoint with a condition
evaluates the expression each time the program reaches it, and the program stops only if
the condition is true.
Break conditions may have side effects, and may even call functions in your program.
These may sound like strange things to do, but their effects are completely predictable
unless there is another enabled breakpoint at the same address. (In that case, GDB might
see the other breakpoint first and stop the program without checking the condition of this
one.) Note that breakpoint commands are usually more convenient and flexible for the
purpose of performing side effects when a breakpoint is reached (see section Break
Commands).
Break conditions can be specified when a breakpoint is set, by using ‘if’ in the arguments
to the ‘break’ command. See section Set Breaks. They can also be changed at any time
with the ‘condition’ command:
condition bnum expression
Specify
expression
as the break condition for breakpoint number
bnum
. From now on, this
breakpoint will stop the program only if the value of
expression
is true (nonzero, in C).
expression
is not evaluated at the time the ‘condition’ command is given. See section
Expressions.
enable breakpoints bnums...
enable bnums...
Enable the specified breakpoints. They become effective once
again in stopping the program, until you specify otherwise.
enable breakpoints once bnums...
enable once bnums...
Enable the specified breakpoints temporarily. Each will be
disabled again the next time it stops the program (unless you
have used one of these commands to specify a different state
before that time comes).
enable breakpoints delete bnums...
enable delete bnums...
Enable the specified breakpoints to work once and then die.
Each of the breakpoints will be deleted the next time it stops the
program (unless you have used one of these commands to
specify a different state before that time comes).
Table D-7. Disabling Breakpoint Commands
Command
Description
F
Freescale Semiconductor, Inc.
n
.