OpenBoot 3.x Command Reference Manual

Breakpoints

The User Interface provides a breakpoint capability to assist in the development and debugging of stand-alone programs. (Programs that run over the operating system generally do not use this OpenBoot feature, but use other debuggers designed to run with the operating system.) The breakpoint feature lets you stop the program under test at desired points. After program execution has stopped, registers or memory can be inspected or changed, and new breakpoints can be set or cleared. You can resume program execution with the go command.

Table 6-4 lists the breakpoint commands that control and monitor program execution.

Table 6-4 Breakpoint Commands

Command  

Stack Diagram 

Description 

+bp

( addr -- ) 

Add a breakpoint at the specified address. 

-bp

( addr -- ) 

Remove the breakpoint at the specified address. 

--bp

( -- )  

Remove the most-recently-set breakpoint. 

.bp

( -- ) 

Display all currently set breakpoints. 

.breakpoint

( -- ) 

Perform a specified action when a breakpoint occurs. This word can be altered to perform any desired action. For example, to display registers at every breakpoint, type: ['] .registers to .breakpoint. The default behavior is .instruction. To perform multiple behaviors, create a single definition which calls all desired behaviors, then load that word into .breakpoint.

.instruction

( -- ) 

Display the address, opcode for the last-encountered breakpoint.  

.step

( -- ) 

Perform a specified action when a single step occurs (see .breakpoint).

bpoff

( -- ) 

Remove all breakpoints. 

finish-loop

( -- ) 

Execute until the end of this loop. 

go

( -- ) 

Continue from a breakpoint. This can be used to go to an arbitrary address by setting up the processor's program counter before issuing go.

gos

( n -- ) 

Execute go n times.

hop

( -- ) 

(Like the step command.) Treat a subroutine call as a single instruction.

hops

( n -- ) 

Execute hop n times.

return

( -- ) 

Execute until the end of this subroutine. 

returnl

( -- )  

Execute until the end of this leaf subroutine. 

skip

( -- ) 

Skip (do not execute) the current instruction. 

step

( -- ) 

Single-step one instruction. 

steps

( n -- ) 

Execute step n times.

till

( addr -- ) 

Execute until the given address is encountered. Equivalent to +bp go.

To debug a program using breakpoints, use the following procedure.

  1. Load the test program into memory.

  2. See Chapter 5, Loading and Executing Programs for more information. The register values are initialized automatically.

  3. (Optional) Disassemble the downloaded program to verify a properly-loaded file.

  4. Begin single-stepping the test program using the step command.

  5. You can also set a breakpoint, then execute (for example, using the commands addr +bp and go) or perform other variations.