b

The b command set and display breakpoints.

Command Format

b
b addr...
b addr -s command

where:

addr address where breakpoint should be inserted
-s string executes the command string string when the breakpoint is reached. If no command is specified the command string in the brkcmd variable value will be executed. See below.

Functional description

The b command inserts a breakpoint at the specified address or addresses. Multiple address expressions may be specified at the same time. An address must comply with any alignment restrictions wich the target processor architecture have.

A breakpoint number is automatically assigned to each breakpoint when set. If multiple addresses are specified each address will have its own breakpoint number. When a breakpoint number is allocated the first unused number will be used.

PMON2000 reports a new breakpoints number immediately after the breakpoint is set (see the examples at the end of this subsection for an illustration of this). The assigned number can be used in the db command to specify the breakpoint to delete.

Each breakpoint can have a command string which is executed when the breakpoint is reached. The value of the string is set using the -s string parameter. For example the string command:

PMON> b print -s "l @cpc 1;d -s @a0"

will print the instruction at the function print and then display the string pointed by argument register a0.

When a breakpoint is reached, which was set without using the -s string parameter, the commans specified in the environment variable brkcmd is executed. The default setting for brkcmd is:

brkcmd = "l @cpc 1"

This command "l @cpc 1", specifies that when the breakpoint occurs, PMON2000 will disassemble one instruction starting at the address in the current program counter register.

<

The breakpoint command variable brkcmd can be changed with the set command. For example, additional PMON2000 commands can be added in the brkcmd variable. Multiple commands must be separated using a semicolon. For example, the following command list will display the instruction at the breakpoint and then display all the register values.

PMON> set brkcmd "l @epc 1;r *"

By default, all breakpoints are removed when the load, or boot command is executed. See the section on each command in this document for details on how to override automatic breakpoint clearing after a download operation.

Some examples illustrating the use of the b command follow.

PMON> b a002000c          Set a break @ 0xa00200c
Bpt 1 = a002000c

PMON> b List all breakpoints
Bpt 0 = 8002022c
Bpt 1 = a002000c

PMON> b 80021248 -s "r" Set a break with the command 'r'.

Environment

The command uses the brkcmd environment variable.

See Also

The db, load and boot commands.

Powered by Drupal, an open source content management system