stop subcommand for dbx: Stop execution of a program

Format

Description

The stop subcommand stops execution of the program when certain conditions are fulfilled. The program is stopped when:
  • The condition is true, if the if condition option is used.
  • The sourceline line number is reached, if the at sourceline option is used.
  • The procedure is called, if the in procedure option is used.
  • The variable is changed, if the variable argument is specified.

The dbx debug program associates event numbers with each stop subcommand. To view these numbers, use the status subcommand. To turn stop off, use the delete or clear subcommand.

Options

at ["filename":]sourceline
Specifies the source line number in either the specified filename or the file that is currently being debugged. If a specific file name is specified, the filename must be enclosed with quotation marks and a colon must separate the "filename" from the sourceline. For example:
stop at "myfile":1234
if condition
Specifies the condition, such as true.
in procedure
Specifies the procedure to be called.

Usage notes

The stop subcommand can be run only while the dbx debug program is running.

Examples

  1. To stop execution at the first executable statement in the main procedure, enter:
    stop in main
  2. To stop execution when the value of the x variable is changed on line 12 of the execution, enter:
    stop x at 12
  3. To stop execution at a specified line (line 23), when the value of the variable (myvar) is greater than 2, enter:
    stop at 23 if myvar > 2
  4. To stop at line 52 only when thread $t2 reaches that line, enter:
    stop at 42 if $t2==$current

Related information

The stopi, delete, clear, and trace subcommands.