mirror of https://github.com/ipxe/ipxe.git
[GDB] Handle kill and detach packets.
This commit also includes a test to ensure that single stepping works, since continue, kill, detach, and single step all share code.pull/1/head
parent
27731d975e
commit
59b5465b30
|
@ -235,11 +235,14 @@ static void gdbstub_rx_packet ( struct gdbstub *stub ) {
|
||||||
case 'M':
|
case 'M':
|
||||||
gdbstub_write_mem ( stub );
|
gdbstub_write_mem ( stub );
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c': /* Continue */
|
||||||
gdbstub_continue ( stub, 0 );
|
case 'k': /* Kill */
|
||||||
break;
|
case 's': /* Step */
|
||||||
case 's':
|
case 'D': /* Detach */
|
||||||
gdbstub_continue ( stub, 1 );
|
gdbstub_continue ( stub, stub->payload [ 0 ] == 's' );
|
||||||
|
if ( stub->payload [ 0 ] == 'D' ) {
|
||||||
|
gdbstub_send_ok ( stub );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
stub->len = 0;
|
stub->len = 0;
|
||||||
|
|
|
@ -25,5 +25,9 @@ gdbstub_test:
|
||||||
int $3
|
int $3
|
||||||
addl $8, %esp
|
addl $8, %esp
|
||||||
|
|
||||||
|
/* 5. Step test */
|
||||||
|
int $3
|
||||||
|
nop
|
||||||
|
|
||||||
1:
|
1:
|
||||||
jmp 1b
|
jmp 1b
|
||||||
|
|
|
@ -71,6 +71,12 @@ define gpxe_test_mem_write
|
||||||
gpxe_assert ({char}($esp)) (char)0x99 "gpxe_test_mem_write char"
|
gpxe_assert ({char}($esp)) (char)0x99 "gpxe_test_mem_write char"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
define gpxe_test_step
|
||||||
|
c
|
||||||
|
si
|
||||||
|
gpxe_assert ({char}($eip-1)) (char)0x90 "gpxe_test_step" # nop = 0x90
|
||||||
|
end
|
||||||
|
|
||||||
gpxe_load_symbols
|
gpxe_load_symbols
|
||||||
gpxe_connect
|
gpxe_connect
|
||||||
gpxe_start_tests
|
gpxe_start_tests
|
||||||
|
@ -78,3 +84,4 @@ gpxe_test_regs_read
|
||||||
gpxe_test_regs_write
|
gpxe_test_regs_write
|
||||||
gpxe_test_mem_read
|
gpxe_test_mem_read
|
||||||
gpxe_test_mem_write
|
gpxe_test_mem_write
|
||||||
|
gpxe_test_step
|
||||||
|
|
Loading…
Reference in New Issue