+2020-10-20 Luis Machado <luis.machado@arm.com>
+
+ * findvar.c (extract_typed_address): Handle capabilities.
+ (store_typed_address): Likewise.
+ * value.c (unpack_long): Likewise.
+ (pack_long): Likewise.
+
2020-10-20 Luis Machado <luis.machado@arm.com>
* valops.c (value_cast): Cast from capability to scalar types.
CORE_ADDR
extract_typed_address (const gdb_byte *buf, struct type *type)
{
- if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
+ if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type)
+ && type->code () != TYPE_CODE_CAPABILITY)
internal_error (__FILE__, __LINE__,
_("extract_typed_address: "
"type is not a pointer or reference"));
void
store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
- if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
+ if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type)
+ && type->code () != TYPE_CODE_CAPABILITY)
internal_error (__FILE__, __LINE__,
_("store_typed_address: "
"type is not a pointer or reference"));
case TYPE_CODE_PTR:
case TYPE_CODE_REF:
case TYPE_CODE_RVALUE_REF:
+ case TYPE_CODE_CAPABILITY:
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */
return extract_typed_address (valaddr, type);
case TYPE_CODE_REF:
case TYPE_CODE_RVALUE_REF:
case TYPE_CODE_PTR:
+ case TYPE_CODE_CAPABILITY:
store_typed_address (buf, type, (CORE_ADDR) num);
break;