Disable displaced stepping if trying it fails
[deliverable/binutils-gdb.git] / gdb / i386-darwin-nat.c
index a60bc6ce3e054b980be0aa40d57f7711cca04ab7..5acba7cd25a7fe5fa67043e7c740e6b3599e8ac3 100644 (file)
@@ -1,5 +1,5 @@
 /* Darwin support for GDB, the GNU debugger.
-   Copyright (C) 1997-2014 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
 
    Contributed by Apple Computer, Inc.
 
@@ -73,6 +73,11 @@ i386_darwin_fetch_inferior_registers (struct target_ops *ops,
                                 (unsigned long) current_thread);
              MACH_CHECK_ERROR (ret);
            }
+
+         /* Some kernels don't sanitize the values.  */
+         gp_regs.uts.ts64.__fs &= 0xffff;
+         gp_regs.uts.ts64.__gs &= 0xffff;
+
          amd64_supply_native_gregset (regcache, &gp_regs.uts, -1);
           fetched++;
         }
@@ -183,6 +188,10 @@ i386_darwin_store_inferior_registers (struct target_ops *ops,
 
          amd64_collect_native_gregset (regcache, &gp_regs.uts, regno);
 
+         /* Some kernels don't sanitize the values.  */
+         gp_regs.uts.ts64.__fs &= 0xffff;
+         gp_regs.uts.ts64.__gs &= 0xffff;
+
           ret = thread_set_state (current_thread, x86_THREAD_STATE,
                                   (thread_state_t) &gp_regs,
                                   x86_THREAD_STATE_COUNT);
This page took 0.023935 seconds and 4 git commands to generate.