diff options
author | dg <dg@FreeBSD.org> | 1994-09-15 11:38:59 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-09-15 11:38:59 +0000 |
commit | 5d54a795fb1f624aff03bcb15d25a7182da56324 (patch) | |
tree | 2d42757f309073db15fdcaad82ea30849f23d616 | |
parent | b01b790ba85403a20f8aa9080eeea7296c63c645 (diff) | |
download | FreeBSD-src-5d54a795fb1f624aff03bcb15d25a7182da56324.zip FreeBSD-src-5d54a795fb1f624aff03bcb15d25a7182da56324.tar.gz |
Brought over from 1.1.5:
From Bruce Evans:
Protect against reentering Debugger().
-rw-r--r-- | sys/amd64/amd64/db_interface.c | 19 | ||||
-rw-r--r-- | sys/i386/i386/db_interface.c | 19 |
2 files changed, 34 insertions, 4 deletions
diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c index 9e48973..8f08cc3 100644 --- a/sys/amd64/amd64/db_interface.c +++ b/sys/amd64/amd64/db_interface.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_interface.c,v 1.8 1994/08/13 03:49:36 wollman Exp $ + * $Id: db_interface.c,v 1.9 1994/09/02 04:12:02 davidg Exp $ */ /* @@ -232,9 +232,24 @@ db_write_bytes(addr, size, data) } } +/* + * XXX move this to machdep.c and allow it to be called iff any debugger is + * installed. + * XXX msg is not printed. + */ void Debugger (msg) const char *msg; { - asm ("int $3"); + static volatile u_char in_Debugger; + + if (!in_Debugger) { + in_Debugger = 1; +#ifdef __GNUC__ + asm("int $3"); +#else + int3(); +#endif + in_Debugger = 0; + } } diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c index 9e48973..8f08cc3 100644 --- a/sys/i386/i386/db_interface.c +++ b/sys/i386/i386/db_interface.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_interface.c,v 1.8 1994/08/13 03:49:36 wollman Exp $ + * $Id: db_interface.c,v 1.9 1994/09/02 04:12:02 davidg Exp $ */ /* @@ -232,9 +232,24 @@ db_write_bytes(addr, size, data) } } +/* + * XXX move this to machdep.c and allow it to be called iff any debugger is + * installed. + * XXX msg is not printed. + */ void Debugger (msg) const char *msg; { - asm ("int $3"); + static volatile u_char in_Debugger; + + if (!in_Debugger) { + in_Debugger = 1; +#ifdef __GNUC__ + asm("int $3"); +#else + int3(); +#endif + in_Debugger = 0; + } } |