diff --git a/sys/amd64/amd64/amd64-gdbstub.c b/sys/amd64/amd64/amd64-gdbstub.c index 4035f9718ec9..e019fef1ac06 100644 --- a/sys/amd64/amd64/amd64-gdbstub.c +++ b/sys/amd64/amd64/amd64-gdbstub.c @@ -71,6 +71,8 @@ * * ? What was the last sigval ? SNN (signal NN) * + * D detach OK + * * All commands and responses are sent with a packet which includes a * checksum. A packet consists of * @@ -91,6 +93,7 @@ ****************************************************************************/ #include +#include #include #include @@ -488,6 +491,11 @@ gdb_handle_exception (db_regs_t *raw_regs, int type, int code) remcomOutBuffer[3] = 0; break; + case 'D': /* detach; say OK and turn off gdb */ + putpacket(remcomOutBuffer); + boothowto &= ~RB_GDB; + return; + case 'g': /* return the value of the CPU registers */ mem2hex ((vm_offset_t)®isters, remcomOutBuffer, NUMREGBYTES); break; diff --git a/sys/i386/i386/i386-gdbstub.c b/sys/i386/i386/i386-gdbstub.c index 4035f9718ec9..e019fef1ac06 100644 --- a/sys/i386/i386/i386-gdbstub.c +++ b/sys/i386/i386/i386-gdbstub.c @@ -71,6 +71,8 @@ * * ? What was the last sigval ? SNN (signal NN) * + * D detach OK + * * All commands and responses are sent with a packet which includes a * checksum. A packet consists of * @@ -91,6 +93,7 @@ ****************************************************************************/ #include +#include #include #include @@ -488,6 +491,11 @@ gdb_handle_exception (db_regs_t *raw_regs, int type, int code) remcomOutBuffer[3] = 0; break; + case 'D': /* detach; say OK and turn off gdb */ + putpacket(remcomOutBuffer); + boothowto &= ~RB_GDB; + return; + case 'g': /* return the value of the CPU registers */ mem2hex ((vm_offset_t)®isters, remcomOutBuffer, NUMREGBYTES); break;