02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7<br />

Debugger<br />

Displaying Summary Thread Information<br />

The command info threads shows what thread ID corresponds to which VxWorks<br />

task. For example, immediately after executing attach system to stop a VxWorks<br />

target, the info threads display resembles the following:<br />

(gdb) info threads<br />

4 task 0x4fc868 tExcTask 0x444f58 in ?? ()<br />

3 task 0x4f9f40 tLogTask 0x444f58 in ?? ()<br />

2 task 0x4c7380 + tNetTask 0x4151e0 in ?? ()<br />

1 task 0x4b0a24 tWdbTask 0x4184fe in ?? ()<br />

(gdb)<br />

7<br />

In the info threads output, the left-most number on each line is the debugger’s<br />

thread ID. The single asterisk at the left margin indicates which thread is the<br />

current thread. The current thread identifies the “most local” perspective: debugger<br />

commands that report task-specific information, such as bt and info regs (as well<br />

as the corresponding displays) apply only to the current thread.<br />

The next two columns in the thread list show the VxWorks task ID and the task<br />

name; if the system context is shown, the single word system replaces both of these<br />

columns. The thread (either a task, or the system context) currently scheduled by<br />

the kernel is marked with a + to the right of the task identification.<br />

! CAUTION: The thread ID of the system thread is not constant. To identify the<br />

system thread at each suspension, you must use info threads whenever the<br />

debugger regains control, in order to see whether the system thread is present and,<br />

if so, what its ID is currently.<br />

The remainder of each line in the info threads output shows a summary of each<br />

thread’s current stack frame: the program counter value, and the corresponding<br />

function name.<br />

The thread ID is required to specify a particular thread with commands such as<br />

break and thread.<br />

Switching Threads Explicitly<br />

To switch to a different thread (making that thread the current one for debugging,<br />

but without affecting kernel task scheduling), use the thread command. For<br />

example:<br />

(gdb) thread 2<br />

[Switching to task 0x3a4bd8 tShell ]<br />

#0 0x66454 in semBTake ()<br />

263

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!