📄 c-shell2.html
字号:
<td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="91953"> </a>Spawn a task to call a function repeatedly.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="91957"> </a><b class="routine"><i class="routine">taskIdDefault</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="91961"> </a>Set or report the default (current) task ID (see <a href="c-shell3.html#92081"><i class="title">6.3.4 The "Current" Task and Address</i></a> for a discussion of how the current task is established and used).</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="90590"> </a>The <b class="routine"><i class="routine">repeat</i></b><b>( )</b> and <b class="routine"><i class="routine">period</i></b><b>( )</b> commands spawn tasks whose entry points are <b class="symbol_lc">_repeatHost</b> and <b class="symbol_lc">_periodHost</b>. The shell downloads these support routines when you call <b class="routine"><i class="routine">repeat</i></b><b>( )</b> or <b class="routine"><i class="routine">period</i></b><b>( )</b>. (With remote target servers, that download sometimes fails; for a discussion of when this is possible, and what you can do about it, see <a href="c-shell6.html#100857"><i class="title">6.6 Object Module Load Path</i></a>.) These tasks may be controlled like any other tasks on the target; for example, you can suspend or delete them with <b class="routine"><i class="routine">ts</i></b><b>( )</b> or <b class="routine"><i class="routine">td</i></b><b>( )</b> respectively.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="92029">Task Information</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="92028"> </a><a href="c-shell2.html#91977">Table 6-3</a> summarizes the WindSh commands that report task information. <p class="table"><h4 class="EntityTitle"><a name="91977"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 6-3: WindSh Commands for Task Information</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="91981"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Call</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="91983"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="91987"> </a><b class="routine"><i class="routine">i</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="91989"> </a>Display system information. This command gives a snapshot of what tasks are in the system, and some information about each of them, such as state, PC, SP, and TCB address. To save memory, this command queries the target repeatedly; thus, it may occasionally give an inconsistent snapshot.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="91993"> </a><b class="routine"><i class="routine">iStrict</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="91995"> </a>Display the same information as <b class="routine"><i class="routine">i</i></b><b>( )</b>, but query target system information only once. At the expense of consuming more intermediate memory, this guarantees an accurate snapshot.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="91999"> </a><b class="routine"><i class="routine">ti</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="92001"> </a>Display task information. This command gives all the information contained in a task's TCB. This includes everything shown for that task by an <b class="routine"><i class="routine">i</i></b><b>(</b> <b>)</b> command, plus all the task's registers, and the links in the TCB chain. If <i class="textVariable">task</i> is 0 (or the argument is omitted), the current task is reported on.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="92125"> </a><b class="routine"><i class="routine">w</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="92127"> </a>Print a summary of each task's pending information, task by task. This routine calls <b class="routine"><i class="routine">taskWaitShow</i></b><b>( )</b> in quiet mode on all tasks in the system, or a specified task if the argument is given. </div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="92121"> </a><b class="routine"><i class="routine">tw</i></b><b>( )</b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="92123"> </a>Print information about the object the given task is pending on. This routine calls <b class="routine"><i class="routine">taskWaitShow</i></b><b>( )</b> on the given task in verbose mode.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="92005"> </a><b class="routine"><i class="routine">checkStack</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="92007"> </a>Show a stack usage summary for a task, or for all tasks if no task is specified. The summary includes the total stack size (SIZE), the current number of stack bytes (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). Use this routine to determine how much stack space to allocate, and to detect stack overflow. This routine does not work for tasks that use the <b class="symbol_UC">VX_NO_STACK_FILL</b> option.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="92012"> </a><b class="routine"><i class="routine">tt</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="92014"> </a>Display a stack trace.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="92018"> </a><b class="routine"><i class="routine">taskIdFigure</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="92020"> </a>Report a task ID, given its name.</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="90599"> </a>The <b class="routine"><i class="routine">i</i></b><b>( )</b> command is commonly used to get a quick report on target activity. (To see this information periodically, use the Tornado browser; see <a href="c-browser.html#86165"><i class="title">7. Browser</i></a>). If nothing seems to be happening, <b class="routine"><i class="routine">i</i></b><b>( )</b> is often a good place to start investigating. To display summary information about all running tasks:</p></dl><dl class="margin"><dd><pre class="Code"><b><a name="91799"></b><tt class="output">-> </tt><b>i </b><tt class="output"> NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY --------- ----------- -------- --- -------- ------- -------- ------- ----- tExcTask _excTask 3ad290 0 PEND 4df10 3ad0c0 0 0 tLogTask _logTask 3aa918 0 PEND 4df10 3aa748 0 0 tWdbTask 0x41288 3870f0 3 READY 23ff4 386d78 3d0004 0 tNetTask _netTask 3a59c0 50 READY 24200 3a5730 0 0 tFtpdTask _ftpdTask 3a2c18 55 PEND 23b28 3a2938 0 0 value = 0 = 0x0</tt><b></a></b></pre></dl><dl class="margin"><dd><p class="Body"><a name="94738"> </a>The <b class="routine"><i class="routine">w</i></b><b>( )</b> and <b class="routine"><i class="routine">tw</i></b><b>( )</b> commands allow you to see what object a VxWorks task is pending on. <b class="routine"><i class="routine">w</i></b><b>( )</b> displays summary information for all tasks, while <b class="routine"><i class="routine">tw</i></b><b>( )</b> displays object information for a specific task. Note that <tt class="output">OBJ_NAME</tt> field is used only for objects that have a symbolic name associated with the address of their structure.</p></dl><dl class="margin"><dd><pre class="Code"><b><a name="97740"></b><tt class="output">-></tt><b> w </b><tt class="output"> NAME ENTRY TID STATUS DELAY OBJ_TYPE OBJ_ID OBJ_NAME ---------- ---------- -------- --------- ----- ---------- -------- ---------- tExcTask _excTask 3d9e3c PEND 0 MSG_Q(R) 3d9ff4 N/A tLogTask _logTask 3d7510 PEND 0 MSG_Q(R) 3d76c8 N/A tWdbTask _wdbCmdLoo 36dde4 READY 0 0 tNetTask _netTask 3a43d0 READY 0 0 u0 _smtask1 36cc2c PEND 0 MSG_Q_S(S) 370b61 N/A u1 _smtask3 367c54 PEND 0 MSG_Q_S(S) 370b61 N/A u3 _taskB 362c7c PEND 0 SEM_B 8d378 _mySem2 u6 _smtask1 35dca4 PEND 0 MSG_Q_S(S) 370ae1 N/A u9 _task3B 358ccc PEND 0 MSG_Q(S) 8cf1c _myMsgQ value = 0 = 0x0 -> -></tt><b> tw u1 </b><tt class="output"> NAME ENTRY TID STATUS DELAY OBJ_TYPE OBJ_ID OBJ_NAME ---------- ---------- -------- --------- ----- ---------- -------- ---------- u1 _smtask3 367c54 PEND 0 MSG_Q_S(S) 370b61 N/A Message Queue Id : 0x370b61 Task Queueing : SHARED_FIFO Message Byte Len : 100 Messages Max : 0 Messages Queued : 0 Senders Blocked : 2 Send Timeouts : 0 Receive Timeouts : 0 Senders Blocked: TID CPU Number Shared TCB ---------- ---------- ---------- 0x36cc2c 0 0x36e464 0x367c54 0 0x36e47c value = 0 = 0x0 -></tt><b></a></b></pre></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="97789">System Information</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="90611"> </a><a href="c-shell2.html#90615">Table 6-4</a> shows the WindSh commands that display information from the symbol table, from the target system, and from the shell itself.<p class="table"><h4 class="EntityTitle"><a name="90615"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 6-4: WindSh Commands for System Information</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="90619"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Call</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="90621"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="90625"> </a><b class="routine"><i class="routine">devs</i></b><b>( )</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="90627"> </a>List all devices known on the target system.</div></td><td width="10"> </td></tr><tr valign="top">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -