forked from wangliu-iscas/gcc-patch
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ctf: add support to pass through BTF tags
BTF generation currently relies on the internal CTF representation to convert debug info from DWARF dies. This patch adds a new internal header, "ctf-int.h", which defines CTF kinds to be used internally to represent BTF tags which must pass through the CTF container. It also adds a new type for representing information specific to those tags, and a member for that type in struct ctf_dtdef. This patch also updates ctf_add_reftype to accept a const char * name, and add it for the newly added type. gcc/ * ctf-int.h: New file. * ctfc.h: Include ctf-int.h. (struct ctf_btf_annotation): New. (struct ctf_dtdef): Add dtu_btfnote member to dtd_u union. (enum ctf_dtu_d_union_enum): Add CTF_DTU_D_BTFNOTE. (ctf_add_reftype): Add name argument. * ctfc.cc (ctf_dtu_d_union_selector): Handle CTFC_INT_K_DECL_TAG. (ctf_add_reftype): Add name argument. Pass it to ctf_add_generic. (ctf_add_pointer): Update ctf_add_reftype call. * btfout.cc (btf_init_postprocess): Update ctf_add_reftype call. * dwarf2ctf.cc (gen_ctf_modifier_type): Update ctf_add_reftype call.
- Loading branch information
1 parent
a4cf736
commit 05f815d
Showing
5 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* ctf-int.h - GCC internal definitions used for CTF debug info. | ||
Copyright (C) 2023 Free Software Foundation, Inc. | ||
This file is part of GCC. | ||
GCC is free software; you can redistribute it and/or modify it under | ||
the terms of the GNU General Public License as published by the Free | ||
Software Foundation; either version 3, or (at your option) any later | ||
version. | ||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY | ||
WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with GCC; see the file COPYING3. If not see | ||
<http://www.gnu.org/licenses/>. */ | ||
|
||
#ifndef GCC_CTF_INT_H | ||
#define GCC_CTF_INT_H 1 | ||
|
||
/* This CTF kind exists only as a bridge to generating BTF types for | ||
BTF_KIND_DECL_TAG. It does not correspond to any representable type | ||
kind in CTF. */ | ||
#define CTFC_INT_K_DECL_TAG 63 | ||
|
||
#endif /* GCC_CTF_INT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters