diff options
-rw-r--r-- | sys/amd64/amd64/db_interface.c | 7 | ||||
-rw-r--r-- | sys/i386/i386/db_interface.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c index f1ba48c..e2b936b 100644 --- a/sys/amd64/amd64/db_interface.c +++ b/sys/amd64/amd64/db_interface.c @@ -77,6 +77,7 @@ rss(void) int kdb_trap(int type, int code, struct i386_saved_state *regs) { + u_int ef; volatile int ddb_mode = !(boothowto & RB_GDB); /* @@ -96,6 +97,9 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) return (0); } + ef = read_eflags(); + disable_intr(); + switch (type) { case T_BPTFLT: /* breakpoint */ case T_TRCTRAP: /* debug exception */ @@ -216,6 +220,9 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) regs->tf_fs = ddb_regs.tf_fs & 0xffff; regs->tf_cs = ddb_regs.tf_cs & 0xffff; regs->tf_ds = ddb_regs.tf_ds & 0xffff; + + write_eflags(ef); + return (1); } diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c index f1ba48c..e2b936b 100644 --- a/sys/i386/i386/db_interface.c +++ b/sys/i386/i386/db_interface.c @@ -77,6 +77,7 @@ rss(void) int kdb_trap(int type, int code, struct i386_saved_state *regs) { + u_int ef; volatile int ddb_mode = !(boothowto & RB_GDB); /* @@ -96,6 +97,9 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) return (0); } + ef = read_eflags(); + disable_intr(); + switch (type) { case T_BPTFLT: /* breakpoint */ case T_TRCTRAP: /* debug exception */ @@ -216,6 +220,9 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) regs->tf_fs = ddb_regs.tf_fs & 0xffff; regs->tf_cs = ddb_regs.tf_cs & 0xffff; regs->tf_ds = ddb_regs.tf_ds & 0xffff; + + write_eflags(ef); + return (1); } |