From: John Baldwin Date: Wed, 31 Aug 2022 21:00:19 +0000 (-0700) Subject: value_fetch_lazy_memory: Fetch tags for *intcap_t as well. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56309b5dff8a3608431cf5664676a3acb6ac376a;p=thirdparty%2Fbinutils-gdb.git value_fetch_lazy_memory: Fetch tags for *intcap_t as well. uintcap_t/intcap_t types don't have TYPE_CAPABILITY set, only pointer types have this flag set. --- diff --git a/gdb/value.c b/gdb/value.c index 69c17d23a9b..26425168cb1 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -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); }