gdb/riscv: Remove partial target description support
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 6 Mar 2018 16:57:41 +0000 (16:57 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 6 Mar 2018 19:12:59 +0000 (19:12 +0000)
Some parts of the target description support were committed with the
initial riscv patch.  As target descriptions are not currently supported
on riscv this commit removes the two pieces for code that relate to
target description support.

It is expected that target description support will be added in the
future, at which point this, or similar code will be added back.

gdb/ChangeLog:

* riscv-tdep.c (riscv_register_name): Remove target description
support.
(riscv_gdbarch_init): Remove target description check.

gdb/ChangeLog
gdb/riscv-tdep.c

index ccd1354fb4c71f437c87eab76a0bdfaf16ede7fc..4eb6b9b97109e8d701a978b0eadef276c3d07351 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * riscv-tdep.c (riscv_register_name): Remove target description
+       support.
+       (riscv_gdbarch_init): Remove target description check.
+
 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * riscv-tdep.c: Remove 'Contributed by ...' lines from header
index bc25edfa9f276fa17ce8cd211f158e98cc8d6a81..11b122793212551d885757add709b67f3ce19dac 100644 (file)
@@ -464,9 +464,6 @@ value_of_riscv_user_reg (struct frame_info *frame, const void *baton)
 static const char *
 riscv_register_name (struct gdbarch *gdbarch, int regnum)
 {
-  if (tdesc_has_registers (gdbarch_target_desc (gdbarch)))
-    return tdesc_register_name (gdbarch, regnum);
-
   /* Prefer to use the alias. */
   if (regnum >= RISCV_ZERO_REGNUM && regnum <= RISCV_LAST_REGNUM)
     {
@@ -2565,40 +2562,6 @@ riscv_gdbarch_init (struct gdbarch_info info,
   dwarf2_append_unwinders (gdbarch);
   frame_unwind_append_unwinder (gdbarch, &riscv_frame_unwind);
 
-  /* Check any target description for validity.  */
-  if (tdesc_has_registers (info.target_desc))
-    {
-      const struct tdesc_feature *feature;
-      struct tdesc_arch_data *tdesc_data;
-      int valid_p;
-
-      feature = tdesc_find_feature (info.target_desc, "org.gnu.gdb.riscv.cpu");
-      if (feature == NULL)
-       goto no_tdata;
-
-      tdesc_data = tdesc_data_alloc ();
-
-      valid_p = 1;
-      for (i = RISCV_ZERO_REGNUM; i <= RISCV_LAST_FP_REGNUM; ++i)
-        valid_p &= tdesc_numbered_register (feature, tdesc_data, i,
-                                            riscv_gdb_reg_names[i]);
-      for (i = RISCV_FIRST_CSR_REGNUM; i <= RISCV_LAST_CSR_REGNUM; ++i)
-        {
-          char buf[20];
-
-          sprintf (buf, "csr%d", i - RISCV_FIRST_CSR_REGNUM);
-          valid_p &= tdesc_numbered_register (feature, tdesc_data, i, buf);
-        }
-
-      valid_p &= tdesc_numbered_register (feature, tdesc_data, i++, "priv");
-
-      if (!valid_p)
-       tdesc_data_cleanup (tdesc_data);
-      else
-       tdesc_use_registers (gdbarch, info.target_desc, tdesc_data);
-    }
- no_tdata:
-
   for (i = 0; i < ARRAY_SIZE (riscv_register_aliases); ++i)
     user_reg_add (gdbarch, riscv_register_aliases[i].name,
                  value_of_riscv_user_reg, &riscv_register_aliases[i].regnum);