From 6d566cffb02d92dfe6e8b3387d8bd8b4cf9e2abe Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Thu, 22 Dec 2005 15:57:04 +0000 Subject: [PATCH] * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Fix typos. (amd64obsd_trapframe_sniffer): Add comment. * i386obsd-tdep.c (i386obsd_trapframe_cache): Fix typos. (i386obsd_trapframe_sniffer): Add comment. --- gdb/ChangeLog | 6 ++++++ gdb/amd64obsd-tdep.c | 6 ++++-- gdb/i386obsd-tdep.c | 8 +++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aa4ce941289..933e363490c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,7 +1,13 @@ 2005-12-22 Mark Kettenis + * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Fix typos. + (amd64obsd_trapframe_sniffer): Add comment. + * i386obsd-tdep.c (i386obsd_trapframe_cache): Fix typos. + (i386obsd_trapframe_sniffer): Add comment. + * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Fix detection of interrupts from user space. + * i386obsd-tdep.c (i386obsd_trapframe_cache): Handle interrupt frames too. (i386obsd_trapframe_sniffer): Turn into a proper unwinder sniffer. diff --git a/gdb/amd64obsd-tdep.c b/gdb/amd64obsd-tdep.c index a0611c0dc14..17c7219ecfb 100644 --- a/gdb/amd64obsd-tdep.c +++ b/gdb/amd64obsd-tdep.c @@ -360,7 +360,7 @@ amd64obsd_trapframe_cache(struct frame_info *next_frame, void **this_cache) sp = frame_unwind_register_unsigned (next_frame, AMD64_RSP_REGNUM); find_pc_partial_function (func, &name, NULL, NULL); - if (name && strncmp(name, "Xintr", 5) == 0) + if (name && strncmp (name, "Xintr", 5) == 0) addr = sp + 8; /* It's an interrupt frame. */ else addr = sp; @@ -374,7 +374,7 @@ amd64obsd_trapframe_cache(struct frame_info *next_frame, void **this_cache) cs = read_memory_unsigned_integer (addr, 8); if ((cs & I386_SEL_RPL) == I386_SEL_UPL) { - /* Trap from use space; terminate backtrace. */ + /* Trap from user space; terminate backtrace. */ trad_frame_set_id (cache, null_frame_id); } else @@ -418,6 +418,8 @@ amd64obsd_trapframe_sniffer (const struct frame_unwind *self, ULONGEST cs; char *name; + /* Check Current Privilige Level and bail out if we're not executing + in kernel space. */ cs = frame_unwind_register_unsigned (next_frame, AMD64_CS_REGNUM); if ((cs & I386_SEL_RPL) == I386_SEL_UPL) return 0; diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c index dafb657af8c..3202f160345 100644 --- a/gdb/i386obsd-tdep.c +++ b/gdb/i386obsd-tdep.c @@ -358,7 +358,7 @@ i386obsd_trapframe_cache(struct frame_info *next_frame, void **this_cache) sp = frame_unwind_register_unsigned (next_frame, I386_ESP_REGNUM); find_pc_partial_function (func, &name, NULL, NULL); - if (name && strncmp(name, "Xintr", 5) == 0) + if (name && strncmp (name, "Xintr", 5) == 0) addr = sp + 8; /* It's an interrupt frame. */ else addr = sp; @@ -372,7 +372,7 @@ i386obsd_trapframe_cache(struct frame_info *next_frame, void **this_cache) cs = read_memory_unsigned_integer (addr, 4); if ((cs & I386_SEL_RPL) == I386_SEL_UPL) { - /* Trap from use space; terminate backtrace. */ + /* Trap from user space; terminate backtrace. */ trad_frame_set_id (cache, null_frame_id); } else @@ -416,9 +416,11 @@ i386obsd_trapframe_sniffer (const struct frame_unwind *self, ULONGEST cs; char *name; + /* Check Current Privilige Level and bail out if we're not executing + in kernel space. */ cs = frame_unwind_register_unsigned (next_frame, I386_CS_REGNUM); if ((cs & I386_SEL_RPL) == I386_SEL_UPL) - return NULL; + return 0; find_pc_partial_function (frame_pc_unwind (next_frame), &name, NULL, NULL); return (name && ((strcmp (name, "calltrap") == 0) -- 2.30.2