diff options
author | Bruce Evans <bde@FreeBSD.org> | 1994-10-19 21:13:51 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1994-10-19 21:13:51 +0000 |
commit | 0bf495e561308791b7614689b83d8b1dbf9c640b (patch) | |
tree | e9359bde5698facbb24a060e6ba9b78d3b733812 | |
parent | 33d2aba4dcd1ed02210f5d6c3988cb0a081a2472 (diff) | |
download | src-0bf495e561308791b7614689b83d8b1dbf9c640b.tar.gz src-0bf495e561308791b7614689b83d8b1dbf9c640b.zip |
Fix the test for the code segment being the usual one. Unusual code
segments can still cause panics. Their pc is converted to 0 and 0
is only checked for in one place before use.
Notes
Notes:
svn path=/head/; revision=3722
-rw-r--r-- | sys/amd64/include/db_machdep.h | 5 | ||||
-rw-r--r-- | sys/i386/include/db_machdep.h | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/amd64/include/db_machdep.h b/sys/amd64/include/db_machdep.h index 310c43bbffb2..7e7bec08ba19 100644 --- a/sys/amd64/include/db_machdep.h +++ b/sys/amd64/include/db_machdep.h @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * - * $Id: db_machdep.h,v 1.4 1994/09/08 11:49:04 bde Exp $ + * $Id: db_machdep.h,v 1.5 1994/10/02 19:36:30 phk Exp $ */ #ifndef _I386_DB_MACHDEP_H_ @@ -55,7 +55,8 @@ typedef struct i386_saved_state db_regs_t; extern db_regs_t ddb_regs; /* register state */ #define DDB_REGS (&ddb_regs) -#define PC_REGS(regs) ((regs)->tf_cs == 0x08 ? (db_addr_t)(regs)->tf_eip : 0) +#define PC_REGS(regs) (((regs)->tf_cs & 0xfffc) == 0x08 \ + ? (db_addr_t)(regs)->tf_eip : 0) #define BKPT_INST 0xcc /* breakpoint instruction */ #define BKPT_SIZE (1) /* size of breakpoint inst */ diff --git a/sys/i386/include/db_machdep.h b/sys/i386/include/db_machdep.h index 310c43bbffb2..7e7bec08ba19 100644 --- a/sys/i386/include/db_machdep.h +++ b/sys/i386/include/db_machdep.h @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * - * $Id: db_machdep.h,v 1.4 1994/09/08 11:49:04 bde Exp $ + * $Id: db_machdep.h,v 1.5 1994/10/02 19:36:30 phk Exp $ */ #ifndef _I386_DB_MACHDEP_H_ @@ -55,7 +55,8 @@ typedef struct i386_saved_state db_regs_t; extern db_regs_t ddb_regs; /* register state */ #define DDB_REGS (&ddb_regs) -#define PC_REGS(regs) ((regs)->tf_cs == 0x08 ? (db_addr_t)(regs)->tf_eip : 0) +#define PC_REGS(regs) (((regs)->tf_cs & 0xfffc) == 0x08 \ + ? (db_addr_t)(regs)->tf_eip : 0) #define BKPT_INST 0xcc /* breakpoint instruction */ #define BKPT_SIZE (1) /* size of breakpoint inst */ |