Next: , Previous: Procedural Breakpoints, Up: Intro to Breakpoints


3.4.2.4 Setting Breakpoints

In general, that is. We've already seen how to set source and procedural breakpoints conveniently in practice. This section explains how those conveniences map onto a more general mechanism.

The general mechanism for setting breakpoints is the generic function set-breakpoint!. Different kinds of breakpoints define subclasses of the class <breakpoint> and provide their own methods for set-pbreakpoint!.

For example, (ice-9 debugger breakpoints procedural) implements the <procedure-breakpoint> subclass and provides a set-breakpoint! method that takes a procedure argument:

     (set-breakpoint! behavior fact1)
     -|
     Set breakpoint 1: [fact1]
     =>
     #<<procedure-breakpoint> 808b0b0>

A non-type-specific set-breakpoint! method is provided by the generic module (ice-9 debugger breakpoints). It allows you to change the behaviour of an existing breakpoint that is identified by its breakpoint number.

     (set-breakpoint! behavior 1)