13 COMMAND REFERENCE

This chapter contains a summary of all CrossView Pro commands, followed by a complete description of each command.

This chapter contains the following sections:

Conventions Used in this Chapter

Commands: Summary

Viewing Commands

Data Monitoring

Data Analysis

Execution Control Commands

Record & Playback

Macros

Input/Output Simulation

File System Simulation

Target System Control

Save and Restore Target State

Help Commands

Search Commands

Commands: Detailed Descriptions

13.1 Conventions Used in this Chapter

Each CrossView Pro command has a particular syntax, that is, the form it must take for CrossView Pro to recognize it. To help you learn the syntax of each command, this chapter uses a special notation to describe the syntax of each command. Consider the following example:

ios_read {stream | "file"},address,number_of_maus[,x]

Command items in bold font are the actual command keywords typed from the keyboard. In the example above, ios_read is in bold font since you must type it exactly as shown.

Items in italics are names of the command part. Here stream is in italics, since you must substitute the appropriate value for stream. The Description section for each command describes what kinds of values should be substituted for italicized terms.

Expressions in [brackets] are optional items you may include in a particular command. In this example ,x is not necessary for the ios_read command to work. Usually if you omit an optional expression, CrossView Pro uses a default value.

The | symbol means or. For instance, {stream | "file"} means a stream number or a filename between double-quotes (but not both) can be used in the command.

13.2 Commands: Summary

13.2.1 Viewing Commands

^[format] Display contents of preceding memory location.

exp Print value of expression using /n format.

exp @ format Print address of expression exp in format format.

exp/format Print value of expression exp in format format.

line Move viewing position to line line.

number ct Display a source-level trace corresponding to the last number of machine instructions executed. This command is not available for all execution environments.

number ct i Display a disassembled assembly-level trace corresponding to the last number of machine instructions executed. This command is not available for all execution environments.

number ct r Display a raw trace corresponding to the last number of trace frames. This command is not available for all execution environments.

e [func | file]
Enter function func or file file or view current viewing position.

stack e Enter function using stack address.

[addr] ei View current viewing position or view instruction at address addr.

f ["printf-style-format"]
Change default address display format.

gus {on|off}
Suppress or reactivate CrossView Pro window updating.

L Synchronize the viewing position with the execution position. Print current file, function and line number.

l {a|b|d|f|g|k|l|L|m|p|r| s|S} [string]
List assertions, breakpoints, directories, files, globals, kernel state data, labels (on module scope), all Labels, memory map (of application code sections), procedures, registers, special variables, Symbol tables. If given, only those starting with string.

l [func] List all parameters and locals of function func. Without a function, this command lists all parameters and locals of the current function in view.

l stack List all parameters and locals of function at depth stack.

nC Move viewing position to next covered line.

nU Move viewing position to next uncovered line.

opt [option [= value]]
List or set option value. Without an argument, list all option values.

[line] P [exp] Print exp lines of source starting at line line, include machine addresses.

[line] p [exp] Print exp lines of source starting at line line.

pC Move viewing position to previous covered line.

pU Move viewing position to previous uncovered line.

[exp] T Trace the stack for exp number of levels, list local variables.

[exp] t Trace the stack for exp number of levels, printing active functions and parameters passed.

td Disable tracing.

te Enable tracing.

13.2.2 Data Monitoring

cd Disable, turn off, gathering of coverage data.

ce Enable, turn on, gathering of coverage data.

covinfo [[all | module_or_function_name][,filename]]
List coverage info.

cproinfo [all[,filename] | {add | remove } function]
List cumulative profiling info or add or remove functions from the list of profiled functions.

