6.2 Trace Functions

These functions enable a debugger to trace program execution. Execution trace is performed by setting hook routines.

  • Return from a hook routine must be made after states have returned to where they were when the hook routine was called. Restoring of registers, however, can be done in accord with the C language function saving rules.
  • In a hook routine, limitations on states must not be modi.ed to make them less restrictive than when the routine was called. For example, if the hook routine was called during interrupts disabled state, interrupts must not be enabled.
  • A hook routine was called at protection level 0.
  • A hook routine inherits the stack at the time of the hook. Too much stack use may therefore cause a stack overflow. The extent to which the stack can be used is not de.nite, since it di.ers with the situation at the time of the hook. Switching to a separate stack in the hook routine would be safer.

Comments