This handler is connected to the DEBUG exception (INT 1 on Intel ix86).
This exception is entered when :
executing a single-step instruction,
hardware breakpoint condition is true,
These events will be treated by the debugger because they are the
primary event used when debugging a software for instruction stepping. In both
cases, the DEBUG EXCEPTION handler code is executed. Please note that the execution
context of the exception handler is the supervisor stack of the task that generated
the exception. This implies:
We may sleep in this context,
We have as many possible execution context for the DEBUG EXCEPTION handler as
we need to,
When we enter the high level exception handler code, a normalized exception
context has been pushed on the system stack and a pointer to this context is
available as the first argument (cf cpukit/score/cpu/i386/cpu.c for more
details),
First the exception handler wakeup the EVENT_MNGT task. Then it will
cause the faulting thread to sleep on a synchronization object. As soon as GDB
receives the event notifying that the debuggee status has changed, it will start
sending requests to get the debuggee status (registers set, faulty task id,
...). These requests are handled by the COMMAND MANAGEMENT task. When this task
receive a PTRACE_CONT command it will resume the execution of the task that
caused the exception by doing a V on the synchronization object.