From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7824) id 1915D3857403; Fri, 7 Oct 2022 18:34:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1915D3857403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665167666; bh=cBlhj52DWsstBZY9T89Py7Cn9Llufg1Gn90rffZsc3g=; h=From:To:Subject:Date:From; b=tHNPjMjEsrTZsZh1U7dZ8Xc0g9VJ2IOz0q13Tk5+QJAvfR0WAqk48k3gBod1qjwIu gfasd7BoAGszRGTUVUhguD9+bJ8Vt6N3KvLPjCVoMRFujMwCjXA+7b9QK6ZgPJph2e O1M+2Ic2GjzD319S4Mu8fRP29JSj0l+M8IOFI3GM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: David Faust To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/dfaust/heads/btf-type-tag-new-rebase)] include: Add BTF tag defines to dwarf2 and btf X-Act-Checkin: gcc X-Git-Author: David Faust X-Git-Refname: refs/users/dfaust/heads/btf-type-tag-new-rebase X-Git-Oldrev: 9152a143db240e76491a5bc1c432fe74b6396350 X-Git-Newrev: b6e7be91ec799f465f90c678bf4e1e8c4242a6b5 Message-Id: <20221007183426.1915D3857403@sourceware.org> Date: Fri, 7 Oct 2022 18:34:26 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b6e7be91ec799f465f90c678bf4e1e8c4242a6b5 commit b6e7be91ec799f465f90c678bf4e1e8c4242a6b5 Author: David Faust Date: Wed Mar 2 14:59:35 2022 -0800 include: Add BTF tag defines to dwarf2 and btf include/ * btf.h: Add BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG defines. Update comments. (struct btf_decl_tag): New. * dwarf2.def: Add new DWARF extension DW_TAG_GNU_annotation. Diff: --- include/btf.h | 17 +++++++++++++++-- include/dwarf2.def | 4 ++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/btf.h b/include/btf.h index 78b551ced23..37deaef8b48 100644 --- a/include/btf.h +++ b/include/btf.h @@ -69,7 +69,7 @@ struct btf_type /* SIZE is used by INT, ENUM, STRUCT, UNION, DATASEC kinds. TYPE is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT, FUNC, - FUNC_PROTO and VAR kinds. */ + FUNC_PROTO, VAR and DECL_TAG kinds. */ union { uint32_t size; /* Size of the entire type, in bytes. */ @@ -109,7 +109,9 @@ struct btf_type #define BTF_KIND_VAR 14 /* Variable. */ #define BTF_KIND_DATASEC 15 /* Section such as .bss or .data. */ #define BTF_KIND_FLOAT 16 /* Floating point. */ -#define BTF_KIND_MAX BTF_KIND_FLOAT +#define BTF_KIND_DECL_TAG 17 /* Decl Tag. */ +#define BTF_KIND_TYPE_TAG 18 /* Type Tag. */ +#define BTF_KIND_MAX BTF_KIND_TYPE_TAG #define NR_BTF_KINDS (BTF_KIND_MAX + 1) /* For some BTF_KINDs, struct btf_type is immediately followed by @@ -190,6 +192,17 @@ struct btf_var_secinfo uint32_t size; /* Size (in bytes) of variable. */ }; +/* BTF_KIND_DECL_TAG is followed by a single struct btf_decl_tag, which + describes the tag location: + - If component_idx == -1, then the tag is applied to a struct, union, + variable or function. + - Otherwise it is applied to a struct/union member or function argument + with the given given index numbered 0..vlen-1. */ +struct btf_decl_tag +{ + int32_t component_idx; +}; + #ifdef __cplusplus } #endif diff --git a/include/dwarf2.def b/include/dwarf2.def index 530c6f849f9..a1f7a47a036 100644 --- a/include/dwarf2.def +++ b/include/dwarf2.def @@ -174,6 +174,10 @@ DW_TAG (DW_TAG_GNU_formal_parameter_pack, 0x4108) are properly part of DWARF 5. */ DW_TAG (DW_TAG_GNU_call_site, 0x4109) DW_TAG (DW_TAG_GNU_call_site_parameter, 0x410a) + +/* Extension for BTF annotations. */ +DW_TAG (DW_TAG_GNU_annotation, 0x6000) + /* Extensions for UPC. See: http://dwarfstd.org/doc/DWARF4.pdf. */ DW_TAG (DW_TAG_upc_shared_type, 0x8765) DW_TAG (DW_TAG_upc_strict_type, 0x8766)