System variables

There are a number of system defined variables. Modifying their values changes the way the debugger operates. The following list contains the currently defined system variables. To display the value of a system variable, prepend a dollar-sign to it (for example, $ANSICMODE) and enter it in the command pane.
System variables
Name Meaning
ANSICMODE
Default value is 1 if main() is defined with a prototype such as main(void) or main(int argc, char **argv). Otherwise, the default is 0 (zero).
If 0 (zero), expressions are evaluated as they are in K&R C. If 1, then they are evaluated as in ANSI C. Generally, this affects how unsigned shorts, unsigned chars and unsigned bit fields are coerced. By default in K&R, they are coerced to unsigned int, whereas in ANSI they are coerced to int, thus ((unsigned short) 3)/ -3 yields different results in ANSI and K&R. The type of sizeof is different, as is the interpretation of the op= operators in certain obscure cases.
ARRAYPRINTMAX
Specifies the maximum number of array elements the debugger prints.
CONTINUECOUNT

If this is 0 or 1, the debugger will stop at the next breakpoint. If this is 2, the debugger will stop at the second breakpoint reached by the program, and so on. Use the c command to set its value. For example, to set it to 3, enter:
c @3
DEBUGSHARED
Enables/disables debugging of shared objects. Only relevant with targets that support shared libraries like certain native UNIX platforms or advanced embedded real-time operating systems.
DEREFPOINTER
Controls whether or not pointers are automatically dereferenced when displayed by the print or examine commands.
DISNAMELEN
Controls the length of symbols printed when associating program labels to addresses in disassembly mode.
R_SIGNAL
The signal number that caused the current program to stop.
SERVERTIMEOUT
How long (in seconds) MULTI will wait for a debug server to respond before concluding that the server has failed. MULTI will prompt the user to close the connection or keep waiting. If set to zero, MULTI will never time out waiting for a debug server.
SIGNAL
The signal number which is passed back to the target. This is zero if masked by the signal handling code.
TASKWIND
If zero, the task window (for multi-tasking targets) will be disabled.
VERIFYRESTART
Verifies attempts to restart the program by bringing up a confirmation dialog.
VERIFYHALT
Verifies halting a program before setting a breakpoint by bringing up a confirmation dialog.
VIEWARRAYMAX
Maximum number of array elements shown in a data explorer window by default. More array elements can be viewed by changing the type of the array in the data explorer type field.

System special variables beginning with an underscore `_' are not normally listed. They represent the internal state of the debugger. To see them, use the l command with the s option:
l  s  _

See (lower case `L') l.

System special variables
Name Meaning
_ASMCACHE
When set to one (1) [default], the disassembly of program code in the debugger window is done by reading data from the executable file, not from the debugged program. This allows a faster disassembly print to the screen. Setting _ASMCACHE to zero forces the debugger to read the text to be disassembled from the debugged program, instead of the buffer or executable file. If instruction memory is modified or destroyed, and _ASMCACHE is one, then displays of disassembled instructions continue to show the original unmodified instructions in the executable file. This is confusing since the instructions actually executed are not those shown by the disassembly display.
Sometimes, when peculiar behavior occurs on the target system, such as the program stops on an apparently valid instruction or it refuses to single step or continue past a valid instruction, the instruction memory on the target system has been corrupted. Try setting _ASMCACHE to zero and redisplaying the assembly code. You may find invalid instructions at the point of failure. (You may need to turn off assem mode and examine another part of the program, turn assem mode back on, then return to the point of the entry to clear out the debugger's internal disassembly cache.)
_CACHE
If non-zero, the debugger uses a cache for reading memory from the target. The cache is invalidated every time the program state changes. This speeds up remote debugging. See also eval.
_DATA
Used for PID (position independent data) systems where the executable is linked as if it were at one address while it runs at another. This variable is set to the offset between the location at which the data segment resides and at which it is linked. This is set on the command line with the -data option.
_DISPMODE
Determines whether assembly code is interlaced with source code in the source pane. See "Interlaced source view".
_ERRHALT
When the target encounters an exception, then if _ERRHALT is false, the debugger will list the registers, execute any associated exception breakpoint commands, then resume the target process. If TRUE, only the associated commands are executed, leaving the target process halted. This variable defaults to TRUE. See be, de, l (lowercase `L') with the e and r options.
_INIT_SP
Tells the debugger the value of the stack pointer at program start up in certain remote environments where this information is not available.
_LANGUAGE
Shows which expression evaluator is in use. 0 means C, 1 means Fortran, 2 means Pascal, 3 means C++, 4 means Ada, 5 means Jovial, 6 means SL1, 7 means Assembly, and 31 means auto-select based on the type of current file.
_LINES
This shows the number of lines displayed by the printwindow command by default. See printwindow.
_NOTIFY
If this is non-zero, then you are notified when new children are forked, when your program performs an exec, and when your program is stopped. This is off by default.
_OPCODE
If non-zero, then disassembly mode displays the hexadecimal value of the instruction. This does not work for 68K.
_TEXT
Used for PIC (position independent code) systems where the executable is linked as if it were at one address, while it runs at another. This variable is set to the offset between the location at which the text segment resides and links. This is set on the command line with the -text option.

The following system special variables are read-only: .
Read-only system variables
Name Meaning
_BREAK
The current breakpoint number.
_FILE
The name of the current file.
_INTERLACE
Indicates whether assembly code is displayed in the source window. This is 1 (one) if there is assembly code currently displayed in the source window, otherwise it is 0 (zero).
_LINE
The current line number.
_MULTI_DIR
The name of the directory that contains the MULTI executable..
_PID
The process ID of the process, as reported by the debug server.
_PROCEDURE
The name of the current procedure.
_PROCESS
The MULTI defined program number of the current program.
_REMOTE
Set to 1 (one) if the debugger is debugging a program on a remote target. Otherwise, it is set to 0 (zero, for native debugging).
_SELECTION
A string variable representing the current selection from the source pane.
_STATE
Process state. See "Process state" table below.

Process state:
Process state
1 = no child
2 = stopped
3 = running
4 = dying
5 = just fork'ed
6 = just exec'ed
7 = about to resume
n/a

Related topic:


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.