From: Luis Machado Date: Thu, 5 Mar 2020 20:13:25 +0000 (-0300) Subject: [Morello] Add new DWARF defines for capabilities X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4636a629cab1570ca853eb8e2b35c6c8baa2adf5;p=thirdparty%2Fbinutils-gdb.git [Morello] Add new DWARF defines for capabilities This patch adds some new definitions required for Morello. * DWARF base types: DW_ATE_CHERI_signed_intcap and DW_ATE_CHERI_unsigned_intcap. * DWARF address class: DW_ADDR_capability * DWARF register numbering It also adds support for handling DW_ATE_CHERI_signed_intcap and DW_ATE_CHERI_unsigned_intcap on binutils and GDB. binutils/ChangeLog 2020-10-20 Luis Machado * dwarf.c (get_type_signedness): Handles capabilities. (read_and_display_attr_value): Likewise. gdb/ChangeLog: 2020-10-20 Luis Machado * aarch64-tdep.h (AARCH64_DWARF_C0, AARCH64_DWARF_CSP) (AARCH64_DWARF_PCC, AARCH64_DWARF_DDC) (AARCH64_DWARF_RESERVED_1, AARCH64_DWARF_RESERVED_2) (C_REGISTER_SIZE): New defines. * dwarf2/read.c (read_base_type): Handle capabilities. include/ChangeLog 2020-10-20 Luis Machado * dwarf2.def (DW_ATE_CHERI_signed_intcap) (DW_ATE_CHERI_unsigned_intcap): New defines. * dwarf2.h (DW_ADDR_capability): New define. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 235d09878a0..0eff37d1c75 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2020-10-20 Luis Machado + + * dwarf.c (get_type_signedness): Handles capabilities. + (read_and_display_attr_value): Likewise. + 2020-10-20 Siddhesh Poyarekar * dwarf.c (dwarf_regnames_aarch64): Add capability registers. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 9bfe48f93ad..aac4fb8e6d8 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -2255,6 +2255,7 @@ get_type_signedness (abbrev_entry *entry, case DW_ATE_unsigned: case DW_ATE_unsigned_char: case DW_ATE_unsigned_fixed: + case DW_ATE_CHERI_unsigned_intcap: * is_signed = false; break; @@ -2266,6 +2267,7 @@ get_type_signedness (abbrev_entry *entry, case DW_ATE_imaginary_float: case DW_ATE_decimal_float: case DW_ATE_signed_fixed: + case DW_ATE_CHERI_signed_intcap: * is_signed = true; break; } @@ -3097,6 +3099,13 @@ read_and_display_attr_value (unsigned long attribute, case DW_ATE_HP_imaginary_float80: printf ("(HP_imaginary_float80)"); break; case DW_ATE_HP_imaginary_float128: printf ("(HP_imaginary_float128)"); break; + case DW_ATE_CHERI_signed_intcap: + printf ("(CHERI intcap_t)"); + break; + case DW_ATE_CHERI_unsigned_intcap: + printf ("(CHERI uintcap_t)"); + break; + default: if (uvalue >= DW_ATE_lo_user && uvalue <= DW_ATE_hi_user) diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h index 3b9f67d6344..97146054d91 100644 --- a/gdb/aarch64-tdep.h +++ b/gdb/aarch64-tdep.h @@ -42,6 +42,12 @@ struct regset; #define AARCH64_DWARF_SVE_FFR 47 #define AARCH64_DWARF_SVE_P0 48 #define AARCH64_DWARF_SVE_Z0 96 +#define AARCH64_DWARF_C0 198 +#define AARCH64_DWARF_CSP 229 +#define AARCH64_DWARF_PCC 230 +#define AARCH64_DWARF_DDC 231 +#define AARCH64_DWARF_RESERVED_1 232 +#define AARCH64_DWARF_RESERVED_2 233 /* Size of integer registers. */ #define X_REGISTER_SIZE 8 @@ -50,6 +56,7 @@ struct regset; #define S_REGISTER_SIZE 4 #define D_REGISTER_SIZE 8 #define Q_REGISTER_SIZE 16 +#define C_REGISTER_SIZE 16 /* Total number of general (X) registers. */ #define AARCH64_X_REGISTER_COUNT 32 diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 10550336063..139fee4685e 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18284,6 +18284,15 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) finish_fixed_point_type (type, gnat_encoding_suffix, die, cu); break; + case DW_ATE_CHERI_signed_intcap: + case DW_ATE_CHERI_unsigned_intcap: + { + /* Turn DW_ATE_CHERI_*_intcap into a void * pointer. */ + type = init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, NULL); + type = init_pointer_type (objfile, bits, name, type); + break; + } + default: complaint (_("unsupported DW_AT_encoding: '%s'"), dwarf_type_encoding_name (encoding)); diff --git a/include/ChangeLog b/include/ChangeLog index 67f10a9f290..9b58eefcfbf 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,9 @@ +2020-10-20 Luis Machado + + * dwarf2.def (DW_ATE_CHERI_signed_intcap) + (DW_ATE_CHERI_unsigned_intcap): New defines. + * dwarf2.h (DW_ADDR_capability): New define. + 2020-10-20 Siddhesh Poyarekar * elf/aarch64.h: New Morello TLSDESC relocations. diff --git a/include/dwarf2.def b/include/dwarf2.def index 530c6f849f9..e379897eced 100644 --- a/include/dwarf2.def +++ b/include/dwarf2.def @@ -750,6 +750,11 @@ DW_ATE (DW_ATE_HP_unsigned_fixed, 0x8e) /* Cobol. */ DW_ATE (DW_ATE_HP_VAX_complex_float, 0x8f) /* F or G floating complex. */ DW_ATE (DW_ATE_HP_VAX_complex_float_d, 0x90) /* D floating complex. */ +/* Describes a signed integer/capability type __intcap_t. */ +DW_ATE (DW_ATE_CHERI_signed_intcap, 0xa0) +/* Describes an unsigned integer/capability type __uintcap_t. */ +DW_ATE (DW_ATE_CHERI_unsigned_intcap, 0xa1) + DW_END_ATE DW_FIRST_CFA (DW_CFA_advance_loc, 0x40) diff --git a/include/dwarf2.h b/include/dwarf2.h index 40aa5a54f01..85ece242c5d 100644 --- a/include/dwarf2.h +++ b/include/dwarf2.h @@ -331,6 +331,9 @@ enum dwarf_location_list_entry_type #define DW_ADDR_none 0 +/* The type is an address capability and can be dereferenced as such. */ +#define DW_ADDR_capability 0x1 + /* Source language names and codes. */ enum dwarf_source_language {