]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
value_fetch_lazy_memory: Fetch tags for *intcap_t as well.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 31 Aug 2022 21:00:19 +0000 (14:00 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:47:42 +0000 (16:47 -0700)
uintcap_t/intcap_t types don't have TYPE_CAPABILITY set, only pointer
types have this flag set.

gdb/value.c

index 69c17d23a9b289ca3fca8de72dd13e2ea0548f50..26425168cb12ab1feba0467a380c960839007f7c 100644 (file)
@@ -3960,8 +3960,10 @@ value_fetch_lazy_memory (struct value *val)
 
   CORE_ADDR addr = value_address (val);
   struct type *type = check_typedef (value_enclosing_type (val));
+  bool has_capability = TYPE_CAPABILITY (type)
+    || type->code () == TYPE_CODE_CAPABILITY;
 
-  if (TYPE_CAPABILITY (type))
+  if (has_capability)
     {
       gdb::byte_vector cap = target_read_capability (addr);
       if (cap.size () == TYPE_LENGTH (type) + 1)
@@ -3978,7 +3980,7 @@ value_fetch_lazy_memory (struct value *val)
                         addr, value_contents_all_raw (val).data (),
                         type_length_units (type));
 
-  if (TYPE_CAPABILITY (type))
+  if (has_capability)
     set_value_tag (val, false);
 }