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/?a=commitdiff_plain;h=164cbcebeaed273d9cab7d09c4e0723a1cc233b8;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 635f9211a6f..4fee9910311 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 9db544232fe..f005aa64c63 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -2041,6 +2041,7 @@ get_type_signedness (unsigned char * start, case DW_ATE_unsigned: case DW_ATE_unsigned_char: case DW_ATE_unsigned_fixed: + case DW_ATE_CHERI_unsigned_intcap: * is_signed = FALSE; break; @@ -2052,6 +2053,7 @@ get_type_signedness (unsigned char * start, 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; } @@ -2788,6 +2790,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/ChangeLog b/gdb/ChangeLog index 94524c28caf..4ae973ba063 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +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. + 2020-10-20 Luis Machado * target-descriptions.c (make_gdb_type): Handle new capability diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h index f6ebabeaeb9..3260a5e15b8 100644 --- a/gdb/aarch64-tdep.h +++ b/gdb/aarch64-tdep.h @@ -40,6 +40,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 @@ -49,6 +55,7 @@ struct regset; #define D_REGISTER_SIZE 8 #define V_REGISTER_SIZE 16 #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 37409c5c3fc..000738bcd6a 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18024,6 +18024,15 @@ read_base_type (struct die_info *die, struct dwarf2_cu *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 982e25f8f14..86f78d47141 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 13825a3eef7..c559ed1f5bf 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 83cf50d7bf5..ce1cc633af7 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 {