7.3 Creating a CMM-style script

DS-5 provides a small subset of CMM-style commands which you can use to create a CMM-style script.

The debugger script file must conform to the following standards:

  • The script file must contain only one command on each line. If necessary, you can add comments using the // tags.
  • The .cmm or .t32 file extension must be used to identify a CMM-style script.

After creating your script, you must use the DS-5 Debugger source command to load and run the script.

The example below shows a typical CMM-style script.

Example 7-1 Sample CMM-style script

// Filename: myScript.cmm
				system.up                     ; Connect to target and device
				data.load.elf "hello.axf"     ; Load image and symbols
				// Setup breakpoints and registers
				break.set main /disable       ; Set breakpoint and immediately disabled
				break.set 0x8048              ; Set breakpoint at specified address
				break.set 0x8060              ; Set breakpoint at specified address
				register.set R0 15            ; Set register R0
				register.set PC main          ; Set PC register to symbol address
				break.enable main             ; Enable breakpoint at specified symbol
				// Run to breakpoint and display required values
				go                            ; Start running device
				var.print "Value is: " myVar  ; Display string and variable value
				print %h r(R0)                ; Display register R0 in hexadecimal
				// Run to breakpoint and print stack
				go                            ; Run to next breakpoint
				var.frame /locals /caller     ; Display all variables and function callers
				// Shutdown commands
				break.delete main             ; Delete breakpoint at address of main()
				break.delete 0x8048           ; Delete breakpoint at address
				break.delete 0x8060           ; Delete breakpoint at specified address
				system.down                   ; Disconnect from target
Non-ConfidentialPDF file icon PDF versionARM DUI0446Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.