3.7 Associating debug scripts to breakpoints
Using conditional breakpoints, you can run a script each time the selected breakpoint is triggered. You assign a script file to a specific breakpoint, and when the breakpoint is hit, the script executes.
If using the user interface, use the Breakpoint Properties
dialog box to specify your script. See Breakpoint
for more information.
If using the command-line, use the break-script
command to specify your script.
Be aware of the following when using scripts with breakpoints:
- If you assign a script to a breakpoint that has sub-breakpoints, the debugger
attempts to execute the script for each sub-breakpoint. If this happens, an
error message is displayed. For an example of sub-breakpoints, see Breakpoints view.
- Take care with commands you use in a script that is attached to
a breakpoint. For example, if you use the quit command in a script, the debugger disconnects from
the target when the breakpoint is hit.
- If you put the continue command at the end of a script, this has the same
effect as setting the Continue Execution
option on the Breakpoint Properties dialog