[gdb] Add support for x86_64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2016-03-20 12:00:15 +00:00
parent 1afcccd5fd
commit 311a5732c8
8 changed files with 477 additions and 225 deletions

View File

@@ -40,7 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
enum {
POSIX_EINVAL = 0x1c, /* used to report bad arguments to GDB */
SIZEOF_PAYLOAD = 256, /* buffer size of GDB payload data */
SIZEOF_PAYLOAD = 512, /* buffer size of GDB payload data */
};
struct gdbstub {
@@ -255,17 +255,20 @@ static void gdbstub_continue ( struct gdbstub *stub, int single_step ) {
static void gdbstub_breakpoint ( struct gdbstub *stub ) {
unsigned long args [ 3 ];
int enable = stub->payload [ 0 ] == 'Z' ? 1 : 0;
int rc;
if ( !gdbstub_get_packet_args ( stub, args, sizeof args / sizeof args [ 0 ], NULL ) ) {
gdbstub_send_errno ( stub, POSIX_EINVAL );
return;
}
if ( gdbmach_set_breakpoint ( args [ 0 ], args [ 1 ], args [ 2 ], enable ) ) {
gdbstub_send_ok ( stub );
} else {
if ( ( rc = gdbmach_set_breakpoint ( args [ 0 ], args [ 1 ],
args [ 2 ], enable ) ) != 0 ) {
/* Not supported */
stub->len = 0;
gdbstub_tx_packet ( stub );
return;
}
gdbstub_send_ok ( stub );
}
static void gdbstub_rx_packet ( struct gdbstub *stub ) {