Synchronize the viewing and execution positions.
To synchronize the positions manually, click on the Synchronize source accelerator button in the Source Window or select the Run | Synchronize Source menu item.
The command line syntax is:
This command synchronizes the viewing and execution positions. It also lists the current file, function and line number of the current program counter. The viewing position is always moved to match the execution position.
The L command is synonymous with a 0 e command and does not affect the execution position.
This command is not allowed when the target runs in the background.
To synchronize the viewing and execution positions, then list current file, function, and line number, type:
L
List.
There are multiple mouse equivalents for this command. Generally speaking, the dialog box in which you define a feature also maintains a list.
The command line syntax is:
In the first case above, list one of the following: 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 string is present, then list only those items that start with string.
In the second case, list the values of all parameters and locals of the function func. Without a function, this command lists all parameters and locals of the current function in view.
In the third case, list all parameters and locals of the function at depth stack.
The l f and l m commands also show the address of the modules' first procedure. The l m command is identical to l f, list files, but the list of files is sorted on ascending segment addresses. func must be a function on the stack or the current function.
For configurations that support real-time kernels, the l k command can have one of the following arguments (l k is the same as specifying l k t):
To list defined assertions and the state of the assertion mechanism, type:
l a
To list all locals and parameters of the current function, type:
l p
Data is displayed using the normal (/n) format. To list all the parameters and locals of the function fcn, type:
l fcn
To list queue information for the current tasks (only if your configuration supports it), type:
l k q
Load a program's symbol file and download the image part.
Select the File | Load Symbolic Debug Info... menu item. This dialog allows you to specify the file.
The command syntax is:
This command performs the N and dn commands sucessively.
Downloading a file only copies the image part into target memory (dn). It will not cause CrossView Pro to re-read symbolic information (N). The load command does both.
This command is not allowed when the target runs in the background.
To load the symbol table of file demo.abs in CrossView Pro and to download the image part, type:
load demo.abs
List the data currently being monitored.
Refer to the Data Window. Each time the program stops,
the debugger evaluates all monitored expressions and displays the results
in the Data Window.
The command line syntax is:
List all C expressions being monitored by CrossView Pro. The listing associates a unique number with each expression. This number is used to specify the deletion of monitored data.
Monitor (watch) an expression. (Also delete a monitor.)
From the Source Window, double-click on an expression.
A new monitor is created in the Data Window or the Expression Evaluation dialog is opened if the Bypass Dialog check box in the Data Display Setup dialog is not set. If the latter is the case, click on the
Watch button to create a new monitor in the Data Window. To remove an existing monitor, select the monitor in the Data Window and click on the
Delete selected item button.
The command syntax is:
The m command has two distinct functions. The first monitors the given expression. The second deletes the monitoring of the expression specified by number.
Data monitoring takes place whenever the program stops execution, that is, for a breakpoint, assertion, single step, or user interrupt (ctrl-C). In window mode, the values of all currently monitored data are displayed in the Data window. Each piece of monitored data has a unique identifying number that is used when deleting it.
To monitor the value of the variable myvar, type:
m myvar
To monitor the address of variable myvar, type:
m &myvar
To monitor the element alpha+1 of array, type:
m array[alpha+1]
To delete expression number 2 of the monitored data, type:
2 m d
Memory copy.
From the Memory Window, click on the
Copy memory button to open the Memory Copy dialog. Enter the start address and
end address (inclusive) of the memory region you want to copy. Enter the destination address and click on the OK button.
The command syntax is:
The mcp command copies a block of target memory starting at address addr_start to destination address addr_dest. The size of the memory block is defined as: 'addr_end - addr_start + 1'. The data item located at address addr_end is included in the copy.
If your target supports multiple memory spaces then it is legal to copy data between different memory spaces. Of course addr_start and addr_end must be located in the same memory space. This command does not have any effect on code breakpoints.
To copy the contents of variable buf to address 0x200, type:
&buf mcp &buf+sizeof(buf), 0x200
Memory single fill.
From the Memory Window, click on the
Single Fill memory button to open the Memory Single Fill dialog.
Enter the start address the memory region you want to fill. Enter one or more expressions separated by commas and click on the
OK button.
The command syntax is:
The mF command fills target memory with data. The value defined by exp is written to address addr in target memory. Multiple exps separated by commas may be entered. Each exp is written to a subsequent MAU.
If your target supports multiple memory spaces then addr may refer to any memory space.
If the sizeof a given exp occupies more than one MAU, only the least significant MAU will be written to memory. This command does not have any effect on code breakpoints.
To store value 0x12 at memory location 0x400 and value 0xAB at location 0x401, type:
0x400 mF 0x12, 0xAB
Memory fill, repeating the specified pattern until the specified region is filled.
From the Memory Window, click on the
Fill memory button to open the Memory Fill dialog. Enter the start address and
end address (inclusive) of the memory region you want to fill. Enter one
or more expressions separated by commas and click on the
OK button.
The command syntax is:
The mf command fills a block of target memory with a pattern. The memory region starting at address addr_start and ending at address addr_end is filled with the pattern defined by exp [,exp]. Multiple exps separated by commas may be entered. Each exp is written to a subsequent MAU.
The specified pattern is repeated until the end address of memory region is reached.
If your target supports multiple memory spaces then addr may refer to any memory space.
If the sizeof a given exp occupies more than one MAU, only the least significant MAU will be written to memory. This command does not have any effect on code breakpoints.
To store values 0x01 and 0x02 at succeeding memory locations in the range 0x400 to 0x404, type:
0x400 mf 0x404, 0x01, 0x02
The result of this command is:
address: 0x400 0x401 0x402 0x403 0x404 value: 1 2 1 2 1
Memory search.
From the Memory Window, click on the
Search memory button to open the Memory Search dialog. Enter the start address and
end address (inclusive) of the memory region you want to search. Enter
one or more search patterns separated by commas and click on the
OK button.
The command syntax is:
The ms command searches for a pattern within a block of target memory. The memory region starting at address addr_start and ending at address addr_end (inclusive) is searched for the pattern defined by exp [,exp]. Multiple exps separated by commas may be entered. Each exp corresponds to a subsequent MAU.
If your target supports multiple memory spaces then addr may refer to any memory space.
This command does not have any effect on code breakpoints.
Suppose the memory range 0x400 to 0x4ff was filled using the following commands:
0x400 mf 0x4ff, 0 0x400 mf 0x404, 1, 2
To search for the values 0x01 and 0x02 at memory locations in the range 0x400 to 0x4ff, type:
0x400 ms 0x4ff, 0x01, 0x02
The result of this command is:
FOUND pattern at 0x400 FOUND pattern at 0x402
Load a program's symbol file.
Select the File | Load Symbolic Debug Info... menu item. This menu item allows you to specify the file.
The command syntax is:
Load the symbol table of the specified file in CrossView Pro. If no filename is given, the file being debugged is reloaded. In this case only the breakpoints set by the user are removed. Monitors, simulated I/O streams, assertions and CrossView Pro local variables remain active.
If a new file (different filename) is loaded, all breakpoints, monitors, simulated I/O streams, assertions and CrossView Pro local variables are removed.
If a path is supplied, CrossView Pro changes its current directory according to the specified path. In case a relative search path to source files was provided at startup time, CrossView Pro will search relative to the new working directory.
This command is automatically executed during CrossView Pro startup when a filename was given on the command line. Use the dn command to send the associated executable code to the target.
To load the symbol table of file demo.abs in CrossView Pro, type:
N demo.abs
Set address bias
Select the File | Load Symbolic Debug Info... menu item. In the Load Symbolic Debug Info dialog you can edit the
Code address bias field.
The command syntax is:
Set address bias of overlay files to addr. If no address is given, then display current bias.
If a program is to be loaded at a different address than that indicated in the linked and located (absolute object) file, then the address information in the debugger's symbol file will be incomplete, since it does not know where the program is actually going to be loaded. This command will normalize the addresses by adding the bias to every address.
To add a bias of 1000 to every address in the code, type:
n 1000
To display the current bias, type:
n
Set the viewing position to the next covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
If code coverage is supported by your version of CrossView Pro, this command enables you to skip to the next block of statements that have been executed while the program was running on the target.
To move the cursor to the next executed block, type:
nC
Set the viewing position to the next not covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
If code coverage is supported by your version of CrossView Pro, this command enables you to skip to the next block of statements that have not been executed while the program was running on the target.
To move the cursor to the next not executed block, type:
nU
Enter emulator mode.
Select the View | Command | Emulator menu item. If you know the emulator-level command language, you can communicate directly with the emulator from this window.
The command line syntax is:
Pass string to emulator and show the emulator response.
The o command lets you communicate with the emulator directly via emulator commands.
Do not issue one-shot transparency emulator commands that result in large output (or otherwise require intervention other than a carriage return to terminate output). Instead, enter transparency mode first, then issue the command.
To send the string map to the emulator, type:
o map
Set or display specific options.
Option values can be changed in the corresponding dialogs and menus.
The command line syntax is:
If no arguments are passed, all options with their current value are listed. By specifying an option's name, the current value of that option is displayed. By specifying an option name followed by a valid value, the option is set to that new value.
The options are a sub-set of CrossView's so-called "special variables". See chapter Command Language for a list of all special variables.
To display all options, type:
opt
To disable mixing of disassembly code and source lines in the assembly window, type:
opt mixedasm=off
Print source lines, including machine addresses.
In the Source Window, the machine address of the line
at the current viewing position is displayed in the Address field in the upper left corner.
The command line syntax is:
Print exp lines of source starting at line line, including machine addresses. If exp is omitted, print one line. If line is omitted, start from the current viewing position.
To print source lines 4, 5, 6, 7 and 8 (displaying machine addresses) of the current source file, type:
4 P 5
Print source lines.
C source is displayed in the Source Window.
The command line syntax is:
Print exp lines of source starting at line line. If exp is omitted, print one line. If line is omitted, start from the current viewing position.
To print source lines 4, 5, 6, 7 and 8 of the current source file, type:
4 p 5
Set the viewing position to the previous covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
If code coverage is supported by your version of CrossView Pro, this command enables you to skip to the previous block of statements that have been executed while the program was running on the target.
To move the cursor to the previous executed block, type:
pC
Disable, turn off, profiling.
Select the Run | Profiling menu item if this item was set.
The command line syntax is:
If profiling is supported by your version of CrossView Pro, this command disables the profiling system. Normally, you should disable profiling if you are not interested in the profiling results, as this will often improve the performance of the execution environment.
To disable profiling, type:
pd
Enable, turn on, profiling.
Select the Run | Profiling menu item if this item was not set.
The command line syntax is:
If profiling is supported by your version of CrossView Pro, this command enables the profiling system. Normally, you should disable profiling if you are not interested in the profiling results, as this will often improve the performance of the execution environment.
To enable profiling, type:
pe
List profiling results.
Select the Debug | Profiling Report... menu item, make your changes and select the Update button..
The command line syntax is:
If profiling is supported by your version of CrossView Pro and profiling is enabled, this command lists the profiling results. Normally, you should disable profiling if you are not interested in the profiling results, as this will often improve the performance of the execution environment.
To list the profiling results, type:
pe proinfo
Reset the application being debugged to initial conditions. That is, set the program counter to the start address of the application.
Select the Run | Program Reset menu item.
The command line syntax is:
The program counter is set to the start address of the application being debugged. This command does NOT perform a hardware reset of the target system. That is, no registers are modified except for the program counter.
This command is not allowed when the target runs in the background.
Set the viewing position to the previous not covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
If code coverage is supported by your version of CrossView Pro, this command enables you to skip to the previous block of statements that have not been executed while the program was running on the target.
To move the cursor to the previous not executed block, type:
pU
Quiet breakpoint reporting.
There is no mouse equivalent for this command.
The command line syntax is:
If this appears as the first command in a breakpoint's command list, the debugger does not make the usual announcement of:
when the breakpoint is hit.
The purpose of this command is to allow quiet breakpoint reporting. For example, to check the value of a variable without cluttering the screen with text.
If you type the following:
21 b {Q; var1}
CrossView Pro will set a breakpoint at line 21. When that breakpoint is hit, CrossView Pro will print the value of var1, but will not print the current function, line number, and source file.
Quit a debugging session.
Select the File | Exit menu item.
The command line syntax is:
CrossView Pro will prompt you if you really want to quit if you do not specify anything. Note that the current desktop settings are NOT saved then!
Typing q s saves the current desktop settings and quits the debugger without confirmation.
Typing q y does not save the current desktop settings and quits the debugger without confirmation.
Inside a command line procedure call it will just quit from this.
When the target runs in the background CrossView Pro will first stop the target.
Reset program and begin execution from initial conditions.
Select the Run | Program Reset menu item followed by the Run | Run menu item.
The command line syntax is:
Reset the application being debugged and begin execution from initial conditions. The program counter is set to the start address of the application being debugged. This command does NOT perform a hardware reset of the target system. That is, no registers are modified except for the program counter.
This command is not allowed when the target runs in the background.
Reset target system to initial conditions.
Select the Run | Target System Reset menu item.
The command line syntax is:
The target is initialized according to the power-up sequence for the processor. Almost all registers, including the system stack pointer and program counter are initialized.
A target system reset may have undesired side effects.
To be sure that the application code is correct, a download must be performed
after a target system reset.
This command is not allowed when the target runs in the background.
Single step C statements, stepping over function calls.
To step over a function, click on the
Step Over
accelerator button in the Source Window. You can also select the
Run | Step Over menu item. Verify the Run | Step Mode menu item; Source Step must be selected.
The command line syntax is:
If you try to step over a call to a function which contains a breakpoint (or which calls another function with a breakpoint) then the breakpoint will be hit.
Stepping over a function means that CrossView Pro treats function calls as a single statement and advances to the next line in the source. This is a useful operation if a function has already been debugged or if you do not want to take the time to step through a function line by line.
When multiple statements are present on one line, they are all executed by this single step.
This command is not allowed when the target runs in the background.
To step one C statement, type:
S
To step five C statements, type:
5 S
Single step C statements, stepping into function calls
To single step into a function, click
on the Step Into accelerator button in the Source Window. You can also select the
Run | Step Into menu item. Verify the Run | Step Mode menu item; Source line step must be selected.
The command line syntax is:
Single step exp (default is 1), C statements, stepping into function calls.
Stepping into a function means that CrossView Pro enters the function and executes its prologue machine instructions halting at the first C statement. When the end of the function is reached, CrossView Pro brings you back to the line after the function call. The debugger changes the source code file displayed in the Source Window, if necessary.
This command is not allowed when the target runs in the background.
To step one source instruction, type:
s
To step five source instructions, type:
5 s
Save macros.
Select the Options | Macro Definitions... menu item to view the Macro Definitions dialog box. From this dialog box, you
can save macros by clicking on the Save button. To save macro definitions in a file other than the current one, click on the
Save as... button.
The command line syntax is:
Save all currently defined macros in the specified file. This file is in the format of a sequence of set commands, and thus can be loaded by reading it as a playback file. See the < and << commands.
An existing save file with the same name will be overwritten.
To save the definitions of the currently defined macros in the file mac.sav, type:
save mac.sav
set
,
unset
,
echo
,
!
,
<
,
<<
Definition and display of macros.
To create a macro, select the Options | Macro Definitions... menu item to view the Macro Definitions
dialog box. Click on the New... button.
The command line syntax is:
The set command allows for definition and display of macros. If name and cmds are supplied, a macro entry is made associating the name with the commands. If only name is supplied, the body of the specified macro is displayed.
If no arguments are supplied the names of all currently defined macros are displayed. Macro definitions must contain the body of the macro in double quotation marks.
Macros may take arguments. In the body of a macro formal arguments are referred to as $n, where n is the argument number starting from 1.
It is important to understand that macro expansion takes place for all names. Therefore, if you wish to pass the name of an existing macro to a command, such as set, you must escape it with '!', to keep CrossView Pro from expanding the name.
To display the names of all currently defined macros, type:
set
To display the body of the macro named macro, type:
set macro!
To define macro to be a macro which lists the registers then enters the function given by its first argument, type:
set macro "l r; e $1"
To invoke this macro, you might type, for example:
macro(main)
Single step machine instructions, stepping over subroutine calls
Select the Run | Step Mode | Machine step menu item. Then click on the Step Over accelerator button in the Source Window, or select the Run | Step Over menu item.
The command line syntax is:
Single step exp (default is 1) machine instructions, stepping over subroutine calls.
If you try to step over a call to a subroutine which contains a breakpoint (or which calls another subroutine with a breakpoint) then the breakpoint will be hit.
The next instruction to be executed is shown as a disassembled instruction, not as a C statement.
This command is not allowed when the target runs in the background.
To step one machine instruction, type:
Si
To step five machine instructions, type:
5 Si
Single step machine instructions, stepping into subroutine calls
Select the Run | Step Mode | Machine step menu item. Then click on the Step Into accelerator button in the Source Window, or select the Run | Step Into menu item.
The command line syntax is:
Single step exp (default is 1), machine instructions, stepping into subroutine calls.
The next instruction is shown as a disassembled instruction, not as a C statement.
This command is not allowed when the target runs in the background.
To step one machine instruction, type:
si
To step five machine instructions, type:
5 si
Associate a stream with a file or screen.
Use the Debug | Simulated I/O Setup menu item to set up simulated I/O streams. You can open a simulated I/O stream with
one of the View | Simulated I/O | Stream x menu items or use the Debug | Simulated I/O Setup dialog to configure a number of streams. In this case, the associated window will be created when
input is required from the window or when output is sent to the window.
The command line syntax is:
Associate an I/O stream with a file file or screen. Valid stream numbers are 0 through 7. The stream may be input (i) or output (o). I/O is either done on the file file or via the screen/keyboard. The stream may be read from or written to using the format format which tells CrossView Pro how to interpret the data. The default format is character. Formats may also be x (hexadecimal) and o (octal).
Other options to the sio command are: delete (d) the specified stream, and change the input prompt string (stream sio p prompt). The sio command with no arguments lists all simulated I/O streams.
This command can only be used in conjunction with user I/O routines containing _simi or _simo calls. See the Simulated Input/Output chapter for further details.
Deleting a stream will close all communication with that stream. This is useful to stop output to the screen or file when enough output information has been seen and resumption of the program, running without I/O breaks from this simulated I/O stream, is desired.
To start simulated input from the file testdata.in, type:
5 sio i testdata.in/x
This input will be associated with stream 5. Data in the testdata.in file are expected to be in hexadecimal format.
To list all simulated I/O streams, type:
sio
Stop the execution of the target immediately.
There is no mouse equivalent for this command.
The command line syntax is:
This command stops the running process immediately.
Not available for all execution environments.
Stack trace with local variables
There is no mouse equivalent for this command.
The command line syntax is:
Produce a trace of functions on the stack and show local variables. Only the first exp levels of the stack trace will be displayed. If exp is omitted, all of the levels of the stack trace (up to 20) will be printed.
This command works independently of the Stack Window.
This command is not allowed when the target runs in the background.
To print out a stack trace of 20 levels with corresponding local variables, type:
T
To print out the top five levels of the stack trace with corresponding local variables, type:
5 T
Stack trace.
Select the View | Stack menu item. The Stack Window shows the current situation in the stack after the program has been stopped. It displays the following information for each stack frame:
The command line syntax is:
Produce a trace of functions on the stack.
exp specifies the number of levels of the stack trace to be displayed. If omitted, up to 20 levels of the stack trace will be printed.
Each stack level shown in the Stack Window is displayed with its level number first. The levels are numbered sequentially from zero. That is, the lowest/last level in the function call chain is always assigned zero.
This command is not allowed when the target runs in the background.
To print out a stack trace of 20 levels, type:
t
To print out the top five levels of the stack trace, type:
5 t
Disable, turn off, trace.
Select the Run | Trace menu item if this item was set.
The command line syntax is:
If trace is supported by your version of CrossView Pro, this command disables tracing (both instruction level, high level and raw). Trace is automatically disabled when you close the Trace Window.
To disable tracing, type:
td
Enable, turn on, trace.
Select the Run | Trace menu item if this item was not set.
The command line syntax is:
If trace is supported by your version of CrossView Pro, this command enables tracing (both instruction level, high level and raw). Trace is automatically enabled when you open a Trace Window.
To enable tracing, type:
te
Toggle the updating of the appropriate window when the target runs in the background.
There is no mouse equivalent for this command.
The command line syntax is:
The following windows can be updated:
With interval you can specify the update interval (in seconds). If interval is zero, no window is automatically updated.
The updating of the Data Window is ON at startup, the others are OFF
If all windows are being updated and/or many monitor commands are active it will increase the load on the communication between CrossView Pro and the target.
The u d and the u cd commands toggle both the Data Window and the Composite Data Window. The same goes for the u r, u k, u cr and the u ck commands in respect to the Register Window, Stack Window, Composite Register Window and the Composite Stack Window.
This command is not available if the background mode
is not supported (check the addendum).
To toggle the updating of the Register Window, type:
u r
To toggle the updating of the Source Window, type:
u s
To disable period updating, type:
0 u
Update the appropriate window when the target runs in the background.
Select the View | Background Mode menu item and select one of the refresh options.
The command line syntax is:
The following windows can be updated:
Without an argument, the ubgw command refreshes all windows selected by the background mode (u command).
The ubgw all command refreshes all open windows.
This command is not available if the background mode is not supported (check the addendum).
To update the Source Window, type:
ubgw s
To update the Memory Window, type:
ubgw mem
Delete a macro definition.
Select the Options | Macro Definitions... menu item to view the Macro Definitions dialog box. Highlight the name of the
macro and click on the Delete button.
The command line syntax is:
The unset command deletes a macro. If name is supplied, the specified macro is deleted. If no arguments are supplied, all currently defined macros are deleted after CrossView Pro confirms your intent.
It is important to understand that macro expansion takes place for all names. Therefore if you wish to pass the name of a macro to a command, for example unset, you must escape it with `!', to keep from expanding the name.
To delete all macros, type:
unset
CrossView Pro will first ask for confirmation. To delete all the macro definitions at the same time, click on the Delete all button in the Macro Definitions dialog box.
To delete the macro named macro, type:
unset macro!
Change source directories run-time.
Select the Options | Startup | CrossView menu item to view the CrossView Startup dialog box. Click on the
Configure... button to specify the names of the directories containing your source
files. Relative paths are allowed.
The command line syntax is:
The use command changes the source directories. Without a path this command empties the search path, except for the path . (current directory). If one or more paths are supplied, this command adds the, semicolon separated, paths to the list of searched directories. Relative paths are allowed.
To clear the source directory path, type:
use
To search for source files in the directory /project/src and in the src directory relative to your current directory, type:
use /project/src;../src
Wait for the completion of the target.
There is no mouse equivalent for this command.
The command line syntax is:
This command can only be used if the target runs in the background mode.
This command waits for the running process to stop.
Waiting can be interrupted by typing ctrl-C. The target continues to run without interruption. It could be that some informational messages from the target are displayed in the command window. They can be ignored.
Not available for all execution environments.
Force an exit from assertion mode.
There is no mouse equivalent for this command.
The command line syntax is:
Normally this command stops execution immediately, but if exp is present and its value is non-zero, then CrossView Pro finishes executing the entire command list of the current assertion.
To define an assertion to stop the program when the value of global variable myvar exceeds 10, type:
a if (myvar > 10) {x}
To define an assertion to suspend the assertion mechanism and continue program execution when global variable myvar exceeds 10, type:
a if (myvar > 10) { A s; 1 x; C}
Toggle case sensitivity in searches
Select the Search | Search String... menu item to view the Search String dialog box. This dialog contains the
Case Sensitive check box.
The command line syntax is:
Toggle case sensitivity in searches. The initial state of this toggle depends on information in the currently loaded absolute file. Use the I command to find out the state of the case sensitivity.
This command affects everything: file names, function names, variables and string searches.
Other commands:
expression - ^
A - if