Command-Line Debugging Tasks
For example, put tcld.tcl
in the
WINDOWS
directory.
• On a Solaris Workstation, put tcld.tcl
in your home directory.
NOTE
There is no synchronization of debug events in the startup script. Consequently, put the c debug command to the startup script and place these debug commands in another script so they will execute properly: debug
, go
, stop
, kill
, next
, and step
.
8.3 Command-Line Debugging Tasks
This section provides instructions for common command-line debugging tasks.
See the following table for details.
Table 8-2. Common Command-Line Debugging Tasks
Task
Open the Debugger Shell
Use the help command
Enter a command
View debug command hints
Instruction
Select
Windows > Show View >
Others > Debugger Shell.
1. On the Debugger shell command prompt (%>), type help. 2. Press Enter.
1. On the Debugger shell, type a command followed by a space. 2. Type any valid command-line options, separating each with a space. 3. Press
Enter.
Type alias followed by a space
Comments
The Debugger Shell view appears.
The Command List for the CodeWarrior tool appears.
You can use shortcuts instead of complete command names, such as k for kill.
The syntax for the rest of the command appears.
Review previous commands Press Up Arrow and Down Arrow keys
Clear command from the command line Press the Esc key
Stop an executing script Press the Esc key
Toggle between insert/overwrite mode Press the Insert key
Scroll up/ down a page
Scroll left/right one column
Scroll to beginning or end of buffer
Press Page Up or Page Down key
Press Ctrl-Left Arrow or Ctrl-Right Arrow keys
Press Ctrl-Home or Ctrl-End keys
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
220 Freescale Semiconductor, Inc.
8.4 Debugger Shell Command List
Chapter 8 CodeWarrior Command-Line Debugging
This section lists commands that are unique to the CodeWarrior tool.
The list of the commands that can be used in the CodeWarrior Debugger Shell view is as follows:
NOTE
For information on the Tcl built-in commands, visit http:// sourceforge.net/projects/tcl .
Table 8-3. Debugger Shell Command List
about
cd
config
dir
evaluate
fl::checksum
fl::disconnect
fl::image
fl::target
funcs
go
jtagclock
loadsym
mc::go
mc::reset
mc::type
nexti pwd
redirect reset
run
sc::setReset setpicloadaddr
step
switchtarget
wait
alias
change
copy
disassemble
finish
fl::device fl::dump
fl::protect
fl::verify
getIDEpref
help
kill
log
mc::group mc::restart
mem
oneframe
quitIDE
refresh
restart save
sc::getPhysicalAddress
stack
stepi
system
watchpoint
bp
cls
debug
display
fl::blankcheck
fl::diagnose
fl::erase
fl::secure
fl::write
getpid
history
launch
mc::config
mc::kill
mc::stop
next
protocol
radix
reg
restore
sc::setMaxAccessLength
setpc
status
stop
var
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
221
Debugger Shell Command List
8.4.1 about
Lists the version information.
Syntax
about
8.4.2 alias
Creates an alias for a debug command, removes such an alias, or lists all current aliases.
Syntax
alias [<alias> [<command>]]
Parameters
alias
Lists current aliases.
Examples
Table 8-4
lists and defines examples of the alias command.
Table 8-4. alias Command-Line Debugger Command - Examples
alias alias ls dir alias ls
Command Description
Lists current aliases.
Issue the dir command when ls is typed.
Remove the alias ls.
8.4.3 bp
Sets a breakpoint, removes a breakpoint, or lists the current breakpoints.
Syntax
bp [-{hw|sw|auto}] {<func>|[<ms>:]<addr>|<file> <line> [<column>]}
bp all|#<id>|<func>|<addr> off|enable|disable
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
222 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Examples
Table 8-5
lists and defines examples of the bp command.
Table 8-5. bp Command-Line Debugger Command - Examples
Command
bp bp -hw fn bp -autofile.cpp 101 1 bp fn off bp 10343 bp #4 off bp #4 disable bp #4 cond x == 3 bp #4 cond Hit Count % 3 == 0
Description
Lists all breakpoints.
Set hardware breakpoint at function fn().
Set an auto breakpoint on file file.cpp at line 101, column 1.
Remove the breakpoint at function fn().
Set a breakpoint at memory address 10343.
Remove the breakpoint number 4.
Disable the breakpoint number 4.
Set the condition for breakpoint number 4 to fire only if x == 3.
Break every third time. Hit Count corresponds to the breakpoint property of the same name.
8.4.4 cd
Changes to a different directory or lists the current directory.
Pressing the Tab key completes the directory name automatically.
Syntax
cd [<path>]
Parameter
path
Directory pathname; accepts asterisks and wildcards.
Examples
Table 8-6
lists and defines examples of the cd command.
Table 8-6. cd Command-Line Debugger Command-Examples
cd cd c: cd d:/mw/0622/ test cd c:p*s
Command Description
Lists current directory.
Changes to the C: drive root directory.
Changes to the specified D: drive directory
Changes to any C: drive directory whose name starts with p and ends with s.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
223
Debugger Shell Command List
8.4.5 change
Changes the contents of register, memory location, block of registers, or memory locations.
Syntax
change <addr-spec> [<range>] [-s|-ns] [%<conv>] <value>
change <addr-spec>{..<addr>|#<n>} [<range>] [-s|-ns] [%<conv>] <value>
change <reg-spec> [<n>] [-s|-ns] [%<conv>] <value>
change <reg-spec>{..<reg>|#<n>} [-s|-ns] [%<conv>] <value>
change <var-spec> [-s|-ns] [%<conv>] <value>
change v <var> [-s|-ns] [%<conv>] <value>
Parameter
<addr-spec> [<ms>:]<addr>
On architectures supporting multiple memory spaces, specifies the memory space in which <addr> is to be found.
See the help for the option
-ms
of display or mem for more information on memory spaces. If unspecified, the setting config MemIdentifier is used.
<addr>
Target address in hex format.
<count>
Number of memory cells.
x<cell-size>
Memory is displayed in units called cells, where each cell consists of <cell-size> bytes. If unspecified, the setting config MemWidth is used.
h<access-size>
Memory is accessed with a hardware access size of <access-size> bytes.
If unspecified, the setting config MemWidth is used.
%<conv>
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
224 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Specifies the type of the data. Possible values for <conv> are given below. The default conversion is set by the radix command for memory and registers and by the config var command for variables.
• %x Hexadecimal
• %d Signed decimal
• %u Unsigned decimal
• %f Floating point
NOTE
You can not access array elements in Tcl except through array
and set
commands. Therefore, to use the change
or var command on an array element, enclose it in curly braces
{}
.
Examples
The examples assume the following settings:
• radix x
• config MemIdentifier 0
• config MemWidth 32
• config MemAccess 32
• config MemSwap off
Table 8-7
lists and defines Memory examples of the change command.
Table 8-7. change Command-Line Debugger Command-Memory Examples
change 10000 10 change 1:10000 20 change 10000 16 20
Command
change 10000 16x1h8 31 change 10000 -s %d 200 change {x[1]} 10 change {t1.x} 2
Description
Change memory range 0x10000-3 to 0x10 (because radix is hex).
Change memory range 0x10000-3, memory space 1, to
0x20.
Change each of 16 cells in the memory range 0x10000-3f to 0x20.
Change each of 16, 1-byte cells to 0x31, using a hardware access size of 8-bytes per write.
Change memory range 0x10000-3 to c8000000.
Change the second element in the array x to the value 10.
Change the value of the variable x in the structure t1 to 2.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
225
Debugger Shell Command List
Table 8-8
lists and defines Register examples of the change command.
Table 8-8. change Command-Line Debugger Command-Register Examples
Command
change R1 123 change R1..R5 5432 change "General Purpose Registers/R1" 100
Description
Change register R1 to 0x123.
Change registers R1 through R5 to 0x5432.
Change register R1 in the General Purpose Register group to
0x100.
Table 8-9
lists and defines Variable examples of the change command.
Table 8-9. change Command-Line Debugger Command-Variable Examples
change myVar 10
Command Description
Change the value of variable myVar to 16 (0x10)
8.4.6 cls
Clears the command line debugger window.
Syntax
cls
8.4.7 config
Lists current configuration information.
Provides the name of the default project or build target, or configures:
• command-line debugger window colors.
• command-line debugger window scrolling size.
• command-line debugger window mode.
• Default build target
• Hexadecimal prefix
• Memory identifier
• Processor name
• Subprocessor name
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
226 Freescale Semiconductor, Inc.
Syntax
conf[ig] [ c[olor] [r | m | c | s | e | n]
text_color [background_color] |
m[ode] [ dsp | tcl | auto] |
s[croll] number_of_lines |
h[exprefix] hexadecimal_prefix |
mem[identifier] memory_identifier |
p[rocessor] processor_name [subprocessor_name] ]
Parameter
Chapter 8 CodeWarrior Command-Line Debugging
color text indicators - r (registers), m (memory), c (commands), s (script), e (errors), or n (normal)
text_color
Text color values for red, green, and blue, each from 0 through 255.
background_color
Background color values for red, green, and blue, each from 0 through 255.
mode
Command-name conflict resolution mode:
• dsp: use command-line debug commands
• tcl: use tcl commands
• auto: resolve automatically
number_of_lines
Number of lines to scroll.
hexadecimal_prefix
Prefix for display of hexadecimal values.
memory_identifier
Memory identifier.
processor_name
Name or identifier of target processor.
subprocessor_name
Name or identifier of target subprocessor.
target_name
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
227
Debugger Shell Command List
Name of build target.
Examples
Table 8-10 lists and defines examples of the config command.
Table 8-10. config Command-Line Debugger Command-Examples
Command
config config c e $ff $0 $0 config c r $0 $0 $0 $ff $ff $ff config m dsp config hexprefix 0x config memidentifier m config processor 8101 config project config target config target debug release x86
Description
Lists current configuration information.
Sets error text to red.
Sets register display to black, on a white background.
Sets clash resolution to dsp mode.
Specifies 0x prefix for hexadecimal values.
Sets memory identifier to m.
Sets processor to 8101.
Lists default-project name.
Lists default build-target name.
Changes default build-target name to debug release x86.
8.4.8 copy
Copies contents of a memory address or address block to another memory location.
Syntax
copy [<ms>:]<addr>[..<addr>|#<bytes>] [<ms>:]<addr>
Parameter
<addr>
One of these memory-address specifications:
• A single address
• First address of the destination memory block.
Examples
Table 8-11 lists and defines examples of the copy command.
Table 8-11. copy Command-Line Debugger Command-Examples
copy 00..1f 30
Command Description
Copy memory addresses 00 through 1f to address 30.
Table continues on the next page...
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
228 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Table 8-11. copy Command-Line Debugger Command-Examples (continued)
copy 20#10 50
Command Description
Copy 10 memory locations beginning at memory location 20 to memory beginning at location 50.
8.4.9 debug
Launches a debug session.
Syntax
debug [<index> | <debug-config-name>]
Examples
Table 8-12 lists and defines examples of the debug command.
Table 8-12. debug Command-Line Debugger Command-Examples
debug debug 3
Command
debug {My Launch Config}
Description
Start debugging using the default launch configuration, which is the last debugged configuration if one exists and index 0 otherwise.
Start debugging using the launch configuration at index 3.
Type launch for the current set of launch configurations.
Start debugging using the launch configuration named My
Launch Config. Type launch for the current set of launch configurations.
8.4.10 dir
Lists directory contents.
Syntax
dir [path|files]
Examples
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
229
Debugger Shell Command List
Table 8-13 lists and defines examples of the dir command.
dir di *.txt
dir c:/tmp dir /ad
Table 8-13. dir Command-Line Debugger Command-Examples
Command Description
Lists all files of the current directory.
Lists all current-directory files that have the .txt file name extension.
Lists all files in the tmp directory on the C: drive.
Lists only the subdirectories of the current directory.
8.4.11 disassemble
Disassembles the instructions of the specified memory block.
Syntax
disassemble
disassemble pc|[<ms>:]<addr> [<count>]
disassemble reset
disassemble [<ms>:]<a1>{..<a2>|#<n>}
Parameter
[none]
With no options, the next block of instructions is listed. After a target stop event, the next block starts at the PC.
[<ms>:]<addr>
Target address in hex. On targets with multiple memory spaces, a memory space id can be specified.
pc
The current program counter.
<count>
Number of instructions to be listed.
reset
Reset the next block to the PC and the instruction count to one screen.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
230 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
<a1>{..<a2>|#<n>}
Specifies a range of memory either by two endpoints, <a1> and <a2>, or by a startpoint and a count, <a1> and <n>.
Examples
Table 8-14 lists and defines examples of the disassemble command.
Table 8-14. disassemble Command-Line Debugger Command-Examples
disassemble disassemble reset disassemble pc disassemble pc 4
Command
disassemble 1000 disassemble p:1000 4
Description
Lists the next block of instructions.
Reset the next block to the PC and the instruction count to one screenful.
Lists instructions starting at the PC.
Lists 4 instructions starting at the PC. Sets the instruction count to 4.
Lists instructions starting at address 0x1000.
Lists 4 instructions from memory space p, address 1000. Sets the instruction count to 4.
8.4.12 display
Lists the contents of a register or memory location.
This command lists all register sets of a target, adds register sets, registers, or memory locations, or removes register sets, registers, or memory locations.
Syntax
display <addr-spec> [<range>] [-s|-ns] [%<conv>] [-np]
display -ms
display <addr-spec>{..<addr>|#<n>} [<range>] [-s|-ns] [%<conv>] [-np]
display <reg-spec> [<n>] [-{d|nr|nv|np} ...] [-s|-ns] [%<conv>]
display <reg-spec>{..<reg>|#<n>} [-{d|nr|nv|np} ...] [-s|-ns] [%<conv>]
display all|r:|nr: [-{d|nr|nv|np} ...] [-s|-ns] [%<conv>]
display [-]regset
display <var-spec> [-np] [-s|-ns] [%<conv>]
display v: [-np] [-s|-ns] [%<conv>]
Parameter
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
231
Debugger Shell Command List
<ms>
On architectures supporting multiple memory spaces, specifies the memory space in which
<addr>
is to be found.
<addr>
Target address in hex.
<range>
[<count>][x<cell-size>][h<access-size>] | [<count>] [{8,16,32,64}bit].
<count>
Number of memory cells.
x<cell-size>
Memory is displayed in units called cells, where each cell consists of <cell-size> bytes. If unspecified, the setting config MemWidth is used.
{8,16,32,64}bit
Sets both
<cell-size>
and
<access-size>
.
Examples
The examples assume the following settings:
• radix x
• config MemIdentifier 0
• config MemWidth 32
• config MemAccess 32
• config MemSwap off
Table 8-15 lists and defines examples of the display command.
Table 8-15. display Command-Line Debugger Command-Examples
display 10000 display 1:10000 display 10000 8bit display 10000 -np display 10000 -s display 10000 %d
Command
display 10000 16 display 10000 16x1h8
Description
Display memory range 0x10000-3 as one cell.
Display memory range 0x10000-3, memory space 1, as one cell.
Display memory range 0x10000-3f as 16 cells.
Display 16, 1-byte cells, with a hardware access size of 8bytes per read.
Display one byte, with a hardware access size of one byte.
Return one cell, but don't print it to the Command Window.
Display one cell with the data endian-swapped.
Display one cell in decimal format.
Table continues on the next page...
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
232 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Table 8-15. display Command-Line Debugger Command-Examples (continued)
display -ms
Command Description
Display the available memory spaces, if any.
display -regset display R1
List all the available register sets on the target chip.
Display the value of register R1.
display "General Purpose Registers/R1" display R1 -d
Display the value of register R1 in the General Purpose
Register group.
Display detailed "data book" contents of R1, including bitfields and definitions.
display "nr:General Purpose Registers/R1" 25
Beginning with register R1, display the next 25 registers.
Register groups are not recursively searched.
8.4.13 evaluate
Lists variable or expression.
Syntax
evaluate [#<format>] [-l] [<var|expr>]
Parameter
<format>
Output format and possible values:
#-, #Default
#d, #Signed
#u, #Unsigned
#h, #x, #Hex
#c, #Char
#s, #CString
#p, #PascalString
#f, #Float
#e, #Enum
#i, #Fixed
#o, #w, #Unicode
#b, #Binary
<none>, #Fract
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
233
Debugger Shell Command List
<none>, #Boolean
<none>, #SignedFixed
Examples
Table 8-16 lists and defines examples of the evaluate command.
Table 8-16. evaluate Command-Line Debugger Command-Examples
Command
evaluate evaluate i evaluate #b i evaluate -l 10 evaluate -l myfile.c,10 evaluate -l +10
Description
List the types for all the variables in current and global stack.
Return the value of variable 'i'
Return the value of variable 'i' formatted in binary
Return the address for line 10 in the current file
Return the address for line 10 in file myfile.c
Return the address to an offset of 10 lines starting from the current line
8.4.14 finish
Executes until the current function returns.
Syntax
finish
8.4.15 fl::blankcheck
Tests that the flash device is in the blank state.
Syntax
fl::blankcheck
8.4.16 fl::checksum
Calculates a checksum.
Syntax
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
234 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
fl::checksum
8.4.17 fl::device
Defines the flash device.
Syntax
fl::device
8.4.18 fl::diagnose
Dumps flash information like ID, sector map, sector factory, protect status.
Syntax
fl::diagnose [full]
Parameter
full
Dumps sector status (programmed/erased). This could take a few minutes for large flashes
Remarks
Use fl::device
command prior to this command in order to set the flash device.
8.4.19 fl::disconnect
Closes the connection to the target.
Syntax
fl::disconnect
8.4.20 fl::dump
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
235
Debugger Shell Command List
Dumps the content of entire flash.
Syntax
fl::dump [all | -range start_addr end_addr] -o <file>
Parameter
-all
Dumps content of entire flash.
-range <start_addr> <end_addr>
Sets the range of flash region to be dumped.
-t <type>
Sets the type of flash region ("Motorola S-Record Format" or "Binary/Raw Format") to be dumped .
-o <file>
Dumps the flash to the specified file.
8.4.21 fl::erase
Erases the flash device.
Syntax
fl::erase
8.4.22 fl::image
Defines the flash image settings.
Syntax
fl::image
8.4.23 fl::protect
Protects the sectors.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
236 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Syntax
fl::protect [on | off]
Parameter
on | off
Enable or disable protection of sectors.
8.4.24 fl::secure
Secures the device
Syntax
fl::secure [on | off] [password <pass>]
Parameter
on | off
Secure or unsecure device.
password <pass>
Password used to secure the device.
8.4.25 fl::target
Defines the target configuration settings.
Syntax
fl::target
8.4.26 fl::verify
Verifies the flash device.
Syntax
fl::verify
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
237
Debugger Shell Command List
8.4.27 fl::write
Writes the flash device.
Syntax
fl::write
8.4.28 funcs
Displays information about functions.
Syntax
funcs [-all] <file> <line>
Parameter
[-all]
Displays information about the functions using all debug contexts.
<file>
Specifies the file name.
<line>
Specifies the line number.
Examples
Table 8-17 lists and defines examples of the funcs command.
Table 8-17. funcs Command-Line Debugger Command-Examples
funcs main.c 100
Command
funcs -all main.c 100
Description
Display information about the functions containing line 100 in file main.c, using the active debug context
Display information about the functions containing line 100 in file main.c, using all debug contexts.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
238 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
8.4.29 getIDEpref
The command displays the value of the launch configuration attribute associated with the user-provided key;
<attribute_key>
and
<attribute_type>
are mandatory parameters.
Syntax
getIDEpref <attribute_key> <attribute_type>
Parameter
<attribute_type> = [bool | int | str | strlist]
8.4.30 getpid
List the ID of the process being debugged.
Syntax
getpid
8.4.31 go
Starts to debug your program from the current instruction.
Syntax
go [nowait | <timeout_s>]
Parameter
<none>
Run the default thread. The command may wait for a thread break event before returning, depending on the settings config runControlSync and config autoThreadSwitch.
nowait
Return immediately without waiting for a thread break event.
<timeout_s>
Maximum number of seconds to wait for a thread break event. Can be set to nowait.
Examples
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
239
Debugger Shell Command List
Table 8-18 lists and defines examples of the go command.
go go nowait go 5
Table 8-18. go Command-Line Debugger Command-Examples
Command Description
Run the default thread.
Run the default thread without waiting for a thread break event.
Run the default thread. If config runControlSync is enabled, then the command will wait for a thread break event for a maximum of 5 seconds.
8.4.32 help
Lists debug command help in the command-line debugger window.
Syntax
help [-sort | -tree | <cmd>]
Parameter
command
Name or short-cut name of a command.
Examples
Table 8-19 lists and defines examples of the help command.
Table 8-19. help Command-Line Debugger Command-Examples
help help b
Command Description
Lists all debug commands.
Lists help information for the break command.
8.4.33 history
Lists the history of the commands entered during the current debug session.
Syntax
history
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
240 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
8.4.34 jtagclock
Reads or updates the current JTAG clock speed.
Syntax
jtagclock <chain-position> [<speed-in-kHz>]
Parameter
<chain-position>
Specifies the chain position.
<speed-in-kHz>
Specifies the speed in kilo hertz.
Examples
Table 8-20 lists and defines examples of the help command.
Table 8-20. jtagclock Command-Line Debugger Command-Examples
jtagclock 3 jtagclock 3 1000
Command Description
Read the current jtag clock speed for chain position 3.
update the current jtag clock speed to 1000 kHz for chain position 3.
8.4.35 kill
Stops one or all current debug sessions.
Syntax
kill [<index> ...]
Parameter
all
Specifier for all debug sessions.
Examples
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
241
Debugger Shell Command List
Table 8-21 lists and defines examples of the help command.
kill kill 0 1
Table 8-21. kill Command-Line Debugger Command-Examples
Command Description
Kills the debug session for the current process.
Kills debug sessions 0 and 1.
8.4.36 launch
Lists the launch configurations.
Syntax
launch
8.4.37 loadsym
Load a symbolic file.
Syntax
loadsym
8.4.38 log
Logs the commands or lists entries of a debug session.
If issued with no parameters, the command lists all open log files.
Syntax
log c|s <filename>
log off [c|s] [all]
log
Parameter
c
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
242 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Command specifier.
s
Lists entry specifier.
<filename>
Name of a log file.
Examples
Table 8-22 lists and defines examples of the log command.
Table 8-22. log Command-Line Debugger Command-Examples
log log s session.log
log off c log off log off all
Command Description
Lists currently opened log files.
Log all display entries to file session.log.
Close current command log file.
Close current command and log file.
Close all log files.
8.4.39 mc::config
List or edit multicore group options.
Syntax
mc::config
8.4.40 mc::go
Resumes multiple cores.
Syntax
mc::go
Examples
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
243
Debugger Shell Command List
Table 8-23 lists and defines examples of the mc::go command.
Table 8-23. mc::go Command-Line Debugger Command-Examples
Command
debug {SBL1_FWK_core0_ADS}debug
{SBL1_FWK_core1_ADS}debug
{SBL1_FWK_core2_ADS}debug
{SBL1_FWK_core3_ADS}debug
{SBL1_FWK_core4_ADS}debug
{SBL1_FWK_core5_ADS}mc::go
Description
Sample usage of mc::go command.
8.4.41 mc::group
List or edit multicore groups.
Syntax
mc::group
8.4.42 mc::kill
Terminates multiple cores.
Syntax
mc::kill
8.4.43 mc::reset
Resets multiple cores.
Syntax
mc::reset
8.4.44 mc::restart
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
244 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Restarts multiple cores.
Syntax
mc::restart
8.4.45 mc::stop
Suspend multiple cores.
Syntax
mc::stop
8.4.46 mc::type
List or edit system types.
Syntax
mc::type
8.4.47 mem
Read and write one or more adjacent "cells" of memory, where a cell is defined as a contiguous block of bytes.
The cell size is determined by the <cell-size> parameter or by the using
MemWidth attribute of the config
command.
Syntax
Read memory
mem <addr-spec> [<range>] [-s|-ns] [%<conv>] [-np]
Write memory
mem <addr-spec> [<range>] [-s|-ns] [%<conv>] =<value>
Parameter
[none]
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
245
Debugger Shell Command List
With no options, the next block of memory is read.
<addr-spec> [<ms>:]<addr>
<ms>
On architectures supporting multiple memory spaces, specifies the memory space in which <addr> is to be found. See the help for the option -ms of display or mem for more information on memory spaces. If unspecified, the setting " config MemIdentifier
" is used.
<addr>
Target address in hex.
<range> [<count>][x<cell-size>][h<access-size>] | [<count>]
[{8,16,32,64}bit]
<count>
Number of memory cells.
x<cell-size>
Memory is displayed in units called cells, where each cell consists of <cell-size> bytes. If unspecified, the setting " config MemWidth
" is used.
h<access-size>
Memory is accessed with a hardware access size of <access-size> bytes. If unspecified, the setting " config MemAccess
" is used.
{8,16,32,64}bit
Sets both
<cell-size>
and
<access-size>
.
-np
Don't print anything to the display, only return the data.
-ms
On architectures supporting multiple memory spaces, displays the list of available memory spaces including a mnemonic and/or an integer index which may be used when specifying a target address.
-s|-ns
Specifies whether each value is to be swapped. For memory, specifies whether each cell is to be swapped. With a setting of
-ns
, target memory is written in order from lowest to highest byte address. Otherwise, each cell is endian swapped. If unspecified, the setting config MemSwap
is used.
%<conv>
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
246 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Specifies the type of the data. Possible values for
<conv>
are given below. The default conversion is set by the radix command for memory and registers and by the config var command for variables.
%x Hexadecimal.
%d Signed decimal.
%u Unsigned decimal.
%f Floating point.
%[E<n>]F Fixed or Fractional. The range of a fixed
point value depends on the (fixed) location
of the decimal point. The default location is
set by the config command option
"MemFixedIntBits".
%s Ascii.
Examples
Table 8-24 lists and defines examples of the mem command.
Table 8-24. mem Command-Line Debugger Command-Examples
mem x:1000 4 mem m:1000 16bit 4
Command
mem m:1000 16bit 4 %d =48
Description
Read program memory starting from address 1000 for four
32-bit cells.
Read data memory starting from address 1000 for four 16-bit cells.
Starting at address 1000, write the decimal value 48 into data memory for four 16-bit cells
8.4.48 next
Runs to next source line or assembly instruction in current frame.
Syntax
next
Remarks
If you execute the next command interactively, the command returns immediately, and target-program execution starts. Then you can wait for execution to stop (for example, due to a breakpoint) or type the stop command.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
247
Debugger Shell Command List
If you execute the next command in a script, the command-line debugger polls until the debugger stops (for example, due to a breakpoint). Then the command line debugger executes the next command in the script. If this polling continues indefinitely because debugging does not stop, press the ESC key to stop the script.
8.4.49 nexti
Executes over function calls, if any, to the next assembly instruction.
Syntax
nexti
8.4.50 oneframe
Query or set the one-frame stack crawl mode for the current thread.
Syntax
oneframe
8.4.51 protocol
Executes a protocol plugin command (internal).
Syntax
protocol
8.4.52 pwd
Lists current working directory.
Syntax
pwd
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
248 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
8.4.53 quitIDE
Quits the IDE.
Syntax
quitIDE
8.4.54 radix
Lists or changes the default input radix (number base) for command entries, registers and memory locations.
Entering this command without any parameter values lists the current default radix.
Syntax
radix [x|d|u|b|f|h]
Parameter
x
Hexadecimal
d
Decimal
u
Unsigned decimal
b
Binary
f
Fractional
h
Hexadecimal
Examples
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
249
Debugger Shell Command List
Table 8-25 lists and defines examples of the radix command.
radix radix d radix x
Table 8-25. radix Command-Line Debugger Command-Examples
Command Description
Lists the current setting.
Change the setting to decimal.
Change the setting to hexadecimal.
8.4.55 redirect
Redirects I/O streams of the current target process.
Syntax
redirect
8.4.56 refresh
Discard all cached target data and refresh views.
Syntax
refresh
8.4.57 reg
Read and write registers.
Syntax
reg
8.4.58 reset
Reset the target hardware.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
250 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Syntax
reset
8.4.59 restart
Restarts the current debug session.
Syntax
restart
8.4.60 restore
Write file contents to memory.
Syntax
restore
8.4.61 run
Launch a process.
Syntax
run
8.4.62 save
Saves the contents of memory locations to a binary file or a text file containing hexadecimal values.
Syntax
save -h|-b [<ms>:]<addr>... <filename> [-a|-o] [8bit|16bit|32bit|64bit]
Parameter
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
251
Debugger Shell Command List
-h|-b
Sets the output file format to hex or binary. For hex format, the address is also saved so that the contents can easily be restored with the "restore" command.
[<ms>:]<addr>
Address to read from. For architectures with multiple memory spaces, a memory space id may be specified.
-a
Append specifier. Instructs the command-line debugger to append the saved memory contents to the current contents of the specified file.
-o
Overwrite specifier: tells the debugger to overwrite any existing contents of the specified file.
Examples
Table 8-26 lists and defines examples of the save command.
Table 8-26. save Command-Line Debugger Command-Examples
Command
set addressBlock1 "p:10..`31"set addressBlock2 "p:10000#20"save -h
$addressBlock1 $addressBlock2hexfile -a set addressBlock1 "p:10..`31"set addressBlock2 "p:10000#20"save -b
$addressBlock1 $addressBlock2binfile -o
Description
Dumps contents of two memory blocks to the text file hexfile.lod (in append mode).
Dumps contents of two memory blocks to the binary file binfile.lod (in overwrite mode).
8.4.63 sc::setMaxAccessLength
Sets the maximum amount of data accessible in one target operation.
Syntax
sc::setMaxAccessLength
Example
The following command sets a maximum of 1000 elements that can be read or written:
sc::setMaxAccessLength 1000
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
252 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
8.4.64 sc::setReset
Sets the reset mode.
Syntax
sc::setReset <mode>
Parameter
<mode>
Can be
ToUser
or
ToDebug
.
ToUser
sets the reset to run out of reset. For debug mode after reset, use
ToDebug
parameter.
8.4.65 sc::getPhysicalAddress
Returns the physical address that corresponds to the specified virtual address.
Use mem –ms
command, to view the list of supported memory spaces. For more
information, refer to the mem
command.
Syntax
sc::getPhysicalAddress <mem_space>:<virtual_address>
8.4.66 setpc
Set the value of the program counter register.
Syntax
setpc
8.4.67 setpicloadaddr
Indicate where a PIC executable is loaded.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
253
Debugger Shell Command List
Syntax
setpicloadaddr
8.4.68 stack
Print the call stack.
Syntax
stack
8.4.69 status
Lists the debug status of all existing active targets.
Syntax
status
8.4.70 step
Steps through a program, automatically executing the display command.
Syntax
step [asm|src] [into|over|out]
step [nve|nxt|fwd|end|aft]
Parameter
asm|src
Controls whether the step is performed at the assembly instruction level or the source code level.
into|over|out
Controls the type of step operation. If unspecified, into is used.
nve
Step non optimized action.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
254 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
nxt
Step next action.
fwd
Step forward action.
end
Step end of statement action.
aft
Step end all previous action.
Examples
Table 8-27 lists and defines examples of the step command.
Table 8-27. step Command-Line Debugger Command-Examples
step step over step out step asm
Command Description
Step into the current source or assembly line.
Step over the current source or assembly line.
Step out of a function.
Step over a single assembly instruction.
8.4.71 stepi
Execute to the next assembly instruction.
Syntax
stepi
8.4.72 stop
Stops a running program (started by a go, step, or next command).
Syntax
stop
Examples
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
255
Debugger Shell Command List
Table 8-28 lists and defines examples of the stop command.
stop
Table 8-28. stop Command-Line Debugger Command-Examples
Command Description
Using it after command go/step out/next, this will stop the target program.
8.4.73 switchtarget
Chooses a thread for subsequent commands.
Syntax
switchtarget [<index> | -cur | -ResetIndex]
Parameter
index
Session Index number.
Examples
Table 8-29 lists and defines examples of the switchtarget command.
Table 8-29. switchtarget Command-Line Debugger Command-Examples
Command
switchtarget switchtarget 0 switchtarget -cur switchtarget -ResetIndex
Description
list currently available debug sessions.
choose the thread with index 0 list the index of the current thread.
reset the index counter to 0, not valid while debugging.
8.4.74 system
execute system command.
Syntax
system [command]
Parameter
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
256 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
command
Any system command that does not use a full screen display.
Examples
Table 8-30 lists and defines examples of the system command.
Table 8-30. system Command-Line Debugger Command-Examples
system del *.tmp
Command Description
Delete from the current directory all files that have the .tmp
filename extension.
8.4.75 var
Read and write variables or C-expressions.
Syntax
Display variable
var
var <var-spec> [-np] [-s|-ns] [%<conv>]
var v: [-np] [-s|-ns] [%<conv>]
Modify variable
var <var-spec> [-s|-ns] [%<conv>] =<value>
Parameter
[none]
With no options, this is equivalent to using var v:
.
<var-spec> [v:]<var>
v:
If this option appears with no
<var>
following it, then all variables pertinent to the current scope are printed.
<var>
Symbolic name of the variable to print. Can be a C expression as well.
-np
Don't print anything to the display, only return the data.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
257
Debugger Shell Command List
-s|-ns
Specifies whether each value is to be swapped. For memory, specifies whether each cell is to be swapped. With a setting of
-ns
, target memory is written in order from lowest to highest byte address. Otherwise, each cell is endian swapped. If unspecified, the setting config MemSwap
is used.
%<conv>
Specifies the type of the data. Possible values for
<conv>
are given below. The default conversion is set by the radix command for memory and registers and by the config var command for variables.
%x Hexadecimal.
%d Signed decimal.
%u Unsigned decimal.
%f Floating point.
%[E<n>]F Fixed or Fractional. The range of a fixed
point value depends on the (fixed) location
of the decimal point. The default location is
set by the config command option
"MemFixedIntBits".
%s Ascii.
Examples
Table 8-31 lists and defines examples of the var command.
Table 8-31. var Command-Line Debugger Command-Examples
var flag =0 var {x[2]} =11 var {t1.y} =3
Command Description
Set the value of the variable flag to 0.
Set the value of the third element in the array x to 11.
Set the value of the variable y in the structure t1 to 3.
8.4.76 wait
Tells the debugger to wait for a specified amount of time, or until you press the space bar.
Syntax
wait <time-ms>
Parameter
time-ms
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
258 Freescale Semiconductor, Inc.
Chapter 8 CodeWarrior Command-Line Debugging
Number of milliseconds to wait.
Examples
Table 8-32 lists and defines examples of the wait command.
wait wait 2000
Table 8-32. wait Command-Line Debugger Command-Examples
Command Description
Debugger waits until you press the space bar.
Wait for 2 seconds.
8.4.77 watchpoint
Sets, removes, disables, enables or list watchpoints. You can also set condition on watchpoint.
Syntax
watchpoint
watchpoint [-{r|w|rw}] {<var>|[<ms>:]<addr> <length>}
watchpoint all|#<id>|<var>|[<ms>:]<addr> off|enable|disable
watchpoint #<id> cond <c-expr>
Examples
Table 8-33 lists and defines examples of the watchpoint command.
Table 8-33. watchpoint Command-Line Debugger Command-Examples
Command
watchpoint watchpoint gData watchpoint -r gData watchpoint all off watchpoint #4 disable watchpoint 10343 4
Description
Display all watchpoints.
Set read-write (the default) watchpoint on variable gData.
Set read-only watchpoint on variable gData.
Remove all watchpoints.
Disable watchpoint number 4.
Set a watchpoint at memory address 10343 of length 4.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
259
Debugger Shell Command List
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
260 Freescale Semiconductor, Inc.