]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[Morello GDB] Fix a couple hardware watchpoint issues around capabilities
authorLuis Machado <luis.machado@arm.com>
Thu, 28 Jul 2022 02:52:26 +0000 (03:52 +0100)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:15:44 +0000 (16:15 -0700)
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.

gdb/valarith.c
gdb/valprint.c

index 36d30f161f6a5fe9093eba44afef36546d3610fd..6e31b5fb0b23e85e2d3579760d182a8251a62673 100644 (file)
@@ -1713,7 +1713,10 @@ value_equal_contents (struct value *arg1, struct value *arg2)
          && TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
          && memcmp (value_contents (arg1).data (),
                     value_contents (arg2).data (),
-                    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
index 65f446cda296229224c88da56854a09ab98b308f..6a33e011e5936849fcf4307ed4a98677b7a36420 100644 (file)
@@ -529,8 +529,14 @@ generic_value_print_capability (struct value *val, struct ui_file *stream,
        break;
       case lval_memory:
        {
-         struct gdbarch *gdbarch = type->arch ();
-         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 = type->arch ();
+             tag = gdbarch_get_cap_tag_from_address (gdbarch,
+                                                     value_address (val));
+           }
        }
        break;
       default: