From: John Baldwin Date: Wed, 31 Aug 2022 19:01:52 +0000 (-0700) Subject: value_primitive_field: Always mark capabilities lazy. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d176ed7c9afbcebb385f9ca8626fd3de8478429c;p=thirdparty%2Fbinutils-gdb.git value_primitive_field: Always mark capabilities lazy. value_primitive_field copies the subrange of a non-lazy value into the new value for a subobject. However, the value of outer objects never contain tags. Instead, always mark new values as lazy if they are a capability or are a structure containing a capability member. --- diff --git a/gdb/value.c b/gdb/value.c index 1c0b8d5e4dd..69c17d23a9b 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3136,7 +3136,7 @@ value_primitive_field (struct value *arg1, LONGEST offset, else boffset = arg_type->field (fieldno).loc_bitpos () / 8; - if (value_lazy (arg1)) + if (value_lazy (arg1) || type->contains_capability ()) v = allocate_value_lazy (value_enclosing_type (arg1)); else { @@ -3169,7 +3169,8 @@ value_primitive_field (struct value *arg1, LONGEST offset, if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) value_fetch_lazy (arg1); - if (value_lazy (arg1)) + if (value_lazy (arg1) || type->code () == TYPE_CODE_CAPABILITY + || TYPE_CAPABILITY (type)) v = allocate_value_lazy (type); else {