diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2017-03-20 18:23:47 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-03-20 18:23:47 -0400 |
commit | 639a9038c9f4fc50b6a57c18fe84db4559367a96 (patch) | |
tree | a3e0f539a8b76636082c1981a720d8078bb1603a /gdb/spu-linux-nat.c | |
parent | bcc0c096d5b0f77482cdb3154acd2515a0ca832f (diff) | |
download | gdb-639a9038c9f4fc50b6a57c18fe84db4559367a96.zip gdb-639a9038c9f4fc50b6a57c18fe84db4559367a96.tar.gz gdb-639a9038c9f4fc50b6a57c18fe84db4559367a96.tar.bz2 |
spu: Use ptid from regcache instead of inferior_ptid
The implementations of to_fetch_registers/to_store_registers in the spu
code use some functions that rely on inferior_ptid. It's simpler for
now to set/restore inferior_ptid.
gdb/ChangeLog:
* 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.
Diffstat (limited to 'gdb/spu-linux-nat.c')
-rw-r--r-- | gdb/spu-linux-nat.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c index c5b9122..19552fc 100644 --- a/gdb/spu-linux-nat.c +++ b/gdb/spu-linux-nat.c @@ -492,6 +492,11 @@ spu_fetch_inferior_registers (struct target_ops *ops, 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; @@ -539,6 +544,11 @@ spu_store_inferior_registers (struct target_ops *ops, 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; |