From: John Baldwin Date: Wed, 6 Jul 2022 21:57:42 +0000 (-0700) Subject: gdbarch: Remove method for register tags. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3f3467a683bd5f9e09a9b95a5fb3ba3bb1647f8;p=thirdparty%2Fbinutils-gdb.git gdbarch: Remove method for register tags. This functionality is now provided by regcache register tags. --- diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index f8038422033..b0a10b5e2a6 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -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) diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 53c8a8d77cf..334ab5f7287 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -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); diff --git a/gdb/frame.c b/gdb/frame.c index d33ac9260a0..75dfc982203 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -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; diff --git a/gdb/gdbarch-components.py b/gdb/gdbarch-components.py index 825a48e2f97..44eac608b48 100644 --- a/gdb/gdbarch-components.py +++ b/gdb/gdbarch-components.py @@ -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, -) diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index 4498bfcc84b..2be9b2bc378 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -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); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 59e830e543d..ae9335c71ba 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -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; -}