SASHDB(8) — MAINTENANCE COMMANDS
NAME
sashdb − standalone shell and debugger
SYNOPSIS
sash [ -a | -R ]
DESCRIPTION
sashdb is a standalone shell and debugger that accepts various commands for the following functions:
• Booting and starting programs
• Debugging programs in the standalone mode and the remote debugging mode
• Displaying and changing contents of memory and registers
• Displaying and changing environment variables
• Miscellaneous utilities
OPTIONS
sashdb accepts the following options
-a Boots a program specified by the environment variable “DEFAULTBOOT” and transfers control to the booted program.
-R Starts sashdb in the remote debugging mode.
COMMAND SET
Commands may be abbreviated to the shortest unique string. Arguments can be specified for most commands. On the command line, the arguments are separated by spaces or tabs. Spaces, tabs, single quotes and double quotes can be included in an argument by enclosing them with single quotes or double quotes. For example,
’"hello world"’
is interpreted as an argument
"hello world"
Decimal, octal and hexadecimal can be used for numeric arguments and `‘0x” and "0" must precede for hex and octal, respectively. The current address “.” (dot) can be used to specify an address. “.” is the address where the target program hit the last breakpoint or the last address displayed by the examine or dis commands.
In the following description, the following symbols are used:
{a}zero or more occurrences of a
{a}+one or more occurrences of a
boot [ filename ] [-a | -n] [ -f filename ] { arg }
Boots the program specified by the environment variable "DEFAULTBOOT" or "DIAGBOOT" depending on the diagnostic switch setting, and starts the booted program from the entry point specified by the entry field of the a.out header of the booted program. Arguments specified by arg are passed to the booted program. All breakpoints are cleared when this command is executed. If the first argument does not start with -, the program specified by the first argument filename is booted. If -a is specified, -a is passed to the booted program. If -n is entered, control isn’t transferred to the booted program. If -f is specified, the program specified by filename is booted. If -- is entered, all arguments following this flag are passed to the booted program.
go [ -e addr ] { arg }
Starts the program from the entry point. Arguments specified by arg are passed to the program. If -d is specified, the entry point (start address) is set to the address specified by addr. The registers and the stack are initialized. If breakpoints are set, -d is passed to the program. -d flag is always followed by the two arguments. The first argument is the lowest virtual address of sashdb and the second is the size of sashdb.
cpu { num }
Changes the current cpu to the cpu in slot num. If num is not specified, information about each cpu is displayed. The current cpu is the cpu actually executing sashdb. The other cpus are either being held idle by sashdb, or are not under sashdb control.
break { addr }
Marks addresses specified by addr as breakpoints. Without addr, this command displays current breakpoint addresses. When the running program hits a breakpoint, all cpus are stopped if possible. This command must be executed after the program is booted using the boot command, since boot command clears all breakpoints.
unbreak all | { addr } +|-n { breakpoint_number }+
Clears the specified breakpoints. If all is specified, all breakpoints are cleared. If addr is specified, breakpoints at the specified addresses are cleared. If -n is specified, breakpoints of the specified numbers are cleared. After a breakpoint is cleared, breakpoints are renumbered.
step Executes one machine instruction on the current cpu.
Step Executes one machine instruction on the current cpu. If the current instruction is call, the execution continues until control returns from the subroutine.
cont [ addr ]
Continues the execution of the program. All cpus under sashdb control continue execution. If addr is specified, a temporary breakpoint is set at this address. This temporary breakpoint is cleared when a breakpoint is hit or the program exits.
examine -[ b | h | w ] -[ B | c | d | o | u | x | f ] { range }
Displays the content of ranges of memory. The width of memory location can be specified by the following flags:
-b:Byte (8 bits)
-h:Half word (16 bits)
-w:Word (32 bits)
The default width is Word. The format can be specified by the following flags:
-B:Binary
-c:Ascii character
-d:Decimal
-o:Octal
-u:Unsigned decimal
-x:Hexadecimal
-f:Floating point
The default format is hexadecimal. A range is specified by the following format:
addr- One width-size from address addr
addr#count- count width-size from address addr
addr1:addr2- From address addr1 to address addr2
If range is not specified, one width-size from the current address is displayed.
dis [ -o ] { range }
Disassembles the content of ranges of memory. The format of range is same as the one used in examine command. If the -o flag is specified, data are displayed in octals. If range is not specified, one width-size from the current address is disasembled.
deposit [ -b | h | w ] { addr=value }+
Changes the contents of memory at addr to value. The width of memory location can be specified by the following flags.
-b:Byte (8 bits)
-h:Half word (16 bits)
-w:Word (32 bits)
The default width is Word.
reg { name | name=value }
Without arguments, this command displays the all integer and control registers. If FPU is enabled, also displays all floating point registers. If name is specified, the register specified by name is displayed. The following are abbreviations:
gen- Global, in and out registers
ctl- All control registers
fl- All floating point registers
win- Active register windows
If name is dump, all control registers and all floating registers are copied to the register save area. If name=value is specified, the value of the register specified by name is changed to value.
traceback [ number ]
Prints a stack trace. Without number, the stack frames are displayed until the loop of %fp (%sp is equal to %fp) is found, %fp is zero or %fp is not in the stack page. If number is specified, this command displays the first number frames.
remote [ -e addr ] { arg }
Puts sashdb in remote debugging mode. If -e is specified, the entry point is changed to addr; otherwise the entry point of the last booted program is used. If the program was booted by the boot command or -e is specified, the registers and the stack of the target are initialized and arguments specified by arg are passed to the program. If the program is downloaded and arguments are sent by the host debugger, the registers and the stack are initialized as specified by the host debugger. The -d flag is passed to the program.
printenv { name }
Displays the value of the environment variable specified by name. If name is not specified, all of the environment variables are displayed. The format of output is name=value
getenv [ name ]
Displays the value of the environment variable specified by name. If name is not specified, this command does nothing. The format of output is value.
setenv { name=value }
Changes the value of the environment variable name to value. If name=value is not specified, this command does nothing.
unsetenv [ all | { name }]
Deletes the value of the environment variable specified by name. If all is specified, it deletes the values of all environment variables. If arguments are not specified, this command does nothing.
call addr { arg }
Calls a subroutine at the address specified by addr. Arguments given after addr are passed to the subroutine. When an argument is enclosed with double quotes, the argument is interpreted as a string; otherwise as a number. For a string argument, double quotes are stripped and the address of the string is passed. For a numeric argument, it is converted to a word size integer and this integer is passed to the subroutine. In the current implementation, the maximum number of arguments is five. This command is executed in sashdb’s context, not in the target program’s.
cp [ -b blocksize ] [ -c count ] source_file destination_file
Copies the contents of source_file to destination_file. If -b is specified, the block size is set to blocksize. The maximum number for blocksize is 65536 (= 64 Kbytes) and the default block size is 512 bytes. If -c is specified, count blocks are copied. Without -c flag, all of source_file is copied.
mode [ mode_type ]
If mode_type is specified, this command changes the access mode which is used by examine, deposit, and dis commands. The following mode types are available:
physical- Addresses are interpreted as physical addresses
virtual- Addresses are interpreted as virtual addresses
io- Addresses are interpreted as I/O addresses
target- Addresses are interpreted as target program addresses
In the physical, virtual and io modes, the MMU is disabled. In target mode, the MMU is enabled if the target program is running with the MMU enabled. When sashdb sets/clears breakpoints, reads/writes registers, or reads/writes memory in the remote debugging mode, the target mode is used.
dot [ radix ]
Changes the radix of displayed addresses to the radix specified to radix. The following values are available for radix:
x- Hex
d- Decimal
o- Octal
Without radix, this command displays the value of the current address in the current radix.
reset reset_type
Calls bootrom(8) reset routine specified by reset_type. The following values are available for reset_type:
cold- Do a power up reset
warm- Reset the rom state
halt- Halt the machine
autoboot- Autoboot the machine according to "DEFAULTBOOT"
cont- Continue previous program
quit Exits sashdb.
help { command }
Prints the syntax of command. If command is not specified, the syntax of all commands are displayed.
SEE ALSO
Solbourne Computer, Inc. — 27 January 1989