dis address [, {address|#count} [,i]]
Disassemble a range of memory.

dump address [, [address|#count] [, [style [width]] [, filename [,a]]]
Dump a memory range.

M Display list of monitored expressions in the Command window.

m exp Monitor the expression exp.

num m d Remove monitored expression labeled num.

addr_start mcp addr_end , addr_dest
Memory copy.

addr mF exp[,exp]...
Single fill memory address addr with expressions.

addr_start mf addr_end , exp[,exp]...
Fill memory address range with expressions and repeat the pattern until the end address of the memory region is reached.

addr_start ms addr_end , exp[,exp]...
Search memory address range for a given pattern.

pd Disable, turn off, profiling.

pe Enable, turn on, profiling.

proinfo [[all | module_or_function_name][,filename]]
List profiling info.

13.2.3 Data Analysis

bufa target_buffer_name,added_buffer_name[,size_limit]
Add the contents of buffer added_buffer_name to buffer target_buffer_name.

bufd buffer_name
Discard the specified buffer.

graph "window","script "[,arg]...
Create Data Analysis window and execute CXL script.

graphm "window","script "[,arg]...
Set the representation script for the window specified.

graphmn "window","script "[,arg]...
Similar to the graphm command, but without an update of the graph window.

graphp "window",left_top_x,left_top_y,width,height
Position the named window at the specified screen coordinates.

graph_add_update "window",command
Add command to the sequence of update commands for the specified window.

graph_clear_updates "window"
Clear the update commands associated with the specified window.

graph_close "window"
Close the specified window.

graph_debug expression
Enable the "graphical data window debugging mode", showing all communication between the scripts and the windows in the command window.

memget expr,count ,buffername
Retrieve symbolically specified data from the target system and store the data in the acquisition buffer.

rawmemget address,type,count,buffername [ ,interleave]
Retrieve data from the target system and store the data in the acquisition buffer.

update "window"
Update the window specified.

13.2.4 Execution Control Commands

A [a|s] Toggle state of assertion mechanism.

a cmds Create a new assertion with the command list cmds.

exp a {a|d|s}
Activate, delete, suspend assertion exp.

B List all breakpoints.

[line] b [cmds]
Set breakpoint at source line line, and associate command list cmds with breakpoint.

[stack] bB [cmds]
Set temporary breakpoint at beginning of function at stack level stack and associate command list cmds.

[stack] bb [cmds]
Set breakpoint at beginning of function at stack level stack and associate command list cmds.

[number] bc [count] [reset_count]
Set breakpoint count and reset_count for breakpoint with number number.

count bCYC [cmds]
Set temporary breakpoint after the specified cycle count and associate command list cmds.

count bcyc [cmds]
Set breakpoint after the specified cycle count and associate command list cmds.

exp bD {r|w|b} exp2 [cmds]
Set a data range breakpoint (between addresses exp and exp2) read (r), write (w) or both read and write (b), and associate command list cmds. This command is not available for all execution environments.

exp bd {r| w|b} [cmds]
Set a data breakpoint, read (r), write (w) or both read and write (b) at address exp, and associate command list cmds. This command is not available for all execution environments.

num bdis Disable code breakpoint.

num bena Enable code breakpoint.

[addr] bI [cmds]
Set temporary breakpoint at machine instruction and associate command list cmds.

[addr] bi [cmds]
Set breakpoint at machine instruction and associate command list cmds.

count bINST [cmds]
Set temporary breakpoint after count machine instructions and associate command list cmds.

count binst [cmds]
Set breakpoint after count machine instructions and associate command list cmds.

break [type] where [, option]...
Universal breakpoint command. Several types of breakpoints are available. The meaning of where depends on the selected type. Breakpoint options must be separated by commas.

time bTIM [cmds]
Set temporary breakpoint after time number of seconds and associate command list cmds.

time btim [cmds]
Set breakpoint after time number of seconds and associate command list cmds.

[stack] bU [cmds]
Set a temporary up-level breakpoint at stack level stack and associate command list cmds.

[stack] bu [cmds]
Set up-level breakpoint at stack level stack and associate command list cmds.

[exp] C [line] Continue execution from current value of program counter. If line is specified, execution continues up to that line. Breakpoint's count is set to exp.

[exp] CB [line]
Continue execution in background from current value of program counter. If line is specified, execution continues up to that line. Breakpoint's count is set to exp.
This command is not available for all execution environments.

D Delete all breakpoints.

Dy Delete all breakpoints without prompt for confirmation.

[number] d Delete breakpoint number.

cpu eC Start execution on the current CPU and switch to cpu.

[cpu] ec Select CPU or show current CPU number.

g line Go to the specified line in the current procedure.

address gi Go to the specified adrress.

if (exp) {cmds} [{cmds}]
Conditionally execute commands.

load [file] Load symbol table of file in CrossView Pro and download the image part to the target. This is a combination of N and dn.

N [file] Load symbol table of file in CrossView Pro.

prst Reset program counter.

Q Report breakpoint quietly.

q [y] Quit debugger (do not save desktop settings).

q s Save current desktop settings and quit debugger.

R Reset program counter and start execution.

rst Reset target system to initial conditions.

[exp] S Single step for exp lines, step over function calls.

[exp] s Single step for exp lines, step into function calls.

[exp] Si Single machine step for exp machine instructions, step over subroutine calls.

[exp] si Single machine step for exp machine instructions, step into subroutine calls.

st Stop the execution of the target immediately.
This command is not available for all execution environments.

[interval] u [d|k|r|s|a|mem|t]
Toggle updating of the appropriate window when the target runs in the background. You can specify the update interval, in seconds. If interval is zero, never update automatically.
This command is not available for all execution environments.

ubgw [s|a|k|r|d|mem|t|all]
Refresh the appropriate window, or all open windows, when the target runs in the background. This command is not available for all execution environments.

use [path]...
Clear source directory search path or use the specified path to search for source files.

wt Wait for the completion of the target.
This command is not available for all execution environments.

[exp] x Force an exit from assertion mode. If exp is non-zero, finish executing command list of the current assertion.

13.2.5 Record & Playback

<file Play back commands from file.

<<file Play back commands with single step from file.

>file Record commands in file.

>{t|f|c} Set recording file status, true (t), false (f) or closed (c).

> Report status of command recording mechanism.

>>file Log commands and screen output in file.

>>{t|f|c} Set logging file status, true (t), false (f) or closed (c)

>> Report status of command and screen output logging mechanism.

>&file Log host-to-target communication in file. Not available for all execution environments.

>&{t|f|c} Turn target communication logging on (t), off (f) or close (c) log file. Not available for all execution environments.

>& Report status of target communication logging mechanism. Not available for all execution environments.

13.2.6 Macros

echo string Display macro expansion of string.

save file Save current macros to file.

set Display all macros.

set macro "cmds "
Define macro macro as command list cmds.

unset Delete all macros.

unset macro!
Delete definition of macro macro.

macro! Prevent expansion of macro.

13.2.7 Input/Output Simulation

ios_open ["file"[,[mode][,[r][,$xvw_variable]]]]
Open a CrossView Pro File I/O stream.

ios_wopen [["terminal_window "][,$xvw_variable]]
Open a CrossView Pro File I/O stream an map the stream to a terminal window.

ios_close {stream | "file"}
Close a CrossView Pro File I/O stream.

ios_read {stream | "file"},address,number_of_maus[,x]
Read binary data from a File I/O stream. Optionally, interpret the read data as hexadecimal values.

ios_readf {stream | "file"},"format",expression
Formatted read from a File I/O stream (scanf).

ios_write {stream | "file"},address,number_of_maus[,x]
Write binary data to a File I/O stream. Optionally, interpret the data as hexadecimal values.

ios_writef {stream | "file"},"format", expression
Formatted write to a File I/O stream (printf).

ios_rewind {stream | "file"}
Move File I/O file pointer to the beginning of the file.

13.2.8 File System Simulation

FSS { < | > }{&stream | "file"}
Redirect to or from a stream or file.

FSS_stdio_open filename,rwdirection,streamnumber
Redirect the output of a stream to a file.

FSS_stdio_close streamnumber
Close the specified stream.

13.2.9 Target System Control

dcmp [file[,[number_of_hits][,d]]
Compare an application file with the memory contents and display differences.

dn Download the image part of the current absolute file, specified when CrossView Pro was invoked or loaded with the N command.

dn file Download the image part of the absolute file file.

dnm mem Download the image part of the current hexadecimal file, specified when CrossView Pro was invoked or loaded with the N command, into memory space mem.

dnm mem file
Download the image part of the hexadecimal file file, into memory space mem.

n [addr] Set code address bias (for overlays) to addr. If no address is given, then display the current bias.

o [cmd] Enter transparency mode (exit with ctrl-D). If cmd is present, pass cmd to the execution environment. Not available for all execution environments.

! [command-line]
Execute shell command command-line or invoke new shell.

13.2.10 Save and Restore Target State

This feature is only available when it is supported by the debug instrument.

di_state open state_name
Open the state with the specified state_name.

di_state save state_name, number
Save the state of the debug instrument with the specified state_name and number.

di_state restore state_name, number
Restore the state of the debug instrument with the specified state_name and number.

di_state close state_name, delete
Close the state with the specified state_name. delete can be 1 to delete the state or use 0 to keep the state.

13.2.11 Help Commands

I Print information about debugger state.

13.2.12 Search Commands

Z Toggle case sensitivity in searches.

/[string] Search forwards in source file for string. If string is not present, perform previous search again.

?[string] Search backwards in source file for string. If string is not present, perform previous search again.

"string" Print string.

13.3 Commands: Detailed Descriptions

The rest of this chapter provides the detailed descriptions of the CrossView Pro commands.

expression

Function

Print the value or address of an expression.

Select the Data | Evaluate Expression... menu item. Enter an expression and optionally select a display format. You may set up a monitor, which instructs the debugger to evaluate a particular expression each time the program stops, from the Source Window by selecting text there and by clicking on the Watch Expression button.

Enter the expression in the Command Window. You may specify in which format you want CrossView Pro to display the answer.

Description

In the Command Window, the syntax for this command is:

exp [/ format |@ format]

Print the value or address of exp with format format. A / (slash) is used to print the value of exp and a @ (commercial at) is used to print the address of exp. If format is not supplied, the natural (/n) format of the expression is used.

Formats have the syntax:

[count] style [size]

count is the number of times to apply the format style and defaults to 1. style may be one of:

See the Accessing Code and Data chapter and the section Formatting Expressions in the chapter Command Language for details on each of the format styles. size indicates the number of bytes to be formatted. Rather than a number for the integer type styles, size can also be: c for char, s for short, i for int, and l for long.

The default action, if no modifier is specified, is to print the value of exp using the /n (normal) format.

Be careful with one letter variable names, as they may be taken as an CrossView Pro command rather than as a variable. If an expression begins with a variable that might be mistaken for a command, then eliminate any white space between the variable and the first operator. For example: use h=9 instead of h = 9.

To display the value of a variable that has the same name as an CrossView Pro command you must use the natural format modifier. For example: to print the value of the variable C, use C/n.

Variables may be altered as a side effect of evaluation of exp. See the example below.

Example

To set variable aux to t times 8, type:

As a side effect the variable t is post-incremented. If you type:

CrossView Pro will set special variable $s_aux to the result of the function call to func with the variables t and s passed as parameters. If you type:

Print the value of the special variable $s_aux as four hex bytes; you could also use: $s_aux/xl.

^

line

Function

Display the C source line numbered line in the current source file.

Select the Edit | Find Line... menu item, enter the line number and click on the Find button. Alternately, you may click on the desired source line in the Source Window.

Enter the line number in the Command Window. The syntax is:

line

Description

The current viewing position becomes line.

Example

To display the twelfth line in the current source file, type:

e , p , P

string

Function

Echo a string to the terminal.

Enter the string to the Command Window.

Description

A string may contain standard C escapes, such as \n for a newline. The syntax for a string in the Command Window is:

"string"

Example

This function can be useful for labelling breakpoints. For example, to insert a breakpoint at line 12 and have a message printed when that line is reached, enter:

When CrossView Pro reached line 12, the message "At the twelfth line" will be printed and the program will continue. If you only type:

CrossView Pro will simply echo the word "Debug."

Q , expression

!

Function

Instruct CrossView Pro to interpret a command literally, ignoring any macro definitions of the same name. Also, enter a shell command.

The syntax for this command is:

[ string ] !

or:

! [ string ]

Description

This command is useful whenever string should be treated literally and not as a potential macro invocation. It can be used, for example, in executing an CrossView Pro command whose name has been defined as a macro.

Example

To enter the host environment under a new shell, type:

To execute the host date command, type:

To execute the CrossView Pro command b instead of the macro named b, type:

set , unset , echo , save

/

Function

Search down (forward) for a string.

To search for a string in the Source Window, select the Edit | Search String... menu item and select the up radio button. To repeat your search click on the Find Next Text String button.

The command line syntax is:

/ [ string ]

Description

The search begins with the line after the current line. If the string is found the viewing position is changed to the line containing the string. The execution position is not affected. If you do not specify a string to search for, CrossView Pro will look for the most recent specified string.

Searches wrap around to the beginning of the file. Regular expressions are not recognized.

Example

To look for the next occurrence of Random in the current file, beginning with the line after the current line, type:

? , Z

?

Function

Search up (backward) for a string.

To search for a string in the Source Window, select the Edit | Search String... menu item and select the down radio button. To repeat your search click on the Find Next Text String button.

The command line syntax is:

? [ string ]

Description

The search begins with the line before the current line. If string is found, the current line is changed to point to the line containing the string. The execution position is not affected. If you do not specify string, CrossView Pro searches for the previously-specified string again.

Searches wrap around to the end of the file. Regular expressions are not recognized.

Example

To look for the previous occurrence of Random in the current file, beginning with the line above the current line, type:

/ , Z

<

Function

Continuous command playback. Read commands continuously from a file.

To setup command playback, select the Tools | Playback | CrossView... menu item. Enable the Continuous playback check box and click on the Execute button.

The command line syntax is:

< file

Description

All the commands in file will be read and executed. If a playback file contains either a < or << command, playback switches to the newly specified file and does not return to the original file.

Record and playback options can also be specified via command line parameters.

If the execution of commands from the playback file is interrupted with the Halt button, CrossView Pro will begin reading the remainder of commands in file using single step playback (see the << command.)

Example

To read and execute the commands found in the file command.out, type:

<< , > , I

<<

Function

Single-step command playback.

To setup command playback, select the Tools | Playback | CrossView... menu item. Disable the Continuous playback check box and click on the Execute button.

The command line syntax is:

<<file

Description

Commands will be played back one at a time. Each command will be loaded sequentially into the entry field of the Command Window. The command can then be edited and executed.

The carriage return will execute the current command and stop at the next one.

If a playback file contains either a < or << command, playback switches to the newly specified file and does not return to the original file. Record and playback options can also be specified via command line parameters.

Example

To read and execute the commands found in the file command.out, type:

< , > , I

>

Function

Record CrossView Pro commands to a file.

To start recording or toggle the state of the command recording mechanism, select the Tools | Record... menu item. Type or select a file to record commands in and click on the Start button to start recording. To suspend recording click on the Suspend button. To resume recording click on the Resume button. To stop recording click on the Stop button.

The command line syntax is (note that the greater than sign must be typed as shown):

> [ ! ] [ file | t | f | c ]

Description

CrossView Pro will start recording commands in a file if file is specified, otherwise, turn recording on (t), off (f), or close (c) the recording file. Specifying a different file while recording is on will cause the old output file to be closed and all successive commands will be sent to the new file. If no arguments are given, the state of the recording mechanism will be displayed.

The optional '!' forces flushing of the output after every write.

The commands recorded can be played back by using the < or << command. It is possible to have a command recording file and a screen output recording file to be open concurrently. The file is also closed as a side effect of the q command.

Commands issued to the emulator under transparency mode are not recorded.

Files may not be named: t, f or c.

Example

To set (or change) the command recording file to log.cmd and turn command recording on, type:

To suspend recording commands, type:

To resume recording the commands to the recording file, type:

To stop recording commands and close the file, type:

To display the state of the recording mechanism, type:

>> , >& , < , << , I , q

>>

Function

Log Command Window screen output. All Command Window input and output will be saved to a file.

To create a log of Command Window screen output, select the Tools | Log | Command Input/Output... menu item. Type or select a file to log to and click on the Start button to start logging. To suspend logging click on the Suspend button. To resume logging click on the Resume button. To turn off logging click on the Stop button.

The command line syntax is:

>> [ ! ] [ file | t | f | c ]

Description

Start logging the commands typed and their output in a file if file is specified, otherwise, turn logging on (t), off (f), or close (c) the log file. Specifying a different file while logging is on will cause the old output file to be closed and all successive Command window output will be sent to the new file. If no arguments are given, the state of the recording and logging mechanism is displayed.

The optional '!' forces flushing of the output after every write.

Because output is logged as well as commands, files logged using >> cannot be played back like those recorded with the > command.

It is possible to have both a command recording file and a screen output logging file open concurrently. The log file is also closed as a side effect of the q command. Log files may not be named: t, f or c.

Example

To set (or change) screen output recording file to the file log.out and turn screen output recording on, type:

To suspend recording the screen output, type:

To resume recording the screen output in the recording file, type:

To stop recording the screen output and close the file, type:

To display the state of the recording mechanism, type:

> , >& , I , q

>&

Function

Log communications between debugger and emulator.

To save debugger/emulator communications, select the Tools | Log | CrossView-Emulator I/O... menu item. Type or select a file to log to and click on the Start button to start logging. To suspend logging click on the Suspend button. To resume logging click on the Resume button. To turn off logging click on the Stop button.

The command line syntax is:

>& [ ! ] [ file | t | f | c ]

Description

Start host-to-execution environment communication logging in a file if file is specified; otherwise, turn logging on (t), off (f), or close (c) the log file. This feature is most often used to diagnose problems with CrossView Pro itself.

The optional '!' forces flushing of the output after every write.

The commands captured cannot be played back the way commands recorded by the > command can. The log file is also closed as a side effect of the q command.

Not available for all execution environments.

Example

To open the file log.out and put the following host-to-emulator communications in this file, type:

To suspend logging communications in the log file, type:

To resume logging communications in the log file, type:

To stop logging communications and close the file, type:

> , >> , q

^

Function

Display contents of preceding memory location based on the size of the last data item displayed.

The command line syntax is:

^ [ format ]

Description

Use previous format or format, if supplied. Formats have the syntax:

[count] style [size]

count is the number of times to apply the format style and defaults to 1. style may be one of:

See the Accessing Code and Data chapter and the section Formatting Expressions in the chapter Command Language for details on each of the format styles. size indicates the number of bytes to be formatted. Rather than a number for the integer type styles, size can also be: c for char, s for short, i for int, and l for long.

This command is most often used in combination with exp/ format to look at the value of some variable or memory location.

Example

To display the variable aux as two octal values of length two, type:

To show the eight bytes before aux in hexadecimal format, next type:

expression




More commands:

A - gus
I - Z


Copyright © 2002 Altium BV