diff options
author | Michael Brown | 2016-03-20 13:00:15 +0100 |
---|---|---|
committer | Michael Brown | 2016-03-22 09:44:32 +0100 |
commit | 311a5732c8baa7ceb4f23db51dcbb5015e2ef965 (patch) | |
tree | dcdb0f60b43c40b6512bb8a3fcd93e0e9478c41d /src/core/gdbstub.c | |
parent | [build] Do not use "objcopy -O binary" for objects with relocation records (diff) | |
download | ipxe-311a5732c8baa7ceb4f23db51dcbb5015e2ef965.tar.gz ipxe-311a5732c8baa7ceb4f23db51dcbb5015e2ef965.tar.xz ipxe-311a5732c8baa7ceb4f23db51dcbb5015e2ef965.zip |
[gdb] Add support for x86_64
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/gdbstub.c')
-rw-r--r-- | src/core/gdbstub.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/gdbstub.c b/src/core/gdbstub.c index 6ad52d1a..8b57ddf5 100644 --- a/src/core/gdbstub.c +++ b/src/core/gdbstub.c @@ -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 ) { |