12 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

Startup Options

Viewing Commands

Data Monitoring

Execution Control Commands

Record & Playback

Macros

File System Simulation

Simulated Input/Output

Target System Control

Help Commands

Search Commands

Commands: Detailed Descriptions

12.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:

Command items in bold font are the actual command keywords typed from the keyboard. In the example above, sio 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 /format is not necessary for the sio command to work. Usually if you omit an optional expression, CrossView Pro uses a default value.

The | symbol means or. For instance, { file | screen} means a filename or the word screen (but not both) may be used in the command.

12.2 Commands: Summary

12.2.1 Startup Options

From EDE, you can set the values of the -a, -b and -c options in the Misc tab of the EDE | CrossView Pro Options dialog.

-a number Set the maximum number of assertions (the default is 100).

-b number Set the maximum number of breakpoints (the default is 200).

-c number Set the maximum number of instruction trace (the default is 32).

-C cpu Force CPU type selection. This option also determines which register file (regcpu.dat) will be used. This option overrules the CPU type selection in both xvw.ini and a target configuration file.

-dsc dsc Force locator description file selection. The default is xa_t.dsc.

-D device_type,opt1[,opt2]
Selects a device and specifies device specific options, such as communication port and baud rate. The allowed combinations for your execution environment are described in the manual addendum for that specific execution environment.

-D rs232,port,speed
Select RS-232 communication.

port For PC this is COM1, COM2, COM3 or COM4. A colon should not be added. For UNIX this is the full path of the RS-232 device driver (e.g., /dev/tty01). By default CrossView Pro uses the first RS-232 port.

speed This is the baud rate used for the specified port. The default is 9600.

-D parallel,port
Select parallel communication.

port For PC this is LPT1 or LPT2. Do not add a colon. For UNIX this is the full path of the parallel device driver. By default CrossView Pro uses the first parallel port.

-D tcp,host,port
Select TCP/IP communication. On UNIX the standard TCP/IP implementation is used. On MS-Windows the WINSOCK.DLL implementation is used.

host The name of the host to be accessed via TCP/IP.

port The port number on host to be accessed.

-D dev,device-file
Use a UNIX device driver as communication channel. For RS-232 devices use the -D rs232 option, described above.

device-file The full path of the UNIX device file.

-D isa,io-port,address
Select communication channel to an (E)ISA interface card in the PC.

io-port PC I/O port number or I/O channel used for accessing the (E)ISA card.

address The memory address used to access the (E)ISA card.

From EDE, you can set communication parameters in the Settings tab of the EDE | CrossView Pro Options dialog.

-em macro[=def]
Add macro for pre-processing the description file. If def is not given ('=' is omitted), '1' is assumed.

-E exec-env Select the execution environment. The possible values for exec-env are described in the manual addendum for your execution environment.

-f file Read command line options from file.

--fss_root_dir="path"
Specify root directory for File System Simulation.

-G path Specify startup directory for CrossView Pro.

-i Perform an initial download of the image of the absolute object file on startup.

From EDE, you can enable the Initial download of program check box in the Misc tab of the EDE | CrossView Pro Options dialog.

-L file Make a log of CrossView Pro target communications in file.

-n address Inform CrossView Pro that the program was loaded into memory at an address other than zero.

-p file Begin by playing back commands from file.

-P file Begin by playing back commands from file with command single step.

-r file Begin recording commands in file.

-R file Begin logging commands and screen output in file.

From EDE, you can enter record, log and playback filenames in the Logging tab of the EDE | CrossView Pro Options dialog.

-s number Set the maximum number of special variables (variables independent of the program that CrossView Pro provides for your use). The default is 26.

From EDE, you can enter the maximum number of special variables in the Misc tab of the EDE | CrossView Pro Options dialog.

-sd directory ...
Specify the directories CrossView Pro should search for source files (separated by semicolons). Relative paths are allowed. When the N command is used to load a new symbol file, the current directory is set to the directory containing the symbol file and CrossView Pro now searches for source files relative to this directory.

-tcfg file Specify a target configuration file. This overrules the filename specified in xvw.ini. See section CrossView Pro Startup Settings in the Overview chapter.

-T [file] Start CrossView Pro in transparency mode; if file is specified, commands in file are sent to the execution environment.This option is not available for all execution environments.

12.2.2 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.

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.

12.2.3 Data Monitoring

cd Disable, turn off, gathering of coverage data.

ce Enable, turn on, gathering of coverage data.

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 List profiling info.

12.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.

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|cd|ck|cr|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.

12.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.

12.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.

12.2.7 File System Simulation

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

FSS_stdio_close streamnumber
Close the specified stream.

12.2.8 Simulated Input/Output

sio List all simulated I/O streams.

stream sio {i|o} {file | screen} [/ format]
Create simulated input (i) or output (o), numbered stream, directed from/to file or from/to the screen. Display data in format.

stream sio d Delete I/O stream stream.

stream sio p prompt
Change input stream's prompt to prompt.

12.2.9 Target System Control

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.

12.2.10 Help Commands

I Print information about debugger state.

12.2.11 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.

12.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 format code. 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 selected source expression accelerator 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:

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 may 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 Search | 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:

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.

There is no mouse equivalent for this function. However, many distinct functions accept strings. See below.

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:

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.

There is no mouse equivalent for this command.

The syntax for this command is:

or:

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 Search | Search String menu item or click on the Repeat search down for string accelerator button.

The command line syntax is:

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 Search | Search String menu item or click on the Repeat search up for string accelerator button.

The command line syntax is:

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 Options | Playback menu item. Enable the Continuous playback check box and click on the Execute button.

The command line syntax is:

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 Options | Playback menu item. Disable the Continuous playback check box and click on the Execute button.

The command line syntax is:

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 Options | Record menu item. To start recording click on the Start button. 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):

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 Options | Log | Command Input/Output... menu item. To turn on logging click on the Start button. 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:

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 Options | Log | CrossView-Emulator I/O... menu item. To turn on logging click on the Start button. 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:

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.

There is no direct mouse equivalent for this function.

The command line syntax is:

Description

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

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 may 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 - if
L - Z


Copyright © 2000 TASKING, Inc.