Tornado Reference : Tornado Tools
windsh [windsh] - The Tornado Shell
agentModeShow( ) - show the agent mode (*) (WindSh)
b( ) - set or display breakpoints (WindSh)
bd( ) - delete a breakpoint (WindSh)
bdall( ) - delete all breakpoints (WindSh)
bh( ) - set a hardware breakpoint (WindSh)
bootChange( ) - change the boot line (WindSh)
browse( ) - send a message to the browser asking it to browse an address (*) (WindSh)
c( ) - continue from a breakpoint (WindSh)
cd( ) - change the default directory (WindSh)
checkStack( ) - print a summary of each task's stack usage (WindSh)
classShow( ) - show information about a class of objects (*) (WindSh)
cplusCtors( ) - call static constructors (C++) (WindSh)
cplusDtors( ) - call static destructors (C++) (WindSh)
cplusStratShow( ) - show C++ static constructors calling strategy (*) (WindSh)
cplusXtorSet( ) - change C++ static constructor calling strategy (C++) (WindSh)
cret( ) - continue until the current subroutine returns (WindSh)
d( ) - display memory (WindSh)
devs( ) - list all system-known devices (WindSh)
h( ) - display or set the size of shell history (WindSh)
help( ) - print a synopsis of selected routines (WindSh)
hostShow( ) - display the host table (WindSh)
i( ) - print a summary of each task's TCB, task by task (WindSh)
iStrict( ) - print a summary of all task TCBs, as an atomic snapshot (*) (WindSh)
icmpstatShow( ) - display statistics for ICMP (WindSh)
ifShow( ) - display the attached network interfaces (WindSh)
inetstatShow( ) - display all active connections for Internet protocol sockets (WindSh)
intVecShow( ) - display the interrupt vector table (WindSh)
iosDevShow( ) - display the list of devices in the system (WindSh)
iosDrvShow( ) - display a list of system drivers (WindSh)
iosFdShow( ) - display a list of file descriptor names in the system (WindSh)
ipstatShow( ) - display IP statistics (WindSh)
l( ) - disassemble and display a specified number of instructions (WindSh)
ld( ) - load an object module into memory (WindSh)
lkAddr( ) - list symbols whose values are near a specified value (WindSh)
lkup( ) - list symbols (WindSh)
ls( ) - list the contents of a directory (WindSh)
m( ) - modify memory (WindSh)
memPartShow( ) - show partition blocks and statistics (WindSh)
memShow( ) - show system memory partition blocks and statistics (WindSh)
moduleIdFigure( ) - figure out module ID, given name or number (*) (WindSh)
moduleShow( ) - show the current status for all the loaded modules (WindSh)
mqPxShow( ) - show information about a POSIX message queue (*) (WindSh)
mRegs( ) - modify registers (WindSh)
msgQShow( ) - show information about a message queue (WindSh)
period( ) - spawn a task to call a function periodically (WindSh)
printErrno( ) - print the definition of a specified error status value (WindSh)
printLogo( ) - display the Tornado logo (WindSh)
pwd( ) - display the current default directory (WindSh)
quit( ) - shut down WindSh (*) (WindSh)
reboot( ) - reset network devices and transfer control to boot ROMs (WindSh)
repeat( ) - spawn a task to call a function repeatedly (WindSh)
routestatShow( ) - display routing statistics (WindSh)
s( ) - single-step a task (WindSh)
semPxShow( ) - show information about a POSIX semaphore (*) (WindSh)
semShow( ) - show information about a semaphore (WindSh)
shellHistory( ) - display or set the size of shell history (WindSh)
shellPromptSet( ) - change the shell prompt (WindSh)
show( ) - display information on a specified object (WindSh)
smMemPartShow( ) - show user's shared memory system partition blocks and statistics (*) (WindSh)
smMemShow( ) - show the shared memory system partition blocks and statistics (WindSh)
so( ) - single-step, but step over a subroutine (WindSh)
sp( ) - spawn a task with default parameters (WindSh)
sps( ) - spawn a task with default parameters, and leave it suspended (*) (WindSh)
sysResume( ) - reset the agent to tasking mode (*) (WindSh)
sysStatusShow( ) - show system context status (*) (WindSh)
sysSuspend( ) - set the agent to external mode and suspend the system (*) (WindSh)
taskCreateHookShow( ) - show the list of task create routines (WindSh)
taskDeleteHookShow( ) - show the list of task delete routines (WindSh)
taskIdDefault( ) - set the default task ID (WindSh)
taskIdFigure( ) - figure out the task ID of a specified task (*) (WindSh)
taskRegsShow( ) - display the contents of a task's registers (WindSh)
taskShow( ) - display task information from TCBs (WindSh)
taskSwitchHookShow( ) - show the list of task switch routines (WindSh)
taskWaitShow( ) - show information about the object a task is pended on (*) (WindSh)
tcpstatShow( ) - display all statistics for the TCP protocol (WindSh)
td( ) - delete a task (WindSh)
tftpInfoShow( ) - get TFTP status information (WindSh)
ti( ) - display complete information from a task's TCB (WindSh)
tr( ) - resume a task (WindSh)
ts( ) - suspend a task (WindSh)
tt( ) - display a stack trace of a task (WindSh)
tw( ) - print info about the object the given task is pending on (*) (WindSh)
udpstatShow( ) - display statistics for the UDP protocol (WindSh)
unld( ) - unload an object module by specifying a file name or module ID (WindSh)
version( ) - print VxWorks version information (WindSh)
w( ) - print a summary of each task's pending information, task by task (*) (WindSh)
wdShow( ) - show information about a watchdog (WindSh)
windsh [-c.plus] [-e.xecute expression] [-h.elp] [-n.oinit] [-p.oll value] [-q.uiet] [-s.tartup file] [-T.clmode] [-v.ersion] serverIdentifier
WindSh is the Tornado shell. The shell provides remote interactive access to the target run-time system through both a C interpreter and a Tcl interpreter.
The shell attaches to the target server specified by serverIdentifier (see tgtsvr).
To execute a list of commands when the shell starts, collect these commands in a file (startup script) and identify the file with the -s option.
The shell has vi-like editing capabilities and a history mechanism. The ESC key acts as a toggle between input mode and edit mode. History and editing capabilities are available regardless of which interpreter is in use.
The shell's C interpreter (prompt: -> ) can execute almost any expression using C operators, and can invoke compiled C functions on the target. Symbols are created as needed for shell expressions, and are added incrementally to the target symbol table. Interactive sessions use the C interpreter by default.
The shell's Tcl interpreter (prompt: tcl> ) executes Tcl functions, including both functions based on the WTX protocol and user-provided Tcl procedures. To enter the Tcl interpreter directly for an interactive session, start windsh with the option -T.The Tcl interpreter can also call C functions in the target; however, to establish the proper C environment for such calls you must use the shParse Tcl command. For example:
tcl> shParse sysClkRateGet() 60When the Tcl interpreter does not recognize a command, it passes it to the UNIX shell or the Windows command processor.
The Tornado shell includes a set of built-in routines. These routines are executed on the host, not in the context of the remote run-time. They are available from both the C interpreter and the Tcl interpreter. The most important built-in routines are i( ), ti( ), d( ), l( ), ts( ), tr( ), td( ), ld( ). In Tcl mode, type:tcl> set shellProcListto get the complete list of built-in functions.
windsh can be used in non-interactive sessions, by simply providing input on its standard input stream. For example:garonne% echo "i" | windsh vxsim1@garonne | grep tExcTask tExcTask _excTask 3b3fc0 0 PEND 9bee8 3b3dd8 0 0It is thus possible to execute a sequence of commands without entering interactive mode by redirecting input to a command file:garonne% windsh vxsim1@garonne < myOwnCommandFile
The shell supports target symbol completion and path completion using CTRL-D and TAB:
- To complete a symbol (or a path), begin typing the symbol and then press CTRL-D to get the list of symbols matching the word entered:
-> taskS^D taskSwitchHookAdd taskSpawn taskStackAllot taskSRSet taskSwitchTable taskSuspend taskSwitchHookDelete taskSRInit taskSwapHookAttach taskSwapHookAdd taskSwapHookDetach taskSwapReference taskSwapTable taskSwapHookDelete taskSrDefault taskSafe -> taskS- Select the symbol to complete by adding one or more characteres and press CTRL-D or TAB to fully complete the symbol. Once the symbol is fully completed, the synopsis of the target function (or the WindSh command) can be printed by pressing CTRL-D. It is also possible do display the HTML help of the function by pressing CTRL-W.
-> taskSp[TAB] -> taskSpawn ^D taskSpawn() - spawn a task int taskSpawn ( char *name, /* name of new task (stored at pStackBase) */ int priority, /* priority of new task */ int options, /* task option word */ int stackSize, /* size (bytes) of stack needed plus name */ FUNCPTR entryPt, /* entry point of new task */ int arg1, /* 1st of 10 req'd task args to pass to func */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10 ) -> taskSpawn
Some characters have special meanings to the shell:
- ?
- When used alone, this meta-character acts as a toggle to switch between the C and Tcl interpreters. In the C interpreter context, if the question mark is followed by text, that text is interpreted as a Tcl expression, but without entering the Tcl mode. For example:
-> ? wtxAgentModeGet AGENT_MODE_TASK- @
- This meta-character forces the C interpreter to treat the word that follows as a target symbol. This is useful when a target function has the same name as a shell built-in function. For example:
-> @d- >
- This meta-character redirects C-interpreter output. For example:
-> moduleShow >/tmp/loaded- <
- This meta-character redirects C-interpreter input.
-> < myOwnCommandFile
Developers often call routines that display data on standard output, or accept data from standard input. By default the standard output and input streams are redirected to the same window as WindSh. For example, in a default configuration of Tornado, the following is what see in the shell window from a printf( ) invocation:
-> printf ("Hello World!\n") Hello World! value = 13 = 0xd ->This behavior can be dynamicaly modified using the shConfig Tcl procedure:
-> ?shConfig SH_GET_TASK_IO off -> -> printf ("Hello World!\n") value = 13 = 0xd ->The shell duly reports the printf( ) result, indicating that 13 characters were printed. But the output itself goes elsewhere by default.
- NOTE
- The standard Input and Output are only redirected for the called function, if this function spawns other tasks, the Input and Output of the spawned tasks won't be redirected to WindSh. To have all IO redirected to WindSh, the following script can be used:
# Turn Off WindSh IO redirection ?shConfig SH_GET_TASK_IO off # Set stdin, stdout, and stderr to /vio/0 iff not already in use if { [shParse {tstz = open ("/vio/0",2,0)}] != -1 } { shParse {vf0 = tstz}; shParse {ioGlobalStdSet (0,vf0)} ; shParse {ioGlobalStdSet (1,vf0)} ; shParse {ioGlobalStdSet (2,vf0)} ; shParse {logFdSet (vf0);} shParse {printf ("Std I/O set here!\n")} } else { shParse {printf ("Std I/O unchanged.\n")} }
The windsh shell integrates a C++ demangler. If you type an overloaded function name, or if you type a method name with implementations in different classes, you will get a menu of choices. In the same way, doing a lkup( ) on a symbol displays the various classes in which this symbol name is defined. Examples:Consider the symbol "talk" as implemented by a hierarchy of classes:
-> lkup "talk" Animal::_talk(void) 0x00376054 text (cptest.o) Bear::_talk(void) 0x00376080 text (cptest.o) Bird::_talk(void) 0x003760a8 text (cptest.o) value = 0 = 0x0Consider the symbol "foo" as an overloaded function with two signatures:-> lkup "foo" _foo(int) 0x00375fd8 text (cptest.o) __GLOBAL_$I$foo(int) 0x003760f8 text (cptest.o) _foo(char *) 0x00375ffc text (cptest.o) value = 0 = 0x0Try to call "talk" and you'll be asked which one to invoke:-> talk 0: Animal::talk(void) 1: Bear::talk(void) 2: Bird::talk(void) Choose the number of the symbol to use: 1 growl! value = 0 = 0x0It is possible to select a specific demangler style by means of the Tcl variable shDemangleStyle. Three styles are currently available: gnu (the default), arm, and none (no demangling). For instance:-> ?set shDemangleStyle none noneDemangling can be reached through the Tcl routine:demangle <style> <symbol> <mode>The symbol is demangled using the given style and according to the given mode, if possible. If the symbol is not understood by the demangler, symbol is returned unmodified. mode is 0 for no demangling, 1 for short demangling, and 2 for full demangling.The shell always understands the gnu and arm styles. Other styles can be dynamically loaded to the shell with the -cplus option.
-> ?demangle gnu getRegString__FPCcPcT1 2 getRegString(char const *, char *, char *) -> ?demangle gnu getRegString__FPCcPcT1 1 getRegString ->
WindSh integrates an environment variables mechanism to configure the shell's behavior. The shConfig( ) command allows you to display and set the controls that change the shell's behavior. This command affects only instanciation of the shell where the command is applied. At startup WindSh begins by looking for a file called .wind/windsh.tcl under the home directory. If the file exists, the shell reads and executes its contents as Tcl expressions before beginning to interact. This file can be used to initialize WindSh environment variables.The following example shell initialization file turns off WindSh IO redirection and sets the Load path:
# Turn Off WindSh IO redirection shConfig SH_GET_TASK_IO off # Set Load path shConfig LD_PATH "C:/ProjectX/lib/objR4650gnutest/;C:/ProjectY/lib/objR4650gnuvx/"
- DSM_HEX_MOD [on|off]
- This configuration parameter allows you to set the disassembling "symbolic + offset" mode to "on" or "off". While set to "off", the "symbolic + offset" address representation is turned on and adresses inside the disassembled instructions are given in terms of a "symbol name + offset". If turned to "on", these adresses are given their hexadecimal value.
- SH_GET_TASK_IO [on|off]
- Set the I/O redirection mode for the called function. If SH_GET_TASK_IO is set to "on" then input and output of called functions is redirected to WindSh.
- LD_CALL_XTORS [target|on|off]
- Set the C++ strategy related to constructors and destructors. If LD_CALL_XTORS is set to "target" then WindSh uses the strategy set on the target using cplusXtorSet( ). If LD_CALL_XTORS is set to "on", the C++ strategy is set to automatic (only for the current instanciation of WindSh); otherwise the C++ strategy is set to manual.
- LD_SEND_MODULES [on|off]
- Set the load mode. If LD_SEND_MODULES is set to "on" then the module is transfered to the target server, otherwise the target server directly accesses the module.
- LD_COMMON_MATCH_ALL [on|off]
- Set the loader behavior for common symbols. If LD_COMMON_MATCH_ALL is set to "on", then the loader trieso match common symbols against existing symbols. If a symbol with the same name is already defined, the loader takes its address. Otherwise, the loader creates a new entry. If LD_COMMON_MATCH_ALL is set to "off", then the loader never tries to search for an existing symbol. It creates an entry for each common symbol.
- LD_PATH [path]
- Set the search path for modules, the separator is ;. WindSh first checks whether the file exists in current directory. If it exists it loads it. Otherwise, each directory in the path is searched for the given module.
-> ?shConfig SH_GET_TASK_IO = on LD_CALL_XTORS = target LD_SEND_MODULES = on LD_COMMON_MATCH_ALL = on LD_PATH = C:/ProjectX/lib/objR4650gnutest/;C:/ProjectY/lib/objR4650gnuvx/ -> ?shConfig LD_CALL_XTORS on -> ?shConfig LD_CALL_XTORS LD_CALL_XTORS = on ->
- -c C++_library_name | -cplus C++_library_name
- Select a C++ support other than the built-in if the shell is built with dynamic library support.
- -e expression | -execute expression
- Execute a Tcl expression after initialization. To execute a Tcl startup script, specify an expression using the Tcl source command.
- -h | -help
- Print a help message about windsh usage and its options.
- -n | -noinit
- Do not read the normal Tcl initialization files (see FILES section) when the shell starts.
- -p value | -poll value
- Set polling interval (in msec) for WindSh internal event list. Default is 200 msec. This event list is filled by the asynchronous event notification, no request is made to the Target Server.
- -q | -quiet
- Turns on quiet mode. In quiet mode, commands read from a script are not printed as they are read. This also affects command printing when windsh is started noninteractively (e.g., used in a filter or with standard input redirected).
- -s file | -startup file
- Execute the commands listed in file after initialization. These commands are interpreted by the shell's C interpreter.
- -T | -Tclmode
- Start session in Tcl mode.
- -v | -version
- Print Tornado version.
- WIND_BASE
- root location of the Tornado tree.
- WIND_REGISTRY
- host on which the Tornado Registry daemon runs (see wtxregd).
The following resource files are required by the shell's Tcl interpreter:
- $WIND_BASE/host/resource/tcl/shell.tcl
- WindSh Tcl entry point.
- $WIND_BASE/host/resource/tcl/shellDbgCmd.tcl
- Tcl implementation of WindSh debug commands.
- $WIND_BASE/host/resource/tcl/shellMemCmd.tcl
- Tcl implementation of WindSh memory commands.
- $WIND_BASE/host/resource/tcl/shellShowCmd.tcl
- Tcl implementation of WindSh show commands.
- $WIND_BASE/host/resource/tcl/shellTaskCmd.tcl
- Tcl implementation of WindSh task commands.
- $WIND_BASE/host/resource/tcl/shellUtilCmd.tcl
- Tcl implementation of WindSh util commands.
- $WIND_BASE/host/resource/tcl/shelcore.tcl
- Tcl implementation of the shell core routines.
- $WIND_BASE/host/resource/tcl/sh-arch.tcl
- Target architecture-specific constants for shell Tcl implementation.
- $WIND_BASE/host/resource/tcl/hostShowCore.tcl
- Tcl implementation of the hostShow( ) core routine.
- $WIND_BASE/host/resource/tcl/icmpstatShowCore.tcl
- Tcl implementation of the icmpstatShow( ) core routine.
- $WIND_BASE/host/resource/tcl/ifShowCore.tcl
- Tcl implementation of the ifShow( ) core routine.
- $WIND_BASE/host/resource/tcl/inetstatShowCore.tcl
- Tcl implementation of the inetstatShow( ) core routine.
- $WIND_BASE/host/resource/tcl/ipstatShowCore.tcl
- Tcl implementation of the ipstatShow( ) core routine.
- $WIND_BASE/host/resource/tcl/routestatShowCore.tcl
- Tcl implementation of the routestatShow( ) core routine.
- $WIND_BASE/host/resource/tcl/taskHookShowCore.tcl
- Tcl implementation of the taskCreateHookShow( ), taskDeleteHookShow( ), taskSwitchHookShow( ), taskRegsShow( ) core routines.
- $WIND_BASE/host/resource/tcl/tcpstatShowCore.tcl
- Tcl implementation of the tcpstatShow( ) core routine.
- $WIND_BASE/host/resource/tcl/tftpInfoShowCore.tcl
- Tcl implementation of the tftpInfoShow( ) core routine.
- $WIND_BASE/host/resource/tcl/udpstatShowCore.tcl
- Tcl implementation of the udpstatShow( ) core routine.
windsh, tgtsvr, launch, browser, Tornado User's Guide
Commands marked with (*) have no equivalents in the VxWorks shell.
agentModeShow( ) - show the agent mode (*) (WindSh)
int agentModeShow (void)
This command shows the mode of the target agent. There are two agent modes: system and task.
N/A.
windsh, sysResume( ), sysSuspend( ), Tornado User's Guide: Shell
b( ) - set or display breakpoints (WindSh)
STATUS b ( INSTR * addr, /* where to set breakpoint, or 0 = display all breakpoints */ int task /* task for which to set breakpoint 0 = set all tasks */ )
This command sets or displays breakpoints. To display the list of currently active breakpoints, call b( ) without arguments:
-> bThe list shows the address, task, and pass count of each breakpoint.To set a breakpoint with b( ), include the address, which can be specified numerically or symbolically with an optional offset. The task argument is optional:
-> b addr [,task ,count]]If task is zero or omitted, the breakpoint will apply to all breakable tasks. If count is zero or omitted, the breakpoint will occur every time it is hit. If count is specified, the break will not occur until the count +1st time an eligible task hits the breakpoint (i.e., the breakpoint is ignored the first count times it is hit).Individual tasks can be unbreakable, in which case breakpoints that otherwise would apply to a task are ignored. Tasks can be spawned unbreakable by specifying the task option VX_UNBREAKABLE. Tasks can also be set unbreakable or breakable by resetting VX_UNBREAKABLE with the routine taskOptionsSet( ).
When the agent is in external mode, the b( ) command sets system breakpoints that will halt the kernel. The task argument is ignored.
OK, or ERROR if addr is illegal or the breakpoint table is full.
windsh, bd( ), Tornado User's Guide: Shell
bd( ) - delete a breakpoint (WindSh)
STATUS bd ( INSTR * addr, /* address of breakpoint to delete */ int task /* task for which to delete breakpoint 0 = delete for all */ )
This command deletes a specified breakpoint.
To execute, enter:
-> bd addr [,task]If task is omitted or zero, the breakpoint will be removed for all tasks. If the breakpoint applies to all tasks, removing it for only a single task will be ineffective. It must be removed for all tasks and then set for just those tasks desired.
OK, or ERROR if there is no breakpoint at the specified address.
windsh, b( ), bdall( ), Tornado User's Guide: Shell
bdall( ) - delete all breakpoints (WindSh)
STATUS bdall (void)
This routine removes all breakpoints.
To execute, enter:
-> bdallAll breakpoints for all tasks are removed.
OK, always.
windsh, bd( ), Tornado User's Guide: Shell
bh( ) - set a hardware breakpoint (WindSh)
STATUS bh ( INSTR * addr, /* where to set breakpoint, or 0 = display all breakpoints */ int access /* access type (arch dependant) */ )
This command is used to set a hardware breakpoint. If the architecture allows it, this function will add the breakpoint to the list of breakpoints and set the hardware breakpoint register(s). For more information, see the manual entry for b( ).
The types of hardware breakpoints vary with the architectures. Genrerally, a hardware breakpoint can be a data breakpoint or an instruction breakpoint.
OK, or ERROR if addr is illegal or the breakpoint table is full or the hardware breakpoint breakpoint table is full.
windsh, b( ), bd( ), Tornado User's Guide: Shell
bootChange( ) - change the boot line (WindSh)
STATUS bootChange (void)
This command changes the boot line used in the boot ROMs. After changing the boot parameters, you can reboot the target with the reboot( ) command. When the system reboots, the shell is restarted automatically.
This command stores the new boot line in non-volatile RAM, if the target has it.
OK, or ERROR if boot line not changed.
windsh, Tornado User's Guide: Shell
browse( ) - send a message to the browser asking it to browse an address (*) (WindSh)
void browse ( int objId /* system-object ID */ )
Send a protocol message to the Tornado browser, requesting a display of the system object whose ID is specified by the argument objId. Browser displays are available for all the system objects recognized by show( ), but are more convenient because they can be updated automatically and scrolled independently.
If the browser is not executing in update mode, this WindSh primitive has no visible effect.
There is no target-resident version of browse( ).
N/A
windsh, show( ), browser, Tornado User's Guide: Shell
c( ) - continue from a breakpoint (WindSh)
STATUS c ( int task /* task that should proceed from breakpoint */ )
This routine continues the execution of a task that has stopped at a breakpoint.
To execute, enter:
-> c [task]If task is omitted or zero, the last task referenced is assumed.If the agent is in external mode, the system is resumed. In this case task is ignored.
OK, or ERROR if the specified task does not exist.
windsh, tr( ), Tornado User's Guide: Shell
cd( ) - change the default directory (WindSh)
STATUS cd ( char * name /* new directory name */ )
This command sets the default directory to name on the host where windsh is running.
To change to a different directory, specify one of the following:
- An entire path name. In Windows, the directory path must be prefixed with a drive name and colon.
- A directory name starting with any of the following; note that for Windows hosts, subdirectories can be separated with either a slash ( / ) or backslash ( \ ):
\ibe UNIX: ~ / .. . Windows: \ / .. .
- A directory name to be appended to the current default directory.
On a UNIX host, the following changes the directory to ~leslie/target/config:
-> cd "~leslie/target/config"On a Windows host, the following lines are equivalent and change the directory to c:\leslie\target\config:-> cd "c:\\leslie\\target\\config" -> cd "c:/leslie/target/config"Notice that the rules for C strings require that backslashes be doubled.
OK or ERROR.
checkStack( ) - print a summary of each task's stack usage (WindSh)
void checkStack ( int taskNameOrId /* task name or task ID; 0 = summarize all */ )
This command displays a summary of stack usage for a specified task, or for all tasks if no argument is given. The summary includes the total stack size (SIZE), the current number of stack bytes used (CUR), the maximum number of stack bytes used (HIGH), and the number of bytes never used at the top of the stack (MARGIN = SIZE - HIGH). For example:
-> checkStack t28 NAME ENTRY TID SIZE CUR HIGH MARGIN ------------ ------------ -------- ----- ----- ----- ------ t28 _foo 23e1c78 9208 832 3632 5576The maximum stack usage is determined by scanning down from the top of the stack for the first byte whose value is not 0xee. In VxWorks, when a task is spawned, all bytes of a task's stack are initialized to 0xee.
It is possible for a task to write beyond the end of its stack, but not write into the last part of its stack. This will not be detected by checkStack( ).
N/A
windsh, Tornado User's Guide: Shell
classShow( ) - show information about a class of objects (*) (WindSh)
void classShow ( int classID )
VxWorks kernel objects, such as semaphores, message queues, and so on, are organized into distinct classes. All objects of each class are anchored in a class ID stored as a global variable. Given any such class ID, classShow( ) displays overall information about the class, including the maximum object size, and the number of objects allocated, deallocated, initialized, and terminated in that class. Because all the class ID globals are recorded using a consistent naming convention, you can obtain a list of the class IDs available at any time with the following:
-> lkup "ClassId"There is no target-resident version of classShow( ).
N/A
windsh, Tornado User's Guide: Shell
cplusCtors( ) - call static constructors (C++) (WindSh)
void cplusCtors ( const char * moduleName /* name of loaded module */ )
This function is used to call static constructors under the manual strategy (see cplusXtorSet( )). moduleName is the name of an object module that was "munched" before loading. If moduleName is 0, then all static constructors, in all modules loaded by the target server loader, are called.
The following example shows how to initialize the static objects in modules called applx.out and apply.out.
-> cplusCtors "applx.out" value = 0 = 0x0 -> cplusCtors "apply.out" value = 0 = 0x0The following example shows how to initialize all the static objects that are currently loaded, with a single invocation of cplusCtors( ):
-> cplusCtors value = 0 = 0x0
N/A
windsh, cplusXtorSet( ), Tornado User's Guide: Shell
cplusDtors( ) - call static destructors (C++) (WindSh)
void cplusDtors ( const char * moduleName /* name of loaded module */ )
This function is used to call static destructors under the manual strategy (see cplusXtorSet( )). moduleName is the name of an object module that was "munched" before loading. If moduleName is 0, then all static destructors, in all modules loaded by the target server loader, are called.
The following example shows how to destroy the static objects in modules called applx.out and apply.out:
-> cplusDtors "applx.out" value = 0 = 0x0 -> cplusDtors "apply.out" value = 0 = 0x0The following example shows how to destroy all the static objects that are currently loaded, with a single invocation of cplusDtors:
-> cplusDtors value = 0 = 0x0
N/A
windsh, cplusXtorSet( ), Tornado User's Guide: Shell
cplusStratShow( ) - show C++ static constructors calling strategy (*) (WindSh)
void cplusStratShow (void)
This command shows the current C++ static constructor calling strategy. There are two static constructor calling strategies: automatic and manual.
-> cplusStratShow C++ ctors/dtors strategy set to MANUAL value = 0 = 0x0
N/A
windsh, cplusXtorsSet( ), Tornado User's Guide: Shell
cplusXtorSet( ) - change C++ static constructor calling strategy (C++) (WindSh)
void cplusXtorSet ( int strategy /* constructor calling strategy */ )
This command sets the C++ static constructor calling strategy to strategy. The default strategy is 0.
There are two static constructor calling strategies: automatic and manual represented by the following numeric codes:
Under the manual strategy, a module's static constructors and destructors are called by cplusCtors( ) and cplusDtors( ), which are themselves invoked manually.
Strategy Code manual 0 automatic 1 Under the automatic strategy, a module's static constructors are called as a side-effect of loading the module using the target server loader. A module's static destructors are called as a side-effect of unloading the module.
N/A
windsh, cplusStratShow( ). cplusCtors( ), cplusDtors( ), Tornado User's Guide: Shell
cret( ) - continue until the current subroutine returns (WindSh)
STATUS cret ( int task /* task to continue, 0 = default */ )
This routine places a breakpoint at the return address of the current subroutine of a specified task, then continues execution of that task.
To execute enter:
-> cret [task]If task is omitted or zero, the last task referenced is assumed.When the breakpoint is hit, information about the task will be printed in the same format as in single stepping. The breakpoint is automatically removed when hit, or if the task hits another breakpoint first.
OK or ERROR if there is no such task.
windsh, so( ), Tornado User's Guide: Shell
d( ) - display memory (WindSh)
void d ( void * adrs, /* address to display (if 0, display next block */ int nunits, /* number of units to print (if 0, use default) */ int width /* width of displaying unit (1, 2, 4, 8) */ )
This command displays the contents of memory, starting at adrs. If adrs is omitted or zero, d( ) displays the next memory block, starting from where the last d( ) command completed.
Memory is displayed in units specified by width. If nunits is omitted or zero, the number of units displayed defaults to last use. If nunits is non-zero, that number of units is displayed and that number then becomes the default. If width is omitted or zero, it defaults to the previous value. If width is an invalid number, it is set to 1. The valid values for width are 1, 2, 4, and 8. The number of units d( ) displayed is rounded up to the nearest number of full lines.
N/A
windsh, m( ), Tornado User's Guide: Shell
devs( ) - list all system-known devices (WindSh)
void devs (void)
This command displays a list of all devices known to the I/O system.
N/A
windsh, iosDevShow( ), Tornado User's Guide: Shell
h( ) - display or set the size of shell history (WindSh)
void h ( int size /* 0 = display, >0 = set history to new size */ )
This command displays or sets the size of VxWorks shell history. If no argument is specified, shell history is displayed. If size is specified, that number of the most recent commands is saved for display. The value of size is initially 20.
N/A
windsh, shellHistory( ), Tornado User's Guide: Shell
help( ) - print a synopsis of selected routines (WindSh)
void help (void)
This command prints the following list of the calling sequences for commonly used routines.
help Print this list h [n] Print (or set) shell history i [task] Summary of tasks' TCBs ti task Complete info on TCB for task sp adr,args... Spawn a task, pri=100, opt=0, stk=20000 sps adr,args... Spawn a task, pri=100, opt=0, stk=20000 and leave it suspended td task Delete a task ts task Suspend a task tr task Resume a task d [adr[,nunits[,width]]] Display memory m adr[,width] Modify memory mRegs [reg[,task]] Modify a task's registers interactively version Print VxWorks version info, and boot line b Display breakpoints b addr[,task[,count]] Set breakpoint bd addr[,task] Delete breakpoint bdall [task] Delete all breakpoints c [task[,addr[,addr1]]] Continue from breakpoint s [task[,addr[,addr1]]] Single step l [adr[,nInst]] List disassembled memory tt [task] Do stack trace on task bh addr[,access[,task[,count]] Set hardware breakpoint (if supported by the architecture) devs List devices cd "path" Set current working path pwd Print working path ls ["path"[,long]] List contents of directory ld [syms[,noAbort][,"name"]] Load stdin, or file, into memory (syms = add symbols to table: -1 = none, 0 = globals, 1 = all) lkup ["substr"] List symbols in system symbol table lkAddr address List symbol table entries near address printErrno value Print the name of a status value period secs,adr,args... Spawn task to call function periodically repeat n,adr,args... Spawn task to call function n times (0=forever) NOTE: Arguments specifying <task> can be either task ID or name.
N/A
windsh, Tornado User's Guide: Shell
hostShow( ) - display the host table (WindSh)
void hostShow (void)
This routine prints a list of remote hosts, along with their Internet addresses and aliases.
N/A
windsh Tornado User's Guide: Shell
i( ) - print a summary of each task's TCB, task by task (WindSh)
void i ( int taskNameOrId /* task name or task ID; 0 = summarize all */ )
This command displays a synopsis of all tasks in the system, or a specified task if the argument is given. The ti( ) command provides more complete information on a specific task.
Both i( ) and ti( ) use taskShow( ); see the documentation for taskShow( ) for a description of the output format.
-> i NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY ---------- ---------- -------- --- --------- ------- -------- ----- ----- tExcTask _excTask 20fcb00 0 PEND 200c5fc 20fca6c 0 0 tLogTask _logTask 20fb5b8 0 PEND 200c5fc 20fb520 0 0 tRlogind _rlogind 20f3f90 2 PEND 2038614 20f3db0 0 0 tTelnetd _telnetd 20f2124 2 PEND 2038614 20f2070 0 0 tNetTask _netTask 20f7398 50 PEND 2038614 20f7340 0 0 value = 57 = 0x39 = '9'
This command should be used only as a debugging aid, since the information is obsolete by the time it is displayed.
N/A
windsh, iStrict( ), ti( ), taskShow( ), Tornado User's Guide: Shell
iStrict( ) - print a summary of all task TCBs, as an atomic snapshot (*) (WindSh)
void iStrict (void)
This command produces a display identical to that of i( ), but guarantees consistency by retrieving all data in a single target transaction.
This command should be used only as a debugging aid, since the information is obsolete by the time it is displayed.
N/A
windsh, i( ), Tornado User's Guide: Shell
icmpstatShow( ) - display statistics for ICMP (WindSh)
void icmpstatShow (void)
This routine displays statistics for the ICMP (Internet Control Message Protocol) protocol.
N/A
windsh Tornado User's Guide: Shell
ifShow( ) - display the attached network interfaces (WindSh)
void ifShow ( char * ifName /* name of the interface to show */ )
This routine displays the attached network interfaces for debugging and diagnostic purposes. If ifName is given, only the interfaces belonging to that group are displayed. If ifName is omitted, all attached interfaces are displayed.
For each interface selected, the following are shown: Internet address, point-to-point peer address (if using SLIP), broadcast address, netmask, subnet mask, Ethernet address, route metric, maximum transfer unit, number of packets sent and received on this interface, number of input and output errors, and flags (such as loopback, point-to-point, broadcast, promiscuous, ARP, running, and debug).
The following call displays all interfaces whose names begin with "ln", (such as "ln0", "ln1", and "ln2"):
-> ifShow "ln"The following call displays just the interface "ln0":-> ifShow "ln0"
N/A
windsh Tornado User's Guide: Shell
inetstatShow( ) - display all active connections for Internet protocol sockets (WindSh)
void inetstatShow (void)
This routine displays a list of all active Internet protocol sockets in a format similar to the UNIX netstat command.
N/A
windsh Tornado User's Guide: Shell
intVecShow( ) - display the interrupt vector table (WindSh)
void intVecShow ( int vector /* interrupt vector number or -1 to display the whole */ /* vector table */ )
This routine displays information about the given vector or the whole interrupt vector table if vector is equal to -1.
OK or ERROR.
windsh, Tornado User's Guide: Shell
iosDevShow( ) - display the list of devices in the system (WindSh)
void iosDevShow (void)
This routine displays a list of all devices in the device list.
N/A
windsh, devs( ), Tornado User's Guide: Shell
iosDrvShow( ) - display a list of system drivers (WindSh)
void iosDrvShow (void)
This routine displays a list of all drivers in the driver list.
N/A
windsh, Tornado User's Guide: Shell
iosFdShow( ) - display a list of file descriptor names in the system (WindSh)
void iosFdShow (void)
This routine displays a list of all file descriptors in the system.
Unlike the target-resident version of iosFdShow( ), this routine does not mark file descriptors with the stdio devices they are attached to.
N/A
windsh, Tornado User's Guide: Shell
ipstatShow( ) - display IP statistics (WindSh)
void ipstatShow ( BOOL zero /* TRUE = reset statistics to 0 */ )
This routine displays detailed statistics for the IP protocol.
N/A
windsh Tornado User's Guide: Shell
l( ) - disassemble and display a specified number of instructions (WindSh)
void l ( INSTR * addr, /* address of first instruction to disassemble if 0, */ /* from the last instruction disassembled on the */ /* call to l */ int count /* number of instruction to disassemble if 0, use the same */ /* the last call to l */ )
This routine disassembles a specified number of instructions and displays them on standard output. If the address of an instruction is entered in the system symbol table, the symbol will be displayed as a label for that instruction. Also, addresses in the opcode field of instructions will be displayed symbolically.
To execute, enter:
-> l [address [,count]]If address is omitted or zero, disassembly continues from the previous address. If count is omitted or zero, the last specified count is used (initially 10). As with all values entered via the shell, the address may be typed symbolically.
N/A
windsh, Tornado User's Guide: Shell
ld( ) - load an object module into memory (WindSh)
MODULE_ID ld ( int syms, /* -1, 0, or 1 */ BOOL noOp, /* ignored */ char * name /* name of object module, NULL = standard input */ )
This command loads an object module from a file or from standard input. The object module may be in any format for which the target server has an OMF reader. External references in the module are resolved during loading. The syms parameter determines how symbols are loaded; possible values are:
0 - Add global symbols to the system symbol table.
1 - Add global and local symbols to the system symbol table.
-1 - Add no symbols to the system symbol table.The second parameter noOp is present for compatibility with the target-resident version of ld( ), but is not used by this implementation.
During load operation (progress indicator moving), a CTRL+C call cancels the current load, and unloads the module.
Errors during loading (e.g., externals undefined, too many symbols, etc.) are ignored.
The normal way of using ld( ) is to load all symbols (syms = 1) during debugging and to load only global symbols later.
The following example loads test.o with all symbols:
-> ld 1,0,"/usr/someone/devt/test.o"
MODULE_ID, or NULL if there are too many symbols, the object file format is invalid, or there is an error reading the file.
windsh, Tornado User's Guide: Shell
lkAddr( ) - list symbols whose values are near a specified value (WindSh)
void lkAddr ( unsigned int addr /* address around which to look */ )
This command lists the symbols in the system symbol table that are near a specified value. The symbols that are displayed include:
- symbols whose values are immediately less than the specified value
- symbols with the specified value
- succeeding symbols, until at least 12 symbols have been displayed
This command also displays symbols that are local, i.e., symbols found in the system symbol table only because their module was loaded by ld( ).
N/A
windsh, Tornado User's Guide: Shell
lkup( ) - list symbols (WindSh)
void lkup ( char * substr /* substring to match */ )
This command lists all symbols in the system symbol table whose names contain the string substr. If substr is omitted or is 0, a short summary of symbol table statistics is displayed. If substr is the empty string (""), all symbols in the table are listed.
This command also displays symbols that are local, i.e., symbols found in the system symbol table only because their module was loaded by ld( ).
N/A
windsh, Tornado User's Guide: Shell
ls( ) - list the contents of a directory (WindSh)
STATUS ls ( char * dirName, /* name of dir to list */ BOOL doLong /* if TRUE, do long listing */ )
This command lists the contents of a directory in one of two formats. If doLong is FALSE, only the names of the files (or subdirectories) in the specified directory are displayed. If doLong is TRUE, then the file name, size, date, and time are displayed.
The dirName parameter specifies which directory to list. If dirName is omitted or NULL, the current working directory is listed.
OK or ERROR.
windsh, Tornado User's Guide: Shell
m( ) - modify memory (WindSh)
void m ( void * adrs, /* address to change */ int width /* width of unit to be modified (1, 2, 4, 8) */ )
This command prompts the user for modifications to memory in byte, short word, or long word specified by width, starting at the specified address. It displays each address and the current contents of that address, in turn. If adrs or width is zero or absent, it defaults to the previous value. The user can respond in one of several ways:
- RETURN
- Do not change this address, but continue, prompting at the next address.
- number
- Set the content of this address to number.
- . (dot)
- Do not change this address, and quit.
- EOF
- Do not change this address, and quit.
All numbers entered and displayed are in hexadecimal.
N/A
windsh, Tornado User's Guide: Shell
memPartShow( ) - show partition blocks and statistics (WindSh)
STATUS memPartShow ( PART_ID partId, /* partition ID */ int type /* 0 = statistics, 1 = statistics & list */ )
This command displays statistics about the available and allocated memory in a specified memory partition. It shows the number of bytes, the number of blocks, and the average block size in both free and allocated memory, and also the maximum block size of free memory. It also shows the number of blocks currently allocated and the average allocated block size.
In addition, if type is 1, the command displays a list of all the blocks in the free list of the specified partition.
OK or ERROR.
windsh, memShow( ), browse( ) Tornado User's Guide: Shell
memShow( ) - show system memory partition blocks and statistics (WindSh)
void memShow ( int type /* 1 = list all blocks in the free list */ )
This command displays statistics about the available and allocated memory in the system memory partition. It shows the number of bytes, the number of blocks, and the average block size in both free and allocated memory, and also the maximum block size of free memory. It also shows the number of blocks currently allocated and the average allocated block size.
In addition, if type is 1, the command displays a list of all the blocks in the free list of the system partition.
-> memShow 1 FREE LIST: num addr size --- ---------- ---------- 1 0x3fee18 16 2 0x3b1434 20 3 0x4d188 2909400 SUMMARY: status bytes blocks avg block max block ------ --------- -------- ---------- ---------- current free 2909436 3 969812 2909400 alloc 969060 16102 60 - cumulative alloc 1143340 16365 69 -
N/A
windsh, memPartShow( ), Tornado User's Guide: Shell
moduleIdFigure( ) - figure out module ID, given name or number (*) (WindSh)
int moduleIdFigure ( int modNameOrId /* target module ID or name */ )
The list of module IDs known to the target server is searched for the given number; if found, it is returned (thus verifying its validity). Otherwise, if the given address points to a string that matches an existing module name, that module's ID is returned. If all this fails, ERROR (-1) is returned.
There is no target-resident version of moduleIdFigure( ).
A module ID, or ERROR.
windsh, Tornado User's Guide: Shell
moduleShow( ) - show the current status for all the loaded modules (WindSh)
STATUS moduleShow ( char * moduleNameOrId /* name or ID of the module to show */ )
This command displays a list of the currently loaded modules and some information about where the modules are loaded.
The specific information displayed depends on the format of the object modules. In the case of a.out and ECOFF object modules, moduleShow( ) displays the start of the text, data, and BSS segments.
If moduleShow( ) is called with no arguments, a summary list of all loaded modules is displayed. It can also be called with an argument, moduleNameOrId, which can be either the name of a loaded module or a module ID. If it is called with either of these, more information about the specified module will be displayed.
OK or ERROR.
windsh, Tornado User's Guide: Shell
mqPxShow( ) - show information about a POSIX message queue (*) (WindSh)
STATUS mqPxShow ( mqd_t mqDesc /* POSIX message queue to display */ )
This command displays the state of a POSIX message queue.
A summary of the state of the message queue is displayed as follows:
Message queue name : exampleMessageQueue No. of messages in queue : 2 Maximum no. of messages : 16 Maximum message size : 16
OK or ERROR.
windsh, show( ), browse( ), Tornado User's Guide: Shell
mRegs( ) - modify registers (WindSh)
STATUS mRegs ( char * regName, /* register name, NULL for all */ int taskNameOrId /* task name or task ID, 0 = default task */ )
This command modifies the specified register for the specified task. If taskNameOrId is omitted or zero, the last task referenced is assumed. If the specified register is not found, it prints out the valid register list and returns ERROR. If no register is specified, it sequentially prompts the user for new values for a task's registers. It displays each register and the current contents of that register, in turn. The user can respond in one of several ways:
- RETURN
- Do not change this register, but continue, prompting at the next register.
- number
- Set this register to number.
- . (dot)
- Do not change this register, and quit.
- EOF
- Do not change this register, and quit.
All numbers are entered and displayed in hexadecimal, except floating-point values, which may be entered in double precision.
OK, or ERROR if the task or register does not exist.
windsh, m( ), Tornado User's Guide: Shell
msgQShow( ) - show information about a message queue (WindSh)
STATUS msgQShow ( MSG_Q_ID msgQId, /* message queue to display */ int level /* 0 = summary, 1 = details */ )
This command displays the state and optionally the contents of a message queue.
A summary of the state of the message queue is displayed as follows:
Message Queue Id : 0x3f8c20 Task Queuing : FIFO Message Byte Len : 150 Messages Max : 50 Messages Queued : 0 Receivers Blocked : 1 Send timeouts : 0 Receive timeouts : 0If level is 1, then more detailed information will be displayed. If messages are queued, they will be displayed as follows:Messages queued: # local adrs len value 1 0x3d7c0c 14 00 3c a1 e1 48 65 6c 6c 6f 31 00 ee ee ee *....Hello.....*If tasks are blocked on the queue, they will be displayed as follows:Receivers blocked: NAME TID PRI DELAY ---------- -------- --- ----- tExcTask 3fd678 0 21
OK or ERROR.
windsh, browse( ), Tornado User's Guide: Shell
period( ) - spawn a task to call a function periodically (WindSh)
int period ( int secs, /* period in seconds */ FUNCPTR func, /* function to call repeatedly */ int arg1, /* first of eight args to pass to func */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8 )
This command spawns a task that repeatedly calls a specified target-resident function, with up to eight of its arguments, delaying the specified number of seconds between calls.
The task is spawned using the sp( ) command. See the description of sp( ) for details about priority, options, stack size, and task ID.
A task ID, or ERROR if the task cannot be spawned.
windsh, sp( ), Tornado User's Guide: Shell
printErrno( ) - print the definition of a specified error status value (WindSh)
void printErrno ( int errNo /* status code whose name is to be printed */ )
This command displays the error-status string, corresponding to a specified error-status value. It is only useful if the error-status symbol table has been built and included in the system. An errNo equal to zero will display the error number set by the last function called from WindSh.
N/A
windsh, Tornado User's Guide: Shell
printLogo( ) - display the Tornado logo (WindSh)
void printLogo (void)
This command displays the Tornado banner seen when WindSh begins executing. It also displays the Tornado version number.
N/A
windsh, Tornado User's Guide: Shell
pwd( ) - display the current default directory (WindSh)
void pwd (void)
This command displays the current working device/directory as known to WindSh.
N/A
windsh, Tornado User's Guide: Shell
quit( ) - shut down WindSh (*) (WindSh)
void quit (void)
Shut down the executing session of WindSh.
There is no target-resident version of quit( ).
N/A
windsh, Tornado User's Guide: Shell
reboot( ) - reset network devices and transfer control to boot ROMs (WindSh)
void reboot (void)
This WindSh primitive sends a restart message to the target server, which in turn passes it on to the target agent. This causes the target to reboot, and the target server to reattach. After waiting one second, WindSh also restarts.
N/A
windsh, Tornado User's Guide: Shell
repeat( ) - spawn a task to call a function repeatedly (WindSh)
int repeat ( int n, /* no. of times to call func (0=forever) */ FUNCPTR func, /* function to call repeatedly */ int arg1, /* first of eight args to pass to func */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8 )
This command spawns a task that calls a specified function n times, with up to eight of its arguments. If n is 0, the command is called endlessly, or until the spawned task is deleted.
The task is spawned using sp( ). See the description of sp( ) for details about priority, options, stack size, and task ID.
A task ID, or ERROR if the task cannot be spawned.
windsh, sp( ), Tornado User's Guide: Shell
routestatShow( ) - display routing statistics (WindSh)
void routestatShow (void)
This routine displays routing statistics.
N/A
windsh Tornado User's Guide: Shell
s( ) - single-step a task (WindSh)
STATUS s ( int taskNameOrId, /* task to step; 0 = use default */ INSTR * addr0, /* lower bound of range; 0 = next instr */ INSTR * addr1 /* ;upper bound of range; 0 = next instr */ )
This command single-steps a task that is stopped at a breakpoint.
To execute, enter:
-> s [task [,addr0[,addr1]]]If task is omitted or zero, the last task referenced is assumed. If addr0 is non-zero, the task begins stepping at the next instruction at or above addr0; if addr1 is non-zero, the task next suspends at the next instruction at or above addr1.If the agent is in system mode, the system context will be stepped. In this event, the task parameter is ignored.
OK, or ERROR if the task cannot be found or the task is not suspended.
windsh, Tornado User's Guide: Shell
semPxShow( ) - show information about a POSIX semaphore (*) (WindSh)
STATUS semPxShow ( sem_t semDesc /* POSIX semaphore to display */ )
This command displays the state of a POSIX semaphore.
A summary of the state of a named semaphore is displayed as follows:
Semaphore name : namedSem sem_open() count : 2 Semaphore value : 0 No. of blocked tasks : 1A summary of the state of an unnamed semaphore is displayed as follows:Semaphore value : 0 No. of blocked tasks : 1
OK or ERROR.
windsh, show( ), browse( ), Tornado User's Guide: Shell
semShow( ) - show information about a semaphore (WindSh)
STATUS semShow ( SEM_ID semId, /* semaphore to display */ int level /* 0 = summary, 1 = details */ )
This command displays the state and optionally the pended tasks of a semaphore.
A summary of the state of the semaphore is displayed as follows:
Semaphore Id : 0x585f2 Semaphore Type : BINARY Task Queuing : PRIORITY Pended Tasks : 1 State : EMPTY {Count if COUNTING, Owner if MUTEX}If tasks are blocked on the queue, they are displayed in the order in which they will unblock, as follows:NAME TID PRI DELAY ---------- -------- --- ----- tExcTask 3fd678 0 21 tLogTask 3f8ac0 0 611
OK or ERROR.
windsh, browse( ), Tornado User's Guide: Shell
shellHistory( ) - display or set the size of shell history (WindSh)
void shellHistory ( int size /* 0 = display, >0 = set history to new size */ )
This command displays shell history, or resets the default number of commands displayed by shell history to size. By default, history size is 20 commands.
N/A
windsh, h( ), Tornado User's Guide: Shell
shellPromptSet( ) - change the shell prompt (WindSh)
void shellPromptSet ( char * newPrompt /* string to become new shell prompt */ )
This command changes the shell prompt string to newPrompt.
N/A
windsh, Tornado User's Guide: Shell
show( ) - display information on a specified object (WindSh)
void show ( int objId, /* object ID */ int level /* information level */ )
This command displays information on the specified object. System objects include tasks, semaphores, message queues, shared semaphores, shared message queues, memory partitions, and watchdogs. An information level is interpreted by the object's show routine on a class-by-class basis.
N/A
windsh, memPartShow( ), msgQShow( ), semShow( ), taskShow( ), wdShow( ), Tornado User's Guide: Shell
smMemPartShow( ) - show user's shared memory system partition blocks and statistics (*) (WindSh)
STATUS smMemPartShow ( SM_PART_ID partId, /* global partition id to use */ int type /* 0 = statistics, 1 = statistics & list */ )
For a specified shared partition, this routine displays the total amount of free space in the partition, the number of blocks, the average block size, and the maximum block size. It also shows the number of blocks currently allocated, and the average allocated block size.
In addition, if type is 1, this routine displays a list of all the blocks in the free list of the specified shared partition.
The message "VxMP component not installed" if VxMP is not present in the target system.
windsh, smMemShow( ), Tornado User's Guide: Shell
smMemShow( ) - show the shared memory system partition blocks and statistics (WindSh)
void smMemShow ( int type /* 0 = statistics, 1 = statistics & list */ )
This command displays the total amount of free space in the shared memory system partition, including the number of blocks, the average block size, and the maximum block size. It also shows the number of blocks currently allocated, and the average allocated block size.
If type is 1, it displays a list of all the blocks in the free list of the shared memory system partition.
-> smMemShow 1 FREE LIST: num addr size --- ---------- ---------- 1 0x4ffef0 264 2 0x4fef18 1700 SUMMARY: status bytes blocks ave block max block --------------- --------- -------- ---------- ---------- current free 1964 2 982 1700 alloc 2356 1 2356 - cumulative alloc 2620 2 1310 - value = 0 = 0x0
The message "VxMP component not installed" if VxMP is not present in the target system.
windsh Tornado User's Guide: Shell
so( ) - single-step, but step over a subroutine (WindSh)
STATUS so ( int task /* task to step; 0 = use default */ )
This routine single-steps a task that is stopped at a breakpoint. However, if the next instruction is a JSR or BSR, so( ) breaks at the instruction following the subroutine call instead.
To execute, enter:
-> so [task]If task is omitted or zero, the last task referenced is assumed.
OK or ERROR if there is no such task.
windsh Tornado User's Guide: Shell
sp( ) - spawn a task with default parameters (WindSh)
int sp ( FUNCPTR func, /* function to call */ int arg1, /* first of nine args to pass to spawned task */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9 )
This command spawns a specified function as a task with the following defaults:
- priority:
- 100.
- stack size:
- 20,000 bytes
- task ID:
- highest not currently used
- task options:
- VX_FP_TASK - execute with floating-point coprocessor support.
- task name:
- A name of the form sXuN where X is the shell number and N is an integer which increments as new tasks are spawned. The shell number depends on the number of connected shells and on the order of connection. First connected shell has a 1 shell number, then 2 3 4 ... If shell 2 disconnects, and another one connects, its shell number will be 2 (first free slot number). Thus task names should look like s1u1, s1u2, s5u3, etc.
The task ID is displayed after the task is spawned.
This command can also be used to spawn a task when the agent is in external mode. The new task is created in the context of tExcTask, and will not start running until that task has processed the spawn request. For a task started this way, only four arguments may be given.
A task ID, or ERROR if the task cannot be spawned.
windsh, sps( ), Tornado User's Guide: Shell
sps( ) - spawn a task with default parameters, and leave it suspended (*) (WindSh)
int sps ( FUNCPTR func, /* function to call */ int arg1, /* first of nine args to pass to spawned task */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9 )
This command has the same effect as sp( ), except that the newly spawned task is immediately suspended.
There is no target-resident version of sps( ).
A task ID, or ERROR if the task cannot be spawned.
windsh, sp( ), Tornado User's Guide: Shell
sysResume( ) - reset the agent to tasking mode (*) (WindSh)
int sysResume (void)
This command sets the agent to tasking mode and resumes the system. If the agent is already in tasking mode, sysResume( ) has no effect.
OK or ERROR.
windsh, sysSuspend( ), Tornado User's Guide: Shell
sysStatusShow( ) - show system context status (*) (WindSh)
int sysStatusShow (void)
This command shows the status of the system context. There are two system context states : suspended and running. This command can be completed succesfully only if the agent is running in external mode.
OK, or ERROR if agent is running in task mode
windsh, sysResume( ), sysSuspend( ), Tornado User's Guide: Shell
sysSuspend( ) - set the agent to external mode and suspend the system (*) (WindSh)
int sysSuspend (void)
This command sets the agent to external mode if it is supported by the agent. The system is then suspended, halting all tasks. When the agent is in external mode, certain shell commands work differently: b( ), s( ), c( ) work with the system context instead of particular task contexts. To return to tasking mode, use sysResume( ).
OK, or ERROR if external mode cannot be entered.
windsh, sysResume( ), b( ), Tornado User's Guide: Shell
taskCreateHookShow( ) - show the list of task create routines (WindSh)
void taskCreateHookShow (void)
This routine shows all the task create routines installed in the task create hook table, in the order in which they were installed.
N/A
windsh Tornado User's Guide: Shell
taskDeleteHookShow( ) - show the list of task delete routines (WindSh)
void taskDeleteHookShow (void)
This routine shows all the delete routines installed in the task delete hook table, in the order in which they were installed. Note that the delete routines will be run in reverse of the order in which they were installed.
N/A
windsh Tornado User's Guide: Shell
taskIdDefault( ) - set the default task ID (WindSh)
int taskIdDefault ( int tid /* user-supplied task ID; if 0, return default */ )
This command maintains a global default task ID. This ID is used by WindSh primitives that allow a task ID argument to take on a default value if you do not explicitly supply one.
If tid is not zero (i.e., you do specify a task ID), the default ID is set to that value, and that value is returned. If tid is zero (i.e., you did not specify a task ID), the default ID is not changed and its value is returned. Thus the value returned is always the last default task ID you specify.
The most recent non-zero task ID.
windsh, Tornado User's Guide: Shell
taskIdFigure( ) - figure out the task ID of a specified task (*) (WindSh)
int taskIdFigure ( char * nameOrId /* target task name or Identifier */ )
This command returns the task ID of a task specified either by name or by number. If nameOrId is 0, it returns the task ID of the default task. Otherwise, it searches the list of active task IDs for the given number; if found, it returns the ID (thus verifying its validity). Next, it searches a task whose name is the number (in hex); if found, it returns the ID. Otherwise, if the given address points to a string that matches an existing task name, it returns the task's ID. If all this fails, the command returns ERROR.
There is no target-resident version of taskIdFigure( ).
A task ID, or ERROR.
windsh, taskIdDefault( ), Tornado User's Guide: Shell
taskRegsShow( ) - display the contents of a task's registers (WindSh)
void taskRegsShow ( int tid /* task ID */ )
This routine displays the register contents of a specified task on standard output.
The following example displays the register of the shell task (68000 family):
-> taskRegsShow (taskNameToId ("tShell")) d0 = 0 d1 = 0 d2 = 578fe d3 = 1 d4 = 3e84e1 d5 = 3e8568 d6 = 0 d7 = ffffffff a0 = 0 a1 = 0 a2 = 4f06c a3 = 578d0 a4 = 3fffc4 a5 = 0 fp = 3e844c sp = 3e842c sr = 3000 pc = 4f0f2 value = 0 = 0x0
N/A
windsh Tornado User's Guide: Shell
taskShow( ) - display task information from TCBs (WindSh)
STATUS taskShow ( int tid, /* task ID */ int level /* 0 = summary, 1 = details, 2 = all tasks */ )
This command displays the contents of a task control block (TCB) for a specified task. If level is 1, it also displays task options and registers. If level is 2, it displays all tasks.
The TCB display contains the following fields:
Field Meaning NAME Task name ENTRY Symbol name or address where task began execution TID Task ID PRI Priority STATUS Task status, as formatted by taskStatusString( ) PC Program counter SP Stack pointer ERRNO Most recent error code for this task DELAY If task is delayed, number of clock ticks remaining in delay (0 otherwise)
N/A
windsh, Tornado User's Guide: Shell
taskSwitchHookShow( ) - show the list of task switch routines (WindSh)
void taskSwitchHookShow (void)
This routine shows all the switch routines installed in the task switch hook table, in the order in which they were installed.
N/A
windsh Tornado User's Guide: Shell
taskWaitShow( ) - show information about the object a task is pended on (*) (WindSh)
void taskWaitShow ( int taskId, /* task ID */ int level /* 0 = summary, 1 = details */ )
This routine shows information about the ojbect a task is pended on. This routine doesn't support POSIX semaphores and message queues. This command doesn't support pending signals.
List of object types:
semaphores:
SEM_B : binary
SEM_M : mutex
SEM_C : counting
SEM_O : old
SEM_SB : shared_binary
SEM_SC : shared countingmessage queues:
MSG_Q(R) : task is pended on a msgQReceive command
MSG_Q(S) : task is pended on a msgQSend commandshared message queues:
MSG_Q_S(R) : task is pended on a msgQReceive command
MSG_Q_S(S) : task is pended on a msgQSend commandunknown object:
N/A : The task is pended on an unknown object (POSIX , signal).
N/A
windsh w( ), tw( ), Tornado User's Guide: Shell
tcpstatShow( ) - display all statistics for the TCP protocol (WindSh)
void tcpstatShow (void)
This routine displays detailed statistics for the TCP protocol.
N/A
windsh Tornado User's Guide: Shell
td( ) - delete a task (WindSh)
void td (void)
This command deletes a specified task. It is equivalent to the target routine taskDelete( ).
N/A
windsh, Tornado User's Guide: Shell
tftpInfoShow( ) - get TFTP status information (WindSh)
void tftpInfoShow ( TFTP_DESC * pTftpDesc /* TFTP descriptor */ )
This routine prints information associated with TFTP descriptor pTftpDesc.
A call to tftpInfoShow( ) might look like:
-> tftpInfoShow (tftpDesc) Connected to yuba [69] Mode: netascii Verbose: off Tracing: off Rexmt-interval: 5 seconds, Max-timeout: 25 seconds value = 0 = 0x0 ->
N/A
windsh Tornado User's Guide: Shell
ti( ) - display complete information from a task's TCB (WindSh)
void ti ( int taskNameOrId /* task name or task ID; 0 = use default */ )
This command displays the task control block (TCB) contents, including registers, for a specified task. If taskNameOrId is omitted or zero, the last task referenced is assumed.
The ti( ) command calls taskShow( ) with a second argument of 1; see the documentation for taskShow( ) for a description of the output format.
N/A
windsh, taskShow( ), Tornado User's Guide: Shell
tr( ) - resume a task (WindSh)
void tr ( int taskNameOrId /* task name or task ID */ )
This command resumes the execution of a suspended task. It is equivalent to the target routine taskResume( ).
N/A
windsh, ts( ), Tornado User's Guide: Shell
ts( ) - suspend a task (WindSh)
void ts ( int taskNameOrId /* task name or task ID */ )
This command suspends the execution of a specified task. It is equivalent to the target routine taskSuspend( ).
N/A
windsh, tr( ), Tornado User's Guide: Shell
tt( ) - display a stack trace of a task (WindSh)
STATUS tt ( int taskNameOrId /* task name or task ID */ )
This command displays a list of the nested routine calls that the specified task is in. Each routine call and its parameters are shown.
If taskNameOrId is not specified or zero, the last task referenced is assumed.
-> tt "logTask" 3ab92 _vxTaskEntry +10 : _logTask (0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ee6e _logTask +12 : _read (5, 3f8a10, 20) d460 _read +10 : _iosRead (5, 3f8a10, 20) e234 _iosRead +9c : _pipeRead (3fce1c, 3f8a10, 20) 23978 _pipeRead +24 : _semTake (3f8b78) value = 0 = 0x0This indicates that logTask( ) is currently in semTake( ) (with one parameter) and was called by pipeRead( ) (with three parameters), which was called by iosRead( ) (with three parameters), and so on.
In order to do the trace, some assumptions are made. In general, the trace works for all C language routines and for assembly language routines that start with a LINK instruction. Some C compilers require specific flags to generate the LINK first. Most VxWorks assembly language routines include LINK instructions for this reason. The trace facility may produce inaccurate results or fail completely if the routine is written in a language other than C, the routine's entry point is non-standard, or the task's stack is corrupted. Also, all parameters are assumed to be 32-bit quantities, so structures passed as parameters will be displayed as long integers.
OK, or ERROR if the task does not exist.
windsh, Tornado User's Guide: Shell
tw( ) - print info about the object the given task is pending on (*) (WindSh)
void tw ( int taskNameOrId /* task name or task ID */ )
This routine calls taskWaitShow( ) on the given task in verbose mode.
N/A
windsh taskWaitShow( ), w( ), Tornado User's Guide: Shell
udpstatShow( ) - display statistics for the UDP protocol (WindSh)
void udpstatShow (void)
This routine displays statistics for the UDP protocol.
N/A
windsh Tornado User's Guide: Shell
unld( ) - unload an object module by specifying a file name or module ID (WindSh)
STATUS unld ( void * nameOrId /* name or ID of the object module file */ )
This command unloads the specified object module from the system. The module can be specified by name or by module ID. For a.out and ECOFF format modules, unloading does the following:
- (1)
- It frees the space allocated for text, data, and BSS segments, unless loadModuleAt( ) was called with specific addresses, in which case the user is responsible for freeing the space.
- (2)
- It removes all symbols associated with the object module from the system symbol table.
- (3)
- It removes the module descriptor from the module list.
For other modules of other formats, unloading has similar effects.
OK or ERROR.
windsh, Tornado User's Guide: Shell
version( ) - print VxWorks version information (WindSh)
void version (void)
This command displays the VxWorks release number and architecture type, the wind kernel version number, the date this copy of VxWorks was created, and the boot parameters for a VxWorks system running on the current target.
N/A
windsh, Tornado User's Guide: Shell
w( ) - print a summary of each task's pending information, task by task (*) (WindSh)
void w ( int taskNameOrId /* task name or task ID */ )
This routine calls taskWaitShow( ) in quiet mode on all tasks in the system, or a specified task if the argument is given.
N/A
windsh taskWaitShow( ), tw( ), Tornado User's Guide: Shell
wdShow( ) - show information about a watchdog (WindSh)
STATUS wdShow ( WDOG_ID wdId /* watchdog to display */ )
This command displays the state of a watchdog.
-> wdShow myWdId Watchdog Id : 0x3dd46c State : OUT_OF_Q Ticks Remaining : 0 Routine : 0 Parameter : 0
OK or ERROR.