
D-18
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
Stopping and Continuing
D.6.2 Breakpoints
A
breakpoint
makes your program stop whenever a certain point in the program is
reached. You set breakpoints explicitly with GDB commands, specifying the place where
the program should stop by line number, function name or exact address in the program.
You can add various other conditions to control whether the program will stop.
Each breakpoint is assigned a number when it is created; these numbers are successive
integers starting with 1. In many of the commands for controlling various features of
breakpoints you use the breakpoint number to say which breakpoint you want to change.
Each breakpoint may be
enabled
or
disabled
; if disabled, it has no effect on the program
until you enable it again.
The command ‘info break’ prints a list of all breakpoints set and not deleted, 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 (see section Memory).
D.6.2.1 Setting Breakpoints
Breakpoints are set with the ‘break’ command (abbreviated ‘b’). You have several ways to
say where the breakpoint should go as shown in Table D-5.
Table D-5. Breakpoints
Command
Description
break function
Set a breakpoint at entry to function function.
break +offset
break -offset
Set a breakpoint some number of lines forward or back from the position at which
execution stopped in the currently selected frame.
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
file name 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.
F
Freescale Semiconductor, Inc.
n
.