dccf7f2
diff -up gdb-6.8/gdb/sparc64-linux-tdep.c.sparc gdb-6.8/gdb/sparc64-linux-tdep.c
dccf7f2
--- gdb-6.8/gdb/sparc64-linux-tdep.c.sparc	2008-01-01 16:53:13.000000000 -0600
dccf7f2
+++ gdb-6.8/gdb/sparc64-linux-tdep.c	2008-05-15 14:08:57.000000000 -0500
dccf7f2
@@ -174,6 +174,30 @@ sparc64_linux_collect_core_fpregset (con
dccf7f2
   sparc64_collect_fpregset (regcache, regnum, fpregs);
dccf7f2
 }
dccf7f2
 
dccf7f2
+/* Set the program counter for process PTID to PC.  */
dccf7f2
+
dccf7f2
+static void
dccf7f2
+sparc64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
dccf7f2
+{
dccf7f2
+  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
dccf7f2
+  ULONGEST state;
dccf7f2
+
dccf7f2
+  regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc);
dccf7f2
+  regcache_cooked_write_unsigned (regcache, tdep->npc_regnum, pc + 4);
dccf7f2
+
dccf7f2
+  /* Clear the "in syscall" bit to prevent the kernel from
dccf7f2
+     messing with the PCs we just installed, if we happen to be
dccf7f2
+     within an interrupted system call that the kernel wants to
dccf7f2
+     restart.
dccf7f2
+
dccf7f2
+     Note that after we return from the dummy call, the TSTATE et al.
dccf7f2
+     registers will be automatically restored, and the kernel
dccf7f2
+     continues to restart the system call at this point.  */
dccf7f2
+  regcache_cooked_read_unsigned (regcache, SPARC64_STATE_REGNUM, &state);
dccf7f2
+  state &= ~((ULONGEST)0x20);
dccf7f2
+  regcache_cooked_write_unsigned (regcache, SPARC64_STATE_REGNUM, state);
dccf7f2
+}
dccf7f2
+
dccf7f2
 
dccf7f2
 
dccf7f2
 static void
dccf7f2
@@ -211,6 +235,8 @@ sparc64_linux_init_abi (struct gdbarch_i
dccf7f2
 
dccf7f2
   /* Make sure we can single-step over signal return system calls.  */
dccf7f2
   tdep->step_trap = sparc64_linux_step_trap;
dccf7f2
+
dccf7f2
+  set_gdbarch_write_pc (gdbarch, sparc64_linux_write_pc);
dccf7f2
 }
dccf7f2
 
dccf7f2
 
dccf7f2
diff -up gdb-6.8/gdb/sparc-linux-tdep.c.sparc gdb-6.8/gdb/sparc-linux-tdep.c
dccf7f2
--- gdb-6.8/gdb/sparc-linux-tdep.c.sparc	2008-01-01 16:53:13.000000000 -0600
dccf7f2
+++ gdb-6.8/gdb/sparc-linux-tdep.c	2008-05-15 14:08:12.000000000 -0500
dccf7f2
@@ -211,6 +211,30 @@ sparc32_linux_collect_core_fpregset (con
dccf7f2
   sparc32_collect_fpregset (regcache, regnum, fpregs);
dccf7f2
 }
dccf7f2
 
dccf7f2
+/* Set the program counter for process PTID to PC.  */
dccf7f2
+
dccf7f2
+static void
dccf7f2
+sparc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
dccf7f2
+{
dccf7f2
+  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
dccf7f2
+  ULONGEST psr;
dccf7f2
+
dccf7f2
+  regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc);
dccf7f2
+  regcache_cooked_write_unsigned (regcache, tdep->npc_regnum, pc + 4);
dccf7f2
+
dccf7f2
+  /* Clear the "in syscall" bit to prevent the kernel from
dccf7f2
+     messing with the PCs we just installed, if we happen to be
dccf7f2
+     within an interrupted system call that the kernel wants to
dccf7f2
+     restart.
dccf7f2
+
dccf7f2
+     Note that after we return from the dummy call, the PSR et al.
dccf7f2
+     registers will be automatically restored, and the kernel
dccf7f2
+     continues to restart the system call at this point.  */
dccf7f2
+  regcache_cooked_read_unsigned (regcache, SPARC32_PSR_REGNUM, &psr;;
dccf7f2
+  psr &= ~0x000004000;
dccf7f2
+  regcache_cooked_write_unsigned (regcache, SPARC32_PSR_REGNUM, psr);
dccf7f2
+}
dccf7f2
+
dccf7f2
 
dccf7f2
 
dccf7f2
 static void
dccf7f2
@@ -238,10 +262,6 @@ sparc32_linux_init_abi (struct gdbarch_i
dccf7f2
      prologue analysis.  */
dccf7f2
   tdep->plt_entry_size = 12;
dccf7f2
 
dccf7f2
-  /* GNU/Linux doesn't support the 128-bit `long double' from the psABI.  */
dccf7f2
-  set_gdbarch_long_double_bit (gdbarch, 64);
dccf7f2
-  set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
dccf7f2
-
dccf7f2
   /* Enable TLS support.  */
dccf7f2
   set_gdbarch_fetch_tls_load_module_address (gdbarch,
dccf7f2
                                              svr4_fetch_objfile_link_map);
dccf7f2
@@ -251,6 +271,8 @@ sparc32_linux_init_abi (struct gdbarch_i
dccf7f2
 
dccf7f2
   /* Hook in the DWARF CFI frame unwinder.  */
dccf7f2
   frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
dccf7f2
+
dccf7f2
+  set_gdbarch_write_pc (gdbarch, sparc_linux_write_pc);
dccf7f2
 }
dccf7f2
 
dccf7f2
 /* Provide a prototype to silence -Wmissing-prototypes.  */