From 56309b5dff8a3608431cf5664676a3acb6ac376a Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 31 Aug 2022 14:00:19 -0700 Subject: [PATCH] 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. --- gdb/value.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } -- 2.47.2