📄 windsh.html
字号:
<html><head><!-- /vobs/wpwr/docs/tornado/tools/windsh.html - generated by refgen from windshDoc.c --> <title> windsh [windsh] </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>Tornado Reference : Tornado Tools</i></a></p></blockquote><h1>windsh [windsh]</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>windsh [windsh]</strong> - The Tornado Shell </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./windsh.html#agentModeShow">agentModeShow</a></i>( )</b> - show the agent mode (*) (WindSh)<br><b><i><a href="./windsh.html#b">b</a></i>( )</b> - set or display breakpoints (WindSh)<br><b><i><a href="./windsh.html#bd">bd</a></i>( )</b> - delete a breakpoint (WindSh)<br><b><i><a href="./windsh.html#bdall">bdall</a></i>( )</b> - delete all breakpoints (WindSh)<br><b><i><a href="./windsh.html#bh">bh</a></i>( )</b> - set a hardware breakpoint (WindSh)<br><b><i><a href="./windsh.html#bootChange">bootChange</a></i>( )</b> - change the boot line (WindSh)<br><b><i><a href="./windsh.html#browse">browse</a></i>( )</b> - send a message to the browser asking it to browse an address (*) (WindSh)<br><b><i><a href="./windsh.html#c">c</a></i>( )</b> - continue from a breakpoint (WindSh)<br><b><i><a href="./windsh.html#cd">cd</a></i>( )</b> - change the default directory (WindSh) <br><b><i><a href="./windsh.html#checkStack">checkStack</a></i>( )</b> - print a summary of each task's stack usage (WindSh)<br><b><i><a href="./windsh.html#classShow">classShow</a></i>( )</b> - show information about a class of objects (*) (WindSh)<br><b><i><a href="./windsh.html#cplusCtors">cplusCtors</a></i>( )</b> - call static constructors (C++) (WindSh)<br><b><i><a href="./windsh.html#cplusDtors">cplusDtors</a></i>( )</b> - call static destructors (C++) (WindSh)<br><b><i><a href="./windsh.html#cplusStratShow">cplusStratShow</a></i>( )</b> - show C++ static constructors calling strategy (*) (WindSh)<br><b><i><a href="./windsh.html#cplusXtorSet">cplusXtorSet</a></i>( )</b> - change C++ static constructor calling strategy (C++) (WindSh)<br><b><i><a href="./windsh.html#cret">cret</a></i>( )</b> - continue until the current subroutine returns (WindSh)<br><b><i><a href="./windsh.html#d">d</a></i>( )</b> - display memory (WindSh)<br><b><i><a href="./windsh.html#devs">devs</a></i>( )</b> - list all system-known devices (WindSh)<br><b><i><a href="./windsh.html#h">h</a></i>( )</b> - display or set the size of shell history (WindSh)<br><b><i><a href="./windsh.html#help">help</a></i>( )</b> - print a synopsis of selected routines (WindSh)<br><b><i><a href="./windsh.html#hostShow">hostShow</a></i>( )</b> - display the host table (WindSh)<br><b><i><a href="./windsh.html#i">i</a></i>( )</b> - print a summary of each task's TCB, task by task (WindSh)<br><b><i><a href="./windsh.html#iStrict">iStrict</a></i>( )</b> - print a summary of all task TCBs, as an atomic snapshot (*) (WindSh)<br><b><i><a href="./windsh.html#icmpstatShow">icmpstatShow</a></i>( )</b> - display statistics for ICMP (WindSh)<br><b><i><a href="./windsh.html#ifShow">ifShow</a></i>( )</b> - display the attached network interfaces (WindSh)<br><b><i><a href="./windsh.html#inetstatShow">inetstatShow</a></i>( )</b> - display all active connections for Internet protocol sockets (WindSh)<br><b><i><a href="./windsh.html#intVecShow">intVecShow</a></i>( )</b> - display the interrupt vector table (WindSh)<br><b><i><a href="./windsh.html#iosDevShow">iosDevShow</a></i>( )</b> - display the list of devices in the system (WindSh)<br><b><i><a href="./windsh.html#iosDrvShow">iosDrvShow</a></i>( )</b> - display a list of system drivers (WindSh)<br><b><i><a href="./windsh.html#iosFdShow">iosFdShow</a></i>( )</b> - display a list of file descriptor names in the system (WindSh)<br><b><i><a href="./windsh.html#ipstatShow">ipstatShow</a></i>( )</b> - display IP statistics (WindSh)<br><b><i><a href="./windsh.html#l">l</a></i>( )</b> - disassemble and display a specified number of instructions (WindSh)<br><b><i><a href="./windsh.html#ld">ld</a></i>( )</b> - load an object module into memory (WindSh)<br><b><i><a href="./windsh.html#lkAddr">lkAddr</a></i>( )</b> - list symbols whose values are near a specified value (WindSh)<br><b><i><a href="./windsh.html#lkup">lkup</a></i>( )</b> - list symbols (WindSh)<br><b><i><a href="./windsh.html#ls">ls</a></i>( )</b> - list the contents of a directory (WindSh)<br><b><i><a href="./windsh.html#m">m</a></i>( )</b> - modify memory (WindSh)<br><b><i><a href="./windsh.html#memPartShow">memPartShow</a></i>( )</b> - show partition blocks and statistics (WindSh)<br><b><i><a href="./windsh.html#memShow">memShow</a></i>( )</b> - show system memory partition blocks and statistics (WindSh)<br><b><i><a href="./windsh.html#moduleIdFigure">moduleIdFigure</a></i>( )</b> - figure out module ID, given name or number (*) (WindSh)<br><b><i><a href="./windsh.html#moduleShow">moduleShow</a></i>( )</b> - show the current status for all the loaded modules (WindSh)<br><b><i><a href="./windsh.html#mqPxShow">mqPxShow</a></i>( )</b> - show information about a POSIX message queue (*) (WindSh)<br><b><i><a href="./windsh.html#mRegs">mRegs</a></i>( )</b> - modify registers (WindSh)<br><b><i><a href="./windsh.html#msgQShow">msgQShow</a></i>( )</b> - show information about a message queue (WindSh)<br><b><i><a href="./windsh.html#period">period</a></i>( )</b> - spawn a task to call a function periodically (WindSh)<br><b><i><a href="./windsh.html#printErrno">printErrno</a></i>( )</b> - print the definition of a specified error status value (WindSh)<br><b><i><a href="./windsh.html#printLogo">printLogo</a></i>( )</b> - display the Tornado logo (WindSh)<br><b><i><a href="./windsh.html#pwd">pwd</a></i>( )</b> - display the current default directory (WindSh)<br><b><i><a href="./windsh.html#quit">quit</a></i>( )</b> - shut down WindSh (*) (WindSh)<br><b><i><a href="./windsh.html#reboot">reboot</a></i>( )</b> - reset network devices and transfer control to boot ROMs (WindSh)<br><b><i><a href="./windsh.html#repeat">repeat</a></i>( )</b> - spawn a task to call a function repeatedly (WindSh)<br><b><i><a href="./windsh.html#routestatShow">routestatShow</a></i>( )</b> - display routing statistics (WindSh)<br><b><i><a href="./windsh.html#s">s</a></i>( )</b> - single-step a task (WindSh)<br><b><i><a href="./windsh.html#semPxShow">semPxShow</a></i>( )</b> - show information about a POSIX semaphore (*) (WindSh)<br><b><i><a href="./windsh.html#semShow">semShow</a></i>( )</b> - show information about a semaphore (WindSh)<br><b><i><a href="./windsh.html#shellHistory">shellHistory</a></i>( )</b> - display or set the size of shell history (WindSh)<br><b><i><a href="./windsh.html#shellPromptSet">shellPromptSet</a></i>( )</b> - change the shell prompt (WindSh)<br><b><i><a href="./windsh.html#show">show</a></i>( )</b> - display information on a specified object (WindSh)<br><b><i><a href="./windsh.html#smMemPartShow">smMemPartShow</a></i>( )</b> - show user's shared memory system partition blocks and statistics (*) (WindSh)<br><b><i><a href="./windsh.html#smMemShow">smMemShow</a></i>( )</b> - show the shared memory system partition blocks and statistics (WindSh)<br><b><i><a href="./windsh.html#so">so</a></i>( )</b> - single-step, but step over a subroutine (WindSh)<br><b><i><a href="./windsh.html#sp">sp</a></i>( )</b> - spawn a task with default parameters (WindSh)<br><b><i><a href="./windsh.html#sps">sps</a></i>( )</b> - spawn a task with default parameters, and leave it suspended (*) (WindSh)<br><b><i><a href="./windsh.html#sysResume">sysResume</a></i>( )</b> - reset the agent to tasking mode (*) (WindSh)<br><b><i><a href="./windsh.html#sysStatusShow">sysStatusShow</a></i>( )</b> - show system context status (*) (WindSh)<br><b><i><a href="./windsh.html#sysSuspend">sysSuspend</a></i>( )</b> - set the agent to external mode and suspend the system (*) (WindSh)<br><b><i><a href="./windsh.html#taskCreateHookShow">taskCreateHookShow</a></i>( )</b> - show the list of task create routines (WindSh)<br><b><i><a href="./windsh.html#taskDeleteHookShow">taskDeleteHookShow</a></i>( )</b> - show the list of task delete routines (WindSh)<br><b><i><a href="./windsh.html#taskIdDefault">taskIdDefault</a></i>( )</b> - set the default task ID (WindSh)<br><b><i><a href="./windsh.html#taskIdFigure">taskIdFigure</a></i>( )</b> - figure out the task ID of a specified task (*) (WindSh)<br><b><i><a href="./windsh.html#taskRegsShow">taskRegsShow</a></i>( )</b> - display the contents of a task's registers (WindSh)<br><b><i><a href="./windsh.html#taskShow">taskShow</a></i>( )</b> - display task information from TCBs (WindSh)<br><b><i><a href="./windsh.html#taskSwitchHookShow">taskSwitchHookShow</a></i>( )</b> - show the list of task switch routines (WindSh)<br><b><i><a href="./windsh.html#taskWaitShow">taskWaitShow</a></i>( )</b> - show information about the object a task is pended on (*) (WindSh)<br><b><i><a href="./windsh.html#tcpstatShow">tcpstatShow</a></i>( )</b> - display all statistics for the TCP protocol (WindSh)<br><b><i><a href="./windsh.html#td">td</a></i>( )</b> - delete a task (WindSh)<br><b><i><a href="./windsh.html#tftpInfoShow">tftpInfoShow</a></i>( )</b> - get TFTP status information (WindSh)<br><b><i><a href="./windsh.html#ti">ti</a></i>( )</b> - display complete information from a task's TCB (WindSh)<br><b><i><a href="./windsh.html#tr">tr</a></i>( )</b> - resume a task (WindSh)<br><b><i><a href="./windsh.html#ts">ts</a></i>( )</b> - suspend a task (WindSh)<br><b><i><a href="./windsh.html#tt">tt</a></i>( )</b> - display a stack trace of a task (WindSh)<br><b><i><a href="./windsh.html#tw">tw</a></i>( )</b> - print info about the object the given task is pending on (*) (WindSh)<br><b><i><a href="./windsh.html#udpstatShow">udpstatShow</a></i>( )</b> - display statistics for the UDP protocol (WindSh)<br><b><i><a href="./windsh.html#unld">unld</a></i>( )</b> - unload an object module by specifying a file name or module ID (WindSh)<br><b><i><a href="./windsh.html#version">version</a></i>( )</b> - print VxWorks version information (WindSh)<br><b><i><a href="./windsh.html#w">w</a></i>( )</b> - print a summary of each task's pending information, task by task (*) (WindSh)<br><b><i><a href="./windsh.html#wdShow">wdShow</a></i>( )</b> - show information about a watchdog (WindSh)<br></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>windsh [-c.plus <C++_library>] [-e.xecute <i>expression</i>] [-h.elp] [-n.oinit] [-p.oll <i>value</i>] [-q.uiet] [-s.tartup <i>file</i>] [-T.clmode] [-v.ersion] <i>serverIdentifier</i></pre><p><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>WindSh is the Tornado shell.The shell provides remote interactive access to the target run-timesystem through both a C interpreter and a Tcl interpreter.<p>The shell attaches to the target server specified by <i>serverIdentifier</i>(see <b><a href="./tgtsvr.html#top">tgtsvr</a></b>).<p>To execute a list of commands when the shell starts, collect thesecommands in a file (startup script) and identify the file with the<b>-s</b> option.<p>The shell has <b>vi</b>-like editing capabilities and a history mechanism.The ESC key acts as a toggle between input mode and edit mode. Historyand editing capabilities are available regardless of which interpreteris in use.<p></blockQuote><h4>C Interpreter</h4><blockQuote>The shell's C interpreter (prompt: -> ) can execute almost any expressionusing C operators, and can invoke compiled C functions on the target.Symbols are created as needed for shell expressions, and are addedincrementally to the target symbol table. Interactive sessions use the Cinterpreter by default.<p></blockQuote><h4>Tcl Interpreter</h4><blockQuote>The shell's Tcl interpreter (prompt: tcl> ) executes Tcl functions,including both functions based on the WTX protocol and user-provided Tclprocedures. To enter the Tcl interpreter directly for an interactivesession, start <b><a href="./windsh.html#top">windsh</a></b> with the option <b>-T</b>.<p>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<b>shParse</b> Tcl command. For example:<pre> tcl> shParse sysClkRateGet() 60</pre>When the Tcl interpreter does not recognize a command, it passes it tothe UNIX shell or the Windows command processor.<p></blockQuote><h4>Built-in Routines</h4><blockQuote>The Tornado shell includes a set of built-in routines. These routinesare 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 <b><i><a href="./windsh.html#i">i</a></i>( )</b>, <b><i><a href="./windsh.html#ti">ti</a></i>( )</b>, <b><i><a href="./windsh.html#d">d</a></i>( )</b>, <b><i><a href="./windsh.html#l">l</a></i>( )</b>, <b><i><a href="./windsh.html#ts">ts</a></i>( )</b>,<b><i><a href="./windsh.html#tr">tr</a></i>( )</b>, <b><i><a href="./windsh.html#td">td</a></i>( )</b>, <b><i><a href="./windsh.html#ld">ld</a></i>( )</b>.In Tcl mode, type:<pre> tcl> set shellProcList</pre>to get the complete list of built-in functions.<p></blockQuote><h4>Non-interactive Sessions</h4><blockQuote><b><a href="./windsh.html#top">windsh</a></b> can be used in non-interactive sessions, by simply providinginput on its standard input stream. For example:<pre> garonne% echo "i" | windsh vxsim1@garonne | grep tExcTask tExcTask _excTask 3b3fc0 0 PEND 9bee8 3b3dd8 0 0</pre>It is thus possible to execute a sequence of commands without enteringinteractive mode by redirecting input to a command file:<pre> garonne% windsh vxsim1@garonne < myOwnCommandFile </pre></blockQuote><h4>Completion and Synopsis facilities</h4><blockQuote>The shell supports target symbol completion and path completionusing CTRL-D and TAB:<p><ul><li>To complete a symbol (or a path), begin typing the symbol and thenpress CTRL-D to get the list of symbols matching the word entered:<pre> -> taskS^D taskSwitchHookAdd taskSpawn taskStackAllot taskSRSet taskSwitchTable taskSuspend taskSwitchHookDelete taskSRInit taskSwapHookAttach taskSwapHookAdd taskSwapHookDetach taskSwapReference taskSwapTable taskSwapHookDelete taskSrDefault taskSafe -> taskS</pre></li><li>Select the symbol to complete by adding one or more characteres andpress CTRL-D or TAB to fully complete the symbol. Once the symbol is fullycompleted, the synopsis of the target function (or the WindSh command)can be printed by pressing CTRL-D. It is also possible do display theHTML help of the function by pressing CTRL-W.<pre> -> 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</pre></ul><p><p></blockQuote><h4>Meta-characters</h4><blockQuote>Some characters have special meanings to the shell:<dl><dt><b>?</b><dd>When used alone, this meta-character acts as a toggle to switchbetween the C and Tcl interpreters. In the C interpreter context, ifthe question mark is followed by text, that text is interpreted as aTcl expression, but without entering the Tcl mode. For example:<pre> -> ? wtxAgentModeGet AGENT_MODE_TASK</pre><dt><b>@</b><dd>This meta-character forces the C interpreter to treat the word thatfollows as a target symbol. This is useful when a target function hasthe same name as a shell built-in function. For example:<pre> -> @d</pre><dt><b>></b><dd>This meta-character redirects C-interpreter output. For example: <pre> -> moduleShow >/tmp/loaded</pre><dt><b><</b><dd>This meta-character redirects C-interpreter input.<pre> -> < myOwnCommandFile</pre></dl><p></blockQuote><h4>Standard Input and Output</h4><blockQuote>Developers often call routines that display data on standard output,or accept data from standard input. By default the standard output andinput streams are redirected to the same window as WindSh. Forexample, in a default configuration of Tornado, the following is whatsee in the shell window from a <b><i><a href="../../vxworks/ref/fioLib.html#printf" >printf</a></i>( )</b> invocation:<p><pre> -> printf ("Hello World!\n") Hello World! value = 13 = 0xd -></pre>This behavior can be dynamicaly modified using the shConfig Tcl procedure:<p><pre> -> ?shConfig SH_GET_TASK_IO off -> -> printf ("Hello World!\n") value = 13 = 0xd -></pre>The shell duly reports the <b><i><a href="../../vxworks/ref/fioLib.html#printf" >printf</a></i>( )</b> result, indicating that 13 characterswere printed. But the output itself goes elsewhere by default.<p><dl><dt>NOTE<dd>The standard Input and Output are only redirected for the calledfunction, if this function spawns other tasks, the Input and Output ofthe spawned tasks won't be redirected to WindSh. To have all IOredirected to WindSh, the following script can be used: </dl><p><pre> # 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")}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -