]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbarch: Remove method for register tags.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 6 Jul 2022 21:57:42 +0000 (14:57 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:43:05 +0000 (16:43 -0700)
This functionality is now provided by regcache register tags.

gdb/arch-utils.c
gdb/arch-utils.h
gdb/frame.c
gdb/gdbarch-components.py
gdb/gdbarch-gen.h
gdb/gdbarch.c

index f80384220330e0640868a1dd5b9a45c2a82647ba..b0a10b5e2a6dcbe8eb017886d67728855972e477 100644 (file)
@@ -1092,33 +1092,6 @@ default_read_core_file_mappings
 {
 }
 
-/* See arch-utils.h.  */
-bool
-default_register_has_tag (struct gdbarch *gdbarch,
-                         readable_regcache *regcache,
-                         int cookednum)
-{
-  return false;
-}
-
-/* See arch-utils.h.  */
-bool
-default_register_tag (struct gdbarch *gdbarch,
-                     readable_regcache *regcache,
-                     int cookednum)
-{
-  return false;
-}
-
-/* See arch-utils.h.  */
-void
-default_register_set_tag (struct gdbarch *gdbarch,
-                         regcache *regcache,
-                         int cookednum, bool tag)
-{
-  return;
-}
-
 /* See arch-utils.h.  */
 bool default_get_cap_tag_from_address (struct gdbarch *gdbarch,
                                       CORE_ADDR addr)
index 53c8a8d77cf2d3ee11e923a1f034e744c128876f..334ab5f72871378c673d6a973fbc99b1881eb50f 100644 (file)
@@ -301,21 +301,6 @@ extern void default_read_core_file_mappings
    read_core_file_mappings_pre_loop_ftype pre_loop_cb,
    read_core_file_mappings_loop_ftype loop_cb);
 
-/* Default implementation of gdbarch_register_has_tag.  */
-extern bool default_register_has_tag (struct gdbarch *gdbarch,
-                                     readable_regcache *regcache,
-                                     int cookednum);
-
-/* Default implementation of gdbarch_register_tag.  */
-extern bool default_register_tag (struct gdbarch *gdbarch,
-                                 readable_regcache *regcache,
-                                 int cookednum);
-
-/* Default implementation of gdbarch_register_set_tag.  */
-extern void default_register_set_tag (struct gdbarch *gdbarch,
-                                     regcache *regcache,
-                                     int cookednum, bool tag);
-
 /* Default implementation of gdbarch_cap_tag_from_address.  */
 extern bool default_get_cap_tag_from_address (struct gdbarch *gdbarch,
                                              CORE_ADDR addr);
index d33ac9260a03c069e2073b55d78856daabe4f1ca..75dfc98220386121f84df6946802c335bcf58321 100644 (file)
@@ -1413,8 +1413,8 @@ put_frame_register (struct frame_info *frame, int regnum,
                && TYPE_CAPABILITY (val_type)))
            && value_tagged (fromval))
          {
-           gdbarch_register_set_tag (gdbarch, get_current_regcache (),
-                                     regnum, value_tag (fromval));
+           get_current_regcache ()->raw_supply_tag (realnum,
+                                                    value_tag (fromval));
          }
       }
       break;
index 825a48e2f972a730304c4dd87bb693e5ddc2af45..44eac608b48b31aa1b4d9ccf570bcf40119da304 100644 (file)
@@ -2691,48 +2691,3 @@ Read core file mappings
     predefault="default_read_core_file_mappings",
     invalid=False,
 )
-
-Method(
-    comment="""
-Returns true if register COOKEDNUM has a tag and false otherwise.
-The default is to always return false.
-""",
-    type="bool",
-    name="register_has_tag",
-    params=[
-        ("readable_regcache *", "regcache"),
-        ("int", "cookednum"),
-    ],
-    predefault="default_register_has_tag",
-    invalid=False,
-)
-
-Method(
-    comment="""
-Returns true if the register tag bit is 1 and false otherwise.
-The default is to always return false.
-""",
-    type="bool",
-    name="register_tag",
-    params=[
-        ("readable_regcache *", "regcache"),
-        ("int", "cookednum"),
-    ],
-    predefault="default_register_tag",
-    invalid=False,
-)
-
-Method(
-    comment="""
-Sets the register tag to TAG.
-""",
-    type="void",
-    name="register_set_tag",
-    params=[
-        ("regcache *", "regcache"),
-        ("int", "cookednum"),
-        ("bool", "tag"),
-    ],
-    predefault="default_register_set_tag",
-    invalid=False,
-)
index 4498bfcc84bc7da7a9cc74f422d0e8e996d2c410..2be9b2bc37867262d3ba44d52d95ba3f5922267b 100644 (file)
@@ -1653,23 +1653,3 @@ extern void set_gdbarch_get_pc_address_flags (struct gdbarch *gdbarch, gdbarch_g
 typedef void (gdbarch_read_core_file_mappings_ftype) (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb);
 extern void gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb);
 extern void set_gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, gdbarch_read_core_file_mappings_ftype *read_core_file_mappings);
