1.3.102 newvar

Declares and initializes a new debugger convenience variable.

Syntax

newvar [global] $name [=initial_value]

Where:

Syntax

global

Specifies that the variable has global scope. If global is not specified, then the variable is only accessible within its enclosing lexical scope.

name

Specifies the name of the new variable. The name must be a valid C identifier but prefixed with $.

initial_value

Specifies the initial value of the variable. If an initial value is not specified, then by default, the variable is of integer type with value 0.

Example 1-105 Examples

define advance_hw    # This defines a new command that runs
                     # to an address using a hardware breakpoint.
  hbreak $arg0       # Set a hardware breakpoint at the value of the first parameter.
  newvar $bp_num = $ # Save the number of the breakpoint in a new variable.
  continue
  wait
  delete $bp_num     # Delete the hardware breakpoint.
end
advance_hw 0x00008000
Non-ConfidentialPDF file icon PDF versionARM DUI0452Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.