30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

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.

6.2. TRACE FUNCTIONS 275<br />

6.2 Trace Functions<br />

These functions enable a debugger to trace program execution. Execution trace is performed by setting<br />

hook routines.<br />

• Return from a hook routine must be made after states have returned to where they were when<br />

the hook routine was called. Restoring of registers, however, can be done in accord with the C<br />

language function saving rules.<br />

• In a hook routine, limitations on states must not be modified to make them less restrictive than<br />

when the routine was called. For example, if the hook routine was called during interrupts disabled<br />

state, interrupts must not be enabled.<br />

• A hook routine was called at protection level 0.<br />

• A hook routine inherits the stack at the time of the hook. Too much stack use may therefore cause<br />

a stack overflow. The extent to which the stack can be used is not definite, since it differs with<br />

the situation at the time of the hook. Switching to a separate stack in the hook routine would be<br />

safer.<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

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

Saved successfully!

Ooh no, something went wrong!