From: Luis Machado Date: Thu, 28 Jul 2022 02:52:26 +0000 (+0100) Subject: [Morello GDB] Fix a couple hardware watchpoint issues around capabilities X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b6368f341599ef6c55c16d2eb24ecd0ffd126cf;p=thirdparty%2Fbinutils-gdb.git [Morello GDB] Fix a couple hardware watchpoint issues around capabilities This patch fixes a couple issues around hardware watchpoint triggers related to capabilities. 1 - When a capability changes and the hardware watchpoint triggers, Morello GDB should display the tag state for new/old values correctly. 2 - Take the capability tag into consideration when checking for content changes to the watched area. The 128 bits may be the same, but the tag state may differ. --- diff --git a/gdb/valarith.c b/gdb/valarith.c index 7127a5d6763..3a9d9f0d737 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -1696,7 +1696,10 @@ value_equal_contents (struct value *arg1, struct value *arg2) return (type1->code () == type2->code () && TYPE_LENGTH (type1) == TYPE_LENGTH (type2) && memcmp (value_contents (arg1), value_contents (arg2), - TYPE_LENGTH (type1)) == 0); + TYPE_LENGTH (type1)) == 0 + && ((!value_tagged (arg1) && !value_tagged (arg2)) + || (value_tagged (arg1) && value_tagged (arg2) + && value_tag (arg1) == value_tag (arg2)))); } /* Simulate the C operator < by returning 1 diff --git a/gdb/valprint.c b/gdb/valprint.c index b34b6b56ee3..bcc084fb08c 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -514,8 +514,14 @@ generic_value_print_capability (struct value *val, struct ui_file *stream, break; case lval_memory: { - struct gdbarch *gdbarch = get_type_arch (type); - tag = gdbarch_get_cap_tag_from_address (gdbarch, value_address (val)); + if (!value_lazy (val) && value_tagged (val)) + tag = value_tag (val); + else + { + struct gdbarch *gdbarch = get_type_arch (type); + tag = gdbarch_get_cap_tag_from_address (gdbarch, + value_address (val)); + } } break; default: