1.1.3 Expressions within DS-5

Some DS-5 commands accept expressions. There are many types of expressions accepted by the debugger that enable you to extend the operation of a command. For example, binary mathematical expressions, references to module names, or calls to functions.

Usage of $ character to access registers and variables within DS-5 expressions

In an expression you can access the content of registers by using the $ character and the register name, for example:

print 4+$R0      # add 4 to the content of R0 register and print result

Results from the print commands are recorded in debugger variables. Other commands, such as breakpoint or watchpoint creating commands, the start command, and the memory command, also use debugger variables to record the ID of the new resource. Each of these debugger variables is assigned a number and can be used subsequently in expressions by using the $ character.

You can access print results or resource IDs using the debugger variables:

$

Print result or ID in the last assigned debugger variable.

$$

Print result or ID in the second-to-last debugger variable.

$n

Print result or ID in the debugger variable with number n.

You can also use the following debugger variables:

$cwd

Current working directory.

$cdir

Current compilation directory.

$entrypoint

Entry point of the current image.

$idir

Current image directory.

$sdir

Current script directory.

$datetime

Current date and time in string format.

$timems

Number of milliseconds since 1st Jan 1970.

$pid

Current operating system process ID.

$thread

Current thread ID for a multi-threaded application.

$core

Current processor ID for a Symmetric MultiProcessing (SMP) systems.

$vmid

Current Virtual Machine ID (VMID) for systems that support hypervisor / virtual machine debugging.

Note:

  • $thread is uniquely assigned by the debugger for the current context reported by the OS awareness plugin. If no OS awareness plugin is loaded, $thread tracks the current core, $core.

  • $pid is assigned for the debugger for the current context by the OS awareness plugin. If no OS awareness plugin is loaded, $pid tracks the current core, $core.

Non-ConfidentialPDF file icon PDF versionARM DUI0452Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.