[Bug tdep/34434] [gdb/tdep] Make ppc less dependent on user area layout constants

"vries at gcc dot gnu.org via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34434

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative patch:
...
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 413e0e0ab97..b00fa4e48f8 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -905,6 +905,8 @@ check_regset (int tid, int regset_id, int regsetsize)
     return false;
 }

+static void fetch_fp_regs (struct regcache *regcache, int tid);
+
 static void
 fetch_register (struct regcache *regcache, int tid, int regno)
 {
@@ -1064,6 +1066,13 @@ fetch_register (struct regcache *regcache, int tid, int
regno)
                    &ppc32_linux_ctarregset);
       return;
     }
+  else if (tdep->ppc_fp0_regnum >= 0
+          && regno >= tdep->ppc_fp0_regnum
+          && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)
+    {
+      fetch_fp_regs (regcache, tid);
+      return;
+    }

   if (regaddr == -1)
     {
@@ -1470,6 +1479,8 @@ store_spe_register (const struct regcache *regcache, int
tid, int regno)
   set_spe_registers (tid, &evrregs);
 }

+static void store_fp_regs (const struct regcache *regcache, int tid, int
regno);
+
 static void
 store_register (const struct regcache *regcache, int tid, int regno)
 {
@@ -1617,6 +1628,13 @@ store_register (const struct regcache *regcache, int
tid, int regno)
                    &ppc32_linux_ctarregset);
       return;
     }
+  else if (tdep->ppc_fp0_regnum >= 0
+          && regno >= tdep->ppc_fp0_regnum
+          && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)
+    {
+      store_fp_regs (regcache, tid, regno);
+      return;
+    }

   if (regaddr == -1)
     return;
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.