Remove Cell Broadband Engine debugging support
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-ia64-low.c
index d7ab99bf9efe28c8a7dd116cd2af5760a65a8ee8..673f03a1445a1b2ba6ce7dd7eec96770957d6448 100644 (file)
@@ -1,12 +1,11 @@
 /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
-   Free Software Foundation, Inc.
+   Copyright (C) 1995-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "server.h"
+#include "linux-low.h"
 
 #ifdef HAVE_SYS_REG_H
 #include <sys/reg.h>
 #endif
 
-int num_regs = 590;
+/* Defined in auto-generated file reg-ia64.c.  */
+void init_registers_ia64 (void);
+extern const struct target_desc *tdesc_ia64;
+
+#define ia64_num_regs 462
 
 #include <asm/ptrace_offsets.h>
 
-int regmap[] =
+static int ia64_regmap[] =
   {
     /* general registers */
     -1,                /* gr0 not available; i.e, it's always zero */
@@ -254,7 +256,7 @@ int regmap[] =
     -1, -1, -1, -1, -1, -1, -1, -1, -1,
     PT_AR_PFS,
     PT_AR_LC,
-    -1,                /* Not available: EC, the Epilog Count register */
+    PT_AR_EC,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -262,35 +264,97 @@ int regmap[] =
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1,
-    /* nat bits - not fetched directly; instead we obtain these bits from
-       either rnat or unat or from memory. */
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1,
   };
 
-int
-cannot_store_register (int regno)
+static int
+ia64_cannot_store_register (int regno)
 {
   return 0;
 }
 
-int
-cannot_fetch_register (int regno)
+static int
+ia64_cannot_fetch_register (int regno)
+{
+  return 0;
+}
+
+/* GDB register numbers.  */
+#define IA64_GR0_REGNUM                0
+#define IA64_FR0_REGNUM                128
+#define IA64_FR1_REGNUM                129
+
+static int
+ia64_fetch_register (struct regcache *regcache, int regnum)
 {
+  /* r0 cannot be fetched but is always zero.  */
+  if (regnum == IA64_GR0_REGNUM)
+    {
+      const gdb_byte zero[8] = { 0 };
+
+      gdb_assert (sizeof (zero) == register_size (regcache->tdesc, regnum));
+      supply_register (regcache, regnum, zero);
+      return 1;
+    }
+
+  /* fr0 cannot be fetched but is always zero.  */
+  if (regnum == IA64_FR0_REGNUM)
+    {
+      const gdb_byte f_zero[16] = { 0 };
+
+      gdb_assert (sizeof (f_zero) == register_size (regcache->tdesc, regnum));
+      supply_register (regcache, regnum, f_zero);
+      return 1;
+    }
+
+  /* fr1 cannot be fetched but is always one (1.0).  */
+  if (regnum == IA64_FR1_REGNUM)
+    {
+      const gdb_byte f_one[16] =
+       { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
+
+      gdb_assert (sizeof (f_one) == register_size (regcache->tdesc, regnum));
+      supply_register (regcache, regnum, f_one);
+      return 1;
+    }
+
   return 0;
 }
 
+static struct usrregs_info ia64_usrregs_info =
+  {
+    ia64_num_regs,
+    ia64_regmap,
+  };
+
+static struct regs_info regs_info =
+  {
+    NULL, /* regset_bitmap */
+    &ia64_usrregs_info
+  };
+
+static const struct regs_info *
+ia64_regs_info (void)
+{
+  return &regs_info;
+}
+
+static void
+ia64_arch_setup (void)
+{
+  current_process ()->tdesc = tdesc_ia64;
+}
+
+
+struct linux_target_ops the_low_target = {
+  ia64_arch_setup,
+  ia64_regs_info,
+  ia64_cannot_fetch_register,
+  ia64_cannot_store_register,
+  ia64_fetch_register,
+};
+
+void
+initialize_low_arch (void)
+{
+  init_registers_ia64 ();
+}
This page took 0.026326 seconds and 4 git commands to generate.