-
-/* Returns true if register COOKEDNUM has a tag and false otherwise.
-   The default is to always return false. */
-
-typedef bool (gdbarch_register_has_tag_ftype) (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
-extern bool gdbarch_register_has_tag (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
-extern void set_gdbarch_register_has_tag (struct gdbarch *gdbarch, gdbarch_register_has_tag_ftype *register_has_tag);
-
-/* Returns true if the register tag bit is 1 and false otherwise.
-   The default is to always return false. */
-
-typedef bool (gdbarch_register_tag_ftype) (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
-extern bool gdbarch_register_tag (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
-extern void set_gdbarch_register_tag (struct gdbarch *gdbarch, gdbarch_register_tag_ftype *register_tag);
-
-/* Sets the register tag to TAG. */
-
-typedef void (gdbarch_register_set_tag_ftype) (struct gdbarch *gdbarch, regcache *regcache, int cookednum, bool tag);
-extern void gdbarch_register_set_tag (struct gdbarch *gdbarch, regcache *regcache, int cookednum, bool tag);
-extern void set_gdbarch_register_set_tag (struct gdbarch *gdbarch, gdbarch_register_set_tag_ftype *register_set_tag);
index 59e830e543dc8312a0806fbf5bf773c6e2988d9f..ae9335c71ba4e7825d2b80438928f14c1d4ab2f6 100644 (file)
@@ -254,9 +254,6 @@ struct gdbarch
   gdbarch_type_align_ftype *type_align;
   gdbarch_get_pc_address_flags_ftype *get_pc_address_flags;
   gdbarch_read_core_file_mappings_ftype *read_core_file_mappings;
-  gdbarch_register_has_tag_ftype *register_has_tag;
-  gdbarch_register_tag_ftype *register_tag;
-  gdbarch_register_set_tag_ftype *register_set_tag;
 };
 
 /* Create a new ``struct gdbarch'' based on information provided by
@@ -382,9 +379,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->type_align = default_type_align;
   gdbarch->get_pc_address_flags = default_get_pc_address_flags;
   gdbarch->read_core_file_mappings = default_read_core_file_mappings;
-  gdbarch->register_has_tag = default_register_has_tag;
-  gdbarch->register_tag = default_register_tag;
-  gdbarch->register_set_tag = default_register_set_tag;
   /* gdbarch_alloc() */
 
   return gdbarch;
@@ -626,9 +620,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of type_align, invalid_p == 0 */
   /* Skip verify of get_pc_address_flags, invalid_p == 0 */
   /* Skip verify of read_core_file_mappings, invalid_p == 0 */
-  /* Skip verify of register_has_tag, invalid_p == 0 */
-  /* Skip verify of register_tag, invalid_p == 0 */
-  /* Skip verify of register_set_tag, invalid_p == 0 */
   if (!log.empty ())
     internal_error (__FILE__, __LINE__,
                    _("verify_gdbarch: the following are invalid ...%s"),
@@ -1471,15 +1462,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_filtered (file,
                       "gdbarch_dump: read_core_file_mappings = <%s>\n",
                       host_address_to_string (gdbarch->read_core_file_mappings));
-  fprintf_filtered (file,
-                      "gdbarch_dump: register_has_tag = <%s>\n",
-                      host_address_to_string (gdbarch->register_has_tag));
-  fprintf_filtered (file,
-                      "gdbarch_dump: register_tag = <%s>\n",
-                      host_address_to_string (gdbarch->register_tag));
-  fprintf_filtered (file,
-                      "gdbarch_dump: register_set_tag = <%s>\n",
-                      host_address_to_string (gdbarch->register_set_tag));
   if (gdbarch->dump_tdep != NULL)
     gdbarch->dump_tdep (gdbarch, file);
 }
@@ -5457,54 +5439,3 @@ set_gdbarch_read_core_file_mappings (struct gdbarch *gdbarch,
 {
   gdbarch->read_core_file_mappings = read_core_file_mappings;
 }
-
-bool
-gdbarch_register_has_tag (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->register_has_tag != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_register_has_tag called\n");
-  return gdbarch->register_has_tag (gdbarch, regcache, cookednum);
-}
-
-void
-set_gdbarch_register_has_tag (struct gdbarch *gdbarch,
-                              gdbarch_register_has_tag_ftype register_has_tag)
-{
-  gdbarch->register_has_tag = register_has_tag;
-}
-
-bool
-gdbarch_register_tag (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->register_tag != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_register_tag called\n");
-  return gdbarch->register_tag (gdbarch, regcache, cookednum);
-}
-
-void
-set_gdbarch_register_tag (struct gdbarch *gdbarch,
-                          gdbarch_register_tag_ftype register_tag)
-{
-  gdbarch->register_tag = register_tag;
-}
-
-void
-gdbarch_register_set_tag (struct gdbarch *gdbarch, regcache *regcache, int cookednum, bool tag)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->register_set_tag != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_register_set_tag called\n");
-  gdbarch->register_set_tag (gdbarch, regcache, cookednum, tag);
-}
-
-void
-set_gdbarch_register_set_tag (struct gdbarch *gdbarch,
-                              gdbarch_register_set_tag_ftype register_set_tag)
-{
-  gdbarch->register_set_tag = register_set_tag;
-}