2.3.89. ONSTATE

Executes the associated command when a particular event occurs.

Syntax

ONSTATE [,event] [,timer] [,replace] [command]

where:

event

Specifies the event to trigger on from the following list:

start

Execute the command immediately before program execution starts.

stop

Execute the command immediately after program execution stops.

starttimed

Execute the command immediately before program execution starts and at the specified interval thereafter until the program stops running. The target must support execution of commands on a running target.

tstart

An alias of starttimed.

stoptimed

Execute the command immediately after program execution stops and at the specified interval thereafter, until the debugger starts the program again or the target is disconnected. Specify the time interval using the ,timer qualifier, with the interval in milliseconds.

tstop

An alias of stoptimed.

reset

If target reset is detected by the debugger, execute the command.

timer

A qualifier used to specify the time interval used with timed events. The minimum interval is 10ms.

replace

A qualifier used to specify that this ONSTATE command replaces all previous ONSTATE commands for the same event.

If this qualifier is not specified, new commands for an event are added to the end of a list of commands to execute when the event happens.

command

The debugger command to execute. It can be more than one word.

Description

The ONSTATE command executes a given debugger command when a specified event occurs. If no arguments are provided, ONSTATE lists out the currently registered commands for each type of event.

Examples

The following examples show how to use ONSTATE:

onstate,tstop,timer:5000 ce 0x8000

While the debugger has the target stopped at a five-second interval, execute the command ce 0x8000.

onstate,stop,replace

Delete the event commands associated with the stop event.

onstate

List the current event commands in the following format:

On Start:
  <no commands registered>On Stop:
  <no commands registered>On Start Timed (every 0 msecs):
  <no commands registered>On Stop Timed (every 5000 msecs):
  ce 0x8000On Reset:
  <no commands registered>

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111