Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb/dist/gdb It is not nice to fake things we ...



details:   https://anonhg.NetBSD.org/src/rev/e5d513ee585a
branches:  trunk
changeset: 795502:e5d513ee585a
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Apr 16 02:14:44 2014 +0000

description:
It is not nice to fake things we don't have; instead check explicitly
that we can get CS.

diffstat:

 external/gpl3/gdb/dist/gdb/amd64nbsd-nat.c  |   2 --
 external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c |  14 +++++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diffs (37 lines):

diff -r cbca1963f9c4 -r e5d513ee585a external/gpl3/gdb/dist/gdb/amd64nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/amd64nbsd-nat.c        Wed Apr 16 01:30:33 2014 +0000
+++ b/external/gpl3/gdb/dist/gdb/amd64nbsd-nat.c        Wed Apr 16 02:14:44 2014 +0000
@@ -120,8 +120,6 @@
   regcache_raw_supply (regcache, AMD64_RBP_REGNUM, &pcb->pcb_rbp);
   regcache_raw_supply (regcache, AMD64_FS_REGNUM, &pcb->pcb_fs);
   regcache_raw_supply (regcache, AMD64_GS_REGNUM, &pcb->pcb_gs);
-  /* fake it to 0 so SEL_UPL is not set (our sniffer looks at CS) */
-  regcache_raw_supply (regcache, AMD64_CS_REGNUM, &zero);
 
   return 1;
 }
diff -r cbca1963f9c4 -r e5d513ee585a external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c       Wed Apr 16 01:30:33 2014 +0000
+++ b/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c       Wed Apr 16 02:14:44 2014 +0000
@@ -230,12 +230,16 @@
 {
   ULONGEST cs;
   const char *name;
+  volatile struct gdb_exception ex;
 
-  /* Check Current Privilege Level and bail out if we're not executing
-     in kernel space.  */
-  cs = get_frame_register_unsigned (this_frame, AMD64_CS_REGNUM);
-  if ((cs & I386_SEL_RPL) == I386_SEL_UPL)
-    return 0;
+  TRY_CATCH (ex, RETURN_MASK_ERROR)
+    {
+      cs = get_frame_register_unsigned (this_frame, AMD64_CS_REGNUM);
+      if ((cs & I386_SEL_RPL) == I386_SEL_UPL)
+       return 0;
+    }
+  if (ex.reason < 0 && ex.error != NOT_AVAILABLE_ERROR)
+    throw_exception (ex);
 
   find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL);
   return (name && ((strcmp (name, "alltraps") == 0)



Home | Main Index | Thread Index | Old Index