+2017-03-20 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * spu-linux-nat.c (spu_fetch_inferior_registers,
+ spu_store_inferior_registers): Use ptid from regcache, set and
+ restore inferior_ptid.
+ * spu-multiarch.c (spu_fetch_registers, spu_store_registers):
+ Likewise.
+
2017-03-20 Simon Marchi <simon.marchi@polymtl.ca>
* i386-linux-nat.c (fetch_register, store_register,
int fd;
ULONGEST addr;
+ /* Since we use functions that rely on inferior_ptid, we need to set and
+ restore it. */
+ scoped_restore save_ptid
+ = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+
/* We must be stopped on a spu_run system call. */
if (!parse_spufs_run (&fd, &addr))
return;
int fd;
ULONGEST addr;
+ /* Since we use functions that rely on inferior_ptid, we need to set and
+ restore it. */
+ scoped_restore save_ptid
+ = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+
/* We must be stopped on a spu_run system call. */
if (!parse_spufs_run (&fd, &addr))
return;
int spufs_fd;
CORE_ADDR spufs_addr;
+ /* Since we use functions that rely on inferior_ptid, we need to set and
+ restore it. */
+ scoped_restore save_ptid
+ = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
{
int spufs_fd;
CORE_ADDR spufs_addr;
+ /* Since we use functions that rely on inferior_ptid, we need to set and
+ restore it. */
+ scoped_restore save_ptid
+ = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
{