sim: ppc: unify env settings too
[binutils-gdb.git] / gdb / sparc-tdep.c
index 4f9c679b55cd221c674239102af108a588e24b63..a6df0fcb58b47132619ea59e1bd53198c1ba184a 100644 (file)
@@ -189,7 +189,7 @@ ULONGEST
 sparc_fetch_wcookie (struct gdbarch *gdbarch)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  struct target_ops *ops = current_top_target ();
+  struct target_ops *ops = current_inferior ()->top_target ();
   gdb_byte buf[8];
   int len;
 
@@ -1948,6 +1948,9 @@ sparc_supply_rwindow (struct regcache *regcache, CORE_ADDR sp, int regnum)
   gdb_byte buf[8];
   int i;
 
+  /* This function calls functions that depend on the global current thread.  */
+  gdb_assert (regcache->ptid () == inferior_ptid);
+
   if (sp & 1)
     {
       /* Registers are 64-bit.  */
@@ -2022,6 +2025,9 @@ sparc_collect_rwindow (const struct regcache *regcache,
   gdb_byte buf[8];
   int i;
 
+  /* This function calls functions that depend on the global current thread.  */
+  gdb_assert (regcache->ptid () == inferior_ptid);
+
   if (sp & 1)
     {
       /* Registers are 64-bit.  */