diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-07-15 16:50:51 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-07-15 16:50:51 +0000 |
commit | 30413464fde363f43340064c168e7a78c3a81e82 (patch) | |
tree | e8215d7389cb1be686be9cc49a9e176a4a6b162f /gdb/s390-nat.c | |
parent | 39248af88ff763d5996858f16e87c7c1e14facfd (diff) | |
download | gdb-30413464fde363f43340064c168e7a78c3a81e82.zip gdb-30413464fde363f43340064c168e7a78c3a81e82.tar.gz gdb-30413464fde363f43340064c168e7a78c3a81e82.tar.bz2 |
From Gerhard Tonn <TON@de.ibm.com>:
* s390-nat.c (fill_fpregset, fill_gregset): Use regcache_collect
instead of supply_register.
Diffstat (limited to 'gdb/s390-nat.c')
-rw-r--r-- | gdb/s390-nat.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c index 19e8923..b7f5918 100644 --- a/gdb/s390-nat.c +++ b/gdb/s390-nat.c @@ -273,14 +273,22 @@ supply_fpregset (fpregset_t * fpregsetp) void fill_gregset (gregset_t * gregsetp, int regno) { + int regi; greg_t *gregp = (greg_t *) gregsetp; - if (regno >= S390_FIRST_CR && regno <= S390_LAST_CR) - supply_register (regno, NULL); - else if (regno != -1) - supply_register (regno, (char *) &gregp[regno]); - else - supply_gregset (gregsetp); + if (regno < 0) + { + regcache_collect (S390_PSWM_REGNUM, &gregp[S390_PSWM_REGNUM]); + regcache_collect (S390_PC_REGNUM, &gregp[S390_PC_REGNUM]); + for (regi = 0; regi < S390_NUM_GPRS; regi++) + regcache_collect (S390_GP0_REGNUM + regi, + &gregp[S390_GP0_REGNUM + regi]); + for (regi = 0; regi < S390_NUM_ACRS; regi++) + regcache_collect (S390_FIRST_ACR + regi, + &gregp[S390_FIRST_ACR + regi]); + } + else if (regno >= S390_PSWM_REGNUM && regno <= S390_LAST_ACR) + regcache_collect (regno, &gregp[regno]); } /* Given a pointer to a floating point register set in /proc format @@ -291,12 +299,18 @@ fill_gregset (gregset_t * gregsetp, int regno) void fill_fpregset (fpregset_t * fpregsetp, int regno) { - if (regno == -1) - supply_fpregset (fpregsetp); - else - supply_register (regno, - &((char *) fpregsetp)[REGISTER_BYTE (regno) - - REGISTER_BYTE (S390_FPC_REGNUM)]); + int regi; + + if (regno < 0) + { + regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc); + for (regi = 0; regi < S390_NUM_FPRS; regi++) + regcache_collect (S390_FP0_REGNUM + regi, &fpregsetp->fprs[regi]); + } + else if (regno == S390_FPC_REGNUM) + regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc); + else if (regno >= S390_FP0_REGNUM && regno <= S390_FPLAST_REGNUM) + regcache_collect (regno, &fpregsetp->fprs[regno - S390_FP0_REGNUM]); } |