Prism 6.0 User's Guide

Using Commands

Issue the command stop (or when, which is an alias for stop) from the command line to set a breakpoint. The syntax of the stop command is also used by the stopi, trace, and tracei commands, which are discussed below. The general syntax for all the commands is:

command [variable | at line | in func] [if expr] [{cmd[; cmd...]}] [after n]

where

at "filename":line-number

if a .GT. 1

This form of the command slows execution considerably, unless you combine it with the at line syntax. See " Writing Expressions in Prism" for more information on writing expressions in Prism.

The first option listed (specifying the location or the name of the variable) must come first on the command line; the other options, if you include them, can be in any order.

For the when command, you can use the keyword stopped to specify that the actions are to occur whenever the program stops execution.

When you issue the command, an event is added to the event list. If the command sets a breakpoint at a program location, a B appears in the line-number region next to the location.

Examples

To stop execution the tenth time in function foo and print a:

stop in foo {print a} after 10

To stop at line 17 of file bar if a is equal to 0:

stop at "bar":17 if a == 0

To stop whenever a changes:

stop a

To stop the third time a equals 5:

stop if a .eq. 5 after 3

To print a and do a stack trace every time the program stops execution:

when stopped {print a; where}

For Machine Instructions

To set a breakpoint at a machine instruction, issue the stopi command, using the syntax described above, and specifying a machine address. For example,

stopi at 0x1000

stops execution at address 1000 (hex).

The history region displays the address and the machine instruction. The source pointer moves to the source line being executed.

Deleting Breakpoints via the Command Window

To delete a breakpoint via the command window, first issue the show events command. This prints out the event list. Each event has an ID number associated with it.

To delete one or more of these events, issue the delete command, listing the ID numbers of the events you want to delete; separate multiple IDs with one or more blank spaces. For example,

delete 1 3

deletes the events with IDs 1 and 3. Use the argument all to delete all existing events.