From f00d375378d3736554aa60d7c2c4529ce00b3800 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Tue, 20 Nov 2001 16:35:24 +0000 Subject: [PATCH] 2001-11-19 Elena Zannoni * ppc-linux-nat.c (COPY_REG): Use regcache_collect instead of accessing registers[]. (fill_fpregset): Ditto. --- gdb/ChangeLog | 6 ++++++ gdb/ppc-linux-nat.c | 11 ++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ea26632e324..25f6565ea6c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2001-11-19 Elena Zannoni + + * ppc-linux-nat.c (COPY_REG): Use regcache_collect instead of + accessing registers[]. + (fill_fpregset): Ditto. + 2001-11-19 Elena Zannoni * infptrace.c (fetch_register): Dynamically allocate buffer for diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index bcb438c543d..13eb839cbc6 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -80,8 +80,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno) #define COPY_REG(_idx_,_regi_) \ if ((regno == -1) || regno == _regi_) \ - memcpy (regp + _idx_, ®isters[REGISTER_BYTE (_regi_)], \ - REGISTER_RAW_SIZE (_regi_)) + regcache_collect (_regi_, regp + _idx_) for (regi = 0; regi < 32; regi++) { @@ -113,16 +112,10 @@ void fill_fpregset (gdb_fpregset_t *fpregsetp, int regno) { int regi; - char *to; - char *from; for (regi = 0; regi < 32; regi++) { if ((regno == -1) || (regno == FP0_REGNUM + regi)) - { - from = (char *) ®isters[REGISTER_BYTE (FP0_REGNUM + regi)]; - to = (char *) (*fpregsetp + regi); - memcpy (to, from, REGISTER_RAW_SIZE (FP0_REGNUM + regi)); - } + regcache_collect (FP0_REGNUM + regi, (char *) (*fpregsetp + regi)); } } -- 2.30.2