From 514e9fd6b817c819c9632becf97ea0046068b914 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sun, 30 Mar 1997 16:03:00 +0000 Subject: [PATCH] Implement the `detach' command for remote GDB. It gets you back at DDB. --- sys/amd64/amd64/amd64-gdbstub.c | 8 ++++++++ sys/i386/i386/i386-gdbstub.c | 8 ++++++++ 2 files changed, 16 insertions(+) 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;