]> 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)
committerLuis Machado <luis.machado@arm.com>
Mon, 1 Aug 2022 07:57:27 +0000 (08:57 +0100)
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 7127a5d676339e3d95cf0191a685c88ace99d40a..3a9d9f0d73726c5674dbfcda7a5714d8745f49e5 100644 (file)
@@ -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
index b34b6b56ee3a8cbf902f278354a9e77ca69356bf..bcc084fb08c8cc46906f1343c1d83cea44ce07b0 100644 (file)
@@ -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: