next up previous contents index
Next: 10.18.3 gdb_serial_exit: notify the Up: 10.18 Serial-line Remote Debugging Previous: 10.18.1 Redirecting console output

10.18.2 gdb_serial_signal: primary event handler in the GDB stub

   

SYNOPSIS

#include <oskit/gdb_serial.h>

void gdb_serial_signal([in/out] int *signo, [in/out] struct gdb_state *state);

DESCRIPTION

This is the main trap/signal handler routine in the serial-line debugging stub; it should be called whenever a relevant processor trap occurs. This function notifies the remote debugger about the event that caused the processor to stop, and then waits for instructions from the remote debugger. The remote debugger may then cause the stub to perform various actions, such as examine memory, modify the register state, or kill the program being debugged. Eventually, the remote debugger will probably instruct the stub to resume execution, in which case this function returns with the signal number and trap state modified appropriately.

If this function receives a ``kill'' (`k') command from the remote debugger, then it breaks the remote debugging connection and then calls panic to reboot the machine. XXX may not be appropriate when debugging a user task; should call an intermediate function.

PARAMETERS

signo
On entry, the variable referenced by this pointer contains the signal number to transmit to the remote debugger. On return, this variable may have been modified to indicate what signal should be dispatched to the program being debugged. For example, if the variable is the same on return as on entry, then it means the remote debugger instructed the stub to ``pass through'' the signal to the application. If *signo is 0 on return from this function, it means the remote debugger has ``consumed'' the signal and execution of the subject program should be resumed immediately.
state
On entry, this structure contains a snapshot of the processor state at the time the relevant trap or interrupt occurred. On return, the remote debugger may have modified this state; the new state should be used when resuming execution.

DEPENDENCIES

gdb_serial_send
10.18.8
gdb_serial_recv
10.18.7
gdb_copyin
10.17.6
gdb_copyout
10.17.7
gdb_set_trace_flag
10.17.10
panic
9.7.3


next up previous contents index
Next: 10.18.3 gdb_serial_exit: notify the Up: 10.18 Serial-line Remote Debugging Previous: 10.18.1 Redirecting console output

University of Utah Flux Research Group