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.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

attach system<br />

Switches the target connection into system mode (if supported by the target<br />

agent) and stops the entire target system.<br />

Or, select Target>Attach System from the CrossWind menu.<br />

The response to a successful attach system is output similar to the following:<br />

(gdb) attach system<br />

Attaching to system.<br />

0x5b58 in wdbSuspendSystemHere ()<br />

Once in system mode, the entire target system stops. In the example above, the<br />

system stopped in wdbSuspendSystemHere( ), the normal suspension point after<br />

attach system.<br />

! CAUTION: Not all targets support system mode, because the BSP must include a<br />

special driver for that purpose (see 2.5 Host-Target Communication Configuration,<br />

p.31). If your target does not support system mode, attempting to use attach<br />

system produces an error.<br />

7.5.2 Thread Facilities in System Mode<br />

In system mode, the GDB thread-debugging facilities become useful. A thread is<br />

the general term for processes with some independent context, but a shared<br />

address space. In VxWorks, each task is a thread; the system context (including<br />

ISRs and drivers) is also a thread. GDB identifies each thread with a thread ID, a<br />

single arbitrary number internal to the debugger.<br />

You can use the following GDB commands to manage thread context.<br />

info threads<br />

Displays summary information (including thread ID) for every thread in the<br />

target system.<br />

thread idNo<br />

Selects the specified thread as the current thread.<br />

break linespec thread idNo<br />

Sets a breakpoint affecting only the specified thread.<br />

For a general description of these commands, see GDB User’s Guide: Debugging<br />

Programs with Multiple Threads. The sections below discuss the thread commands<br />

in the context of debugging a VxWorks target in system mode.<br />

262

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

Saved successfully!

Ooh no, something went wrong!