1 #ifndef _GPXE_GDBSTUB_H
2 #define _GPXE_GDBSTUB_H
10 FILE_LICENCE ( GPL2_OR_LATER
);
13 #include <gpxe/tables.h>
17 * A transport mechanism for the GDB protocol
20 struct gdb_transport
{
24 * Set up the transport given a list of arguments
26 * @v argc Number of arguments
27 * @v argv Argument list
28 * @ret Return status code
30 * Note that arguments start at argv[0].
32 int ( * init
) ( int argc
, char **argv
);
34 * Perform a blocking read
37 * @v len Size of buffer
38 * @ret Number of bytes read into buffer
40 size_t ( * recv
) ( char *buf
, size_t len
);
45 * @v len Size of buffer
47 void ( * send
) ( const char *buf
, size_t len
);
50 #define GDB_TRANSPORTS __table ( struct gdb_transport, "gdb_transports" )
52 #define __gdb_transport __table_entry ( GDB_TRANSPORTS, 01 )
55 * Look up GDB transport by name
57 * @v name Name of transport
58 * @ret GDB transport or NULL
60 extern struct gdb_transport
*find_gdb_transport ( const char *name
);
63 * Break into the debugger using the given transport
65 * @v trans GDB transport
67 extern void gdbstub_start ( struct gdb_transport
*trans
);
72 * @signo POSIX signal number
73 * @regs CPU register snapshot
75 extern void gdbstub_handler ( int signo
, gdbreg_t
*regs
);
77 #endif /* _GPXE_GDBSTUB_H */