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.

5<br />

Shell<br />

Example 5-2<br />

sp( )<br />

Add a task to the execution queue. The task does not begin to execute until you<br />

continue the kernel or step through the task scheduler.<br />

The following example shows how to use system mode debugging to debug a<br />

system interrupt.<br />

System-Mode Debugging<br />

In this case, usrClock( )is attached to the system clock interrupt handler which is<br />

called at each system clock tick when VxWorks is running. First suspend the<br />

system and confirm that it is suspended using either i( ) or sysStatusShow( ).<br />

-> sysSuspend<br />

value = 0 = 0x0<br />

-><br />

-> i<br />

NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY<br />

--------- ---------- -------- ----- ------- ------- ------- ----- -----<br />

tExcTask _excTask 3e8f98 0 PEND 47982 3e8ef4 0 0<br />

tLogTask _logTask 3e6670 0 PEND 47982 3e65c8 0 0<br />

tWdbTask 0x3f024 398e04 3 PEND 405ac 398d50 30067 0<br />

tNetTask _netTask 3b39e0 50 PEND 405ac 3b3988 0 0<br />

Agent mode : Extern<br />

System context : Suspended<br />

value = 0 = 0x0<br />

-><br />

-> sysStatusShow<br />

System context is suspended<br />

value = 0 = 0x0<br />

Next, set the system mode breakpoint on the entry point of the interrupt handler<br />

you want to debug. Since the target agent is running in system mode, the<br />

breakpoint will automatically be a system mode breakpoint, which you can<br />

confirm with the b( ) command. Resume the system using c( ) and wait for it to<br />

enter the interrupt handler and hit the breakpoint.<br />

-> b usrClock<br />

value = 0 = 0x0<br />

-> b<br />

0x00022d9a: _usrClock Task: SYSTEM Count: 0<br />

value = 0 = 0x0<br />

-> c<br />

value = 0 = 0x0<br />

-><br />

Break at 0x00022d9a: _usrClock<br />

Task: SYSTEM<br />

You can now debug the interrupt handler. For example, you can determine which<br />

task was running when system mode was entered using taskIdCurrent( ) and i( ).<br />

5<br />

171

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

Saved successfully!

Ooh no, something went wrong!