When displaying a capability pointer, don't truncate the length of the type.
Also, update the instance flags to mark capability pointers as
TYPE_INSTANCE_FLAG_CAPABILITY.
gdb/ChangeLog:
2020-11-11 Luis Machado <luis.machado@arm.com>
* aarch64-tdep.c (aarch64_address_class_type_flags)
(aarch64_address_class_type_flags_to_name)
(aarch64_address_class_name_to_type_flags): Use
TYPE_INSTANCE_FLAG_CAPABILITY instead of
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1.
* gdbtypes.h (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): Include
TYPE_INSTANCE_FLAG_CAPABILITY.
* printcmd.c (print_scalar_formatted): Don't truncate capability
pointers.
+2020-11-11 Luis Machado <luis.machado@arm.com>
+
+ * aarch64-tdep.c (aarch64_address_class_type_flags)
+ (aarch64_address_class_type_flags_to_name)
+ (aarch64_address_class_name_to_type_flags): Use
+ TYPE_INSTANCE_FLAG_CAPABILITY instead of
+ TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1.
+ * gdbtypes.h (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): Include
+ TYPE_INSTANCE_FLAG_CAPABILITY.
+ * printcmd.c (print_scalar_formatted): Don't truncate capability
+ pointers.
+
2020-11-11 Luis Machado <luis.machado@arm.com>
* aarch64-linux-nat.c (fetch_cregs_from_thread): Invert pcc/csp
__capability qualifier, meaning a capability for Morello. */
if (dwarf2_addr_class == 1)
- return TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1;
+ return TYPE_INSTANCE_FLAG_CAPABILITY;
return 0;
}
aarch64_address_class_type_flags_to_name (struct gdbarch *gdbarch,
type_instance_flags type_flags)
{
- if (type_flags & TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1)
+ if (type_flags & TYPE_INSTANCE_FLAG_CAPABILITY)
return "__capability";
else
return NULL;
{
if (strcmp (name, "__capability") == 0)
{
- *type_flags_ptr = TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1;
+ *type_flags_ptr = TYPE_INSTANCE_FLAG_CAPABILITY;
return true;
}
else
#define TYPE_ADDRESS_CLASS_2(t) (((t)->instance_flags ()) \
& TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2)
#define TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL \
- (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1 | TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2)
+ (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1 | TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2 \
+ | TYPE_INSTANCE_FLAG_CAPABILITY)
#define TYPE_ADDRESS_CLASS_ALL(t) (((t)->instance_flags ()) \
& TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL)
/* If the value is a pointer, and pointers and addresses are not the
same, then at this point, the value's length (in target bytes) is
gdbarch_addr_bit/TARGET_CHAR_BIT, not TYPE_LENGTH (type). */
- if (type->code () == TYPE_CODE_PTR)
+ if (type->code () == TYPE_CODE_PTR && !TYPE_CAPABILITY (type))
len = gdbarch_addr_bit (gdbarch) / TARGET_CHAR_BIT;
/* If we are printing it as unsigned, truncate it in case it is actually