next up previous contents index
Next: 10.18.4 gdb_serial_getchar: input a Up: 10.18 Serial-line Remote Debugging Previous: 10.18.2 gdb_serial_signal: primary event

10.18.3 gdb_serial_exit: notify the remote debugger that the subject is dead

   

SYNOPSIS

#include <oskit/gdb_serial.h>

void gdb_serial_exit(int exit_code);

DESCRIPTION

This function sends a message to the remote debugger indicating that the program being debugged is terminating. This message causes the debugger to display an appropriate message on the debugger's console along with the exit_code, and causes it to break the connection (i.e., stop listening for further messages on the serial port). If no remote debugging connection is currently active, this function does nothing.

The client OS should typically call this function just before it reboots for any reason, so that the debugger does not hang indefinitely waiting for a response from a kernel that is no longer running. Alternatively, if the remote debugging facility is being used to debug a user-mode process running under the kernel, then this function should be called when that process terminates.

Note that despite its name, this function does return. It does not by itself cause the machine to ``exit'' or reboot or hang or whatever; it merely notifies the debugger that the subject program is about to terminate.

PARAMETERS

exit_code
Exit code to pass back to the remote debugger. Typically this value is simply printed on the remote debugger's console.

DEPENDENCIES

gdb_serial_send
10.18.8
gdb_serial_recv
10.18.7



University of Utah Flux Research Group