Update target_stop's documentation
[deliverable/binutils-gdb.git] / gdb / alpha-linux-tdep.c
index 52f19d078cd5264203fa7a732fb9d98bd9df8102..51ce1a7bf3f44ed1fc52eb1dae21ea6f874061ab 100644 (file)
@@ -18,8 +18,6 @@
 
 #include "defs.h"
 #include "frame.h"
-#include "gdb_assert.h"
-#include <string.h>
 #include "osabi.h"
 #include "solib-svr4.h"
 #include "symtab.h"
@@ -166,21 +164,27 @@ alpha_linux_supply_gregset (const struct regset *regset,
                            int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = gregs;
-  int i;
+
   gdb_assert (len >= 32 * 8);
+  alpha_supply_int_regs (regcache, regnum, regs, regs + 31 * 8,
+                        len >= 33 * 8 ? regs + 32 * 8 : NULL);
+}
 
-  for (i = 0; i < ALPHA_ZERO_REGNUM; i++)
-    {
-      if (regnum == i || regnum == -1)
-       regcache_raw_supply (regcache, i, regs + i * 8);
-    }
+/* Collect register REGNUM from the register cache REGCACHE and store
+   it in the buffer specified by GREGS and LEN as described by the
+   general-purpose register set REGSET.  If REGNUM is -1, do this for
+   all registers in REGSET.  */
 
-  if (regnum == ALPHA_PC_REGNUM || regnum == -1)
-    regcache_raw_supply (regcache, ALPHA_PC_REGNUM, regs + 31 * 8);
+static void
+alpha_linux_collect_gregset (const struct regset *regset,
+                            const struct regcache *regcache,
+                            int regnum, void *gregs, size_t len)
+{
+  gdb_byte *regs = gregs;
 
-  if (regnum == ALPHA_UNIQUE_REGNUM || regnum == -1)
-    regcache_raw_supply (regcache, ALPHA_UNIQUE_REGNUM,
-                        len >= 33 * 8 ? regs + 32 * 8 : NULL);
+  gdb_assert (len >= 32 * 8);
+  alpha_fill_int_regs (regcache, regnum, regs, regs + 31 * 8,
+                      len >= 33 * 8 ? regs + 32 * 8 : NULL);
 }
 
 /* Supply register REGNUM from the buffer specified by FPREGS and LEN
@@ -193,29 +197,37 @@ alpha_linux_supply_fpregset (const struct regset *regset,
                             int regnum, const void *fpregs, size_t len)
 {
   const gdb_byte *regs = fpregs;
-  int i;
+
   gdb_assert (len >= 32 * 8);
+  alpha_supply_fp_regs (regcache, regnum, regs, regs + 31 * 8);
+}
 
-  for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; i++)
-    {
-      if (regnum == i || regnum == -1)
-       regcache_raw_supply (regcache, i, regs + (i - ALPHA_FP0_REGNUM) * 8);
-    }
+/* Collect register REGNUM from the register cache REGCACHE and store
+   it in the buffer specified by FPREGS and LEN as described by the
+   general-purpose register set REGSET.  If REGNUM is -1, do this for
+   all registers in REGSET.  */
 
-  if (regnum == ALPHA_FPCR_REGNUM || regnum == -1)
-    regcache_raw_supply (regcache, ALPHA_FPCR_REGNUM, regs + 31 * 8);
+static void
+alpha_linux_collect_fpregset (const struct regset *regset,
+                             const struct regcache *regcache,
+                             int regnum, void *fpregs, size_t len)
+{
+  gdb_byte *regs = fpregs;
+
+  gdb_assert (len >= 32 * 8);
+  alpha_fill_fp_regs (regcache, regnum, regs, regs + 31 * 8);
 }
 
 static const struct regset alpha_linux_gregset =
 {
   NULL,
-  alpha_linux_supply_gregset
+  alpha_linux_supply_gregset, alpha_linux_collect_gregset
 };
 
 static const struct regset alpha_linux_fpregset =
 {
   NULL,
-  alpha_linux_supply_fpregset
+  alpha_linux_supply_fpregset, alpha_linux_collect_fpregset
 };
 
 /* Return the appropriate register set for the core section identified
This page took 0.023996 seconds and 4 git commands to generate.