]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
value_primitive_field: Always mark capabilities lazy.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 31 Aug 2022 19:01:52 +0000 (12:01 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:47:42 +0000 (16:47 -0700)
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.

gdb/value.c

index 1c0b8d5e4dddaefaa918e2b19e9a33efe1c2a8b3..69c17d23a9b289ca3fca8de72dd13e2ea0548f50 100644 (file)
@@ -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
        {