GCC Middle and Back End API Reference
ctfc.h
Go to the documentation of this file.
1/* ctfc.h - Declarations and definitions related to the CTF container.
2 Copyright (C) 2019-2024 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20/* This file defines the data structures and functions used by the compiler
21 to generate the CTF debug info. The definitions below are compiler internal
22 representations and closely reflect the CTF format requirements in <ctf.h>.
23
24 The contents of the CTF container are used eventually for emission of both
25 CTF (ctfout.cc) and BTF debug info (btfout.cc), as the two type debug formats
26 are close cousins. */
27
28#ifndef GCC_CTFC_H
29#define GCC_CTFC_H 1
30
31#include "config.h"
32#include "system.h"
33#include "tree.h"
34#include "fold-const.h"
35#include "dwarf2ctf.h"
36#include "ctf.h"
37#include "btf.h"
38
39/* Invalid CTF type ID definition. */
40
41#define CTF_NULL_TYPEID 0
42
43/* Value to start generating the CTF type ID from. */
44
45#define CTF_INIT_TYPEID 1
46
47/* CTF type ID. */
48
50
51/* CTF string table element (list node). */
52
53typedef struct GTY ((chain_next ("%h.cts_next"))) ctf_string
54{
55 const char * cts_str; /* CTF string. */
56 struct ctf_string * cts_next; /* A list node. */
58
59/* Internal representation of CTF string table. */
60
61typedef struct GTY (()) ctf_strtable
62{
63 ctf_string_t * ctstab_head; /* Head str ptr. */
64 ctf_string_t * ctstab_tail; /* Tail. new str appended to tail. */
65 int ctstab_num; /* Number of strings in the table. */
66 size_t ctstab_len; /* Size of string table in bytes. */
67 const char * ctstab_estr; /* Empty string "". */
69
70/* Encoding information for integers, floating-point values etc. The flags
71 field will contain values appropriate for the type defined in <ctf.h>. */
72
73typedef struct GTY (()) ctf_encoding
74{
75 unsigned int cte_format; /* Data format (CTF_INT_* or CTF_FP_* flags). */
76 unsigned int cte_offset; /* Offset of value in bits. */
77 unsigned int cte_bits; /* Size of storage in bits. */
79
80/* Array information for CTF generation. */
81
82typedef struct GTY (()) ctf_arinfo
83{
84 ctf_id_t ctr_contents; /* Type of array contents. */
85 ctf_id_t ctr_index; /* Type of array index. */
86 unsigned int ctr_nelems; /* Number of elements. */
88
89/* Function information for CTF generation. */
90
91typedef struct GTY (()) ctf_funcinfo
92{
93 ctf_id_t ctc_return; /* Function return type. */
94 unsigned int ctc_argc; /* Number of typed arguments to function. */
95 unsigned int ctc_flags; /* Function attributes (see below). */
97
98typedef struct GTY (()) ctf_sliceinfo
99{
100 unsigned int cts_type; /* Reference CTF type. */
101 unsigned short cts_offset; /* Offset in bits of the first bit. */
102 unsigned short cts_bits; /* Size in bits. */
104
105/* CTF type representation internal to the compiler. It closely reflects the
106 ctf_type_t type node in <ctf.h> except the GTY (()) tags. */
107
108typedef struct GTY (()) ctf_itype
109{
110 uint32_t ctti_name; /* Reference to name in string table. */
111 uint32_t ctti_info; /* Encoded kind, variant length (see below). */
112 union GTY ((desc ("0")))
114 uint32_t GTY ((tag ("0"))) _size;/* Size of entire type in bytes. */
115 uint32_t GTY ((tag ("1"))) _type;/* Reference to another type. */
116 } _u;
117 uint32_t ctti_lsizehi; /* High 32 bits of type size in bytes. */
118 uint32_t ctti_lsizelo; /* Low 32 bits of type size in bytes. */
121#define ctti_size _u._size
122#define ctti_type _u._type
123
124/* Function arguments end with varargs. */
126#define CTF_FUNC_VARARG 0x1
127
128/* Struct/union/enum member definition for CTF generation. */
130typedef struct GTY ((chain_next ("%h.dmd_next"))) ctf_dmdef
132 const char * dmd_name; /* Name of this member. */
133 ctf_id_t dmd_type; /* Type of this member (for sou). */
134 uint32_t dmd_name_offset; /* Offset of the name in str table. */
135 uint64_t dmd_offset; /* Offset of this member in bits (for sou). */
136 HOST_WIDE_INT dmd_value; /* Value of this member (for enum). */
137 struct ctf_dmdef * dmd_next; /* A list node. */
140#define ctf_dmd_list_next(elem) ((ctf_dmdef_t *)((elem)->dmd_next))
141
142/* Function Argument. */
144typedef struct GTY (()) ctf_func_arg
146 ctf_id_t farg_type; /* Type identifier of the argument. */
147 const char * farg_name; /* Name of the argument. */
148 uint32_t farg_name_offset; /* Offset of the name in str table. */
149 struct ctf_func_arg * farg_next;/* A list node. */
152#define ctf_farg_list_next(elem) ((ctf_func_arg_t *)((elem)->farg_next))
153
154/* Type definition for CTF generation. */
156struct GTY ((for_user)) ctf_dtdef
158 dw_die_ref dtd_key; /* Type key for hashing. */
159 const char * dtd_name; /* Name associated with definition (if any). */
160 ctf_id_t dtd_type; /* Type identifier for this definition. */
161 ctf_itype_t dtd_data; /* Type node. */
162 bool from_global_func; /* Whether this type was added from a global
163 function. */
164 uint32_t linkage; /* Used in function types. 0=local, 1=global. */
165 bool dtd_enum_unsigned; /* Enum signedness. */
166 union GTY ((desc ("ctf_dtu_d_union_selector (&%1)")))
168 /* struct, union, or enum. */
169 ctf_dmdef_t * GTY ((tag ("CTF_DTU_D_MEMBERS"))) dtu_members;
170 /* array. */
171 ctf_arinfo_t GTY ((tag ("CTF_DTU_D_ARRAY"))) dtu_arr;
172 /* integer or float. */
174 /* function. */
175 ctf_func_arg_t * GTY ((tag ("CTF_DTU_D_ARGUMENTS"))) dtu_argv;
176 /* slice. */
177 ctf_sliceinfo_t GTY ((tag ("CTF_DTU_D_SLICE"))) dtu_slice;
178 } dtd_u;
180
182
183/* Variable definition for CTF generation. */
184
187 dw_die_ref dvd_key; /* DWARF DIE corresponding to the variable. */
188 const char * dvd_name; /* Name associated with variable. */
189 uint32_t dvd_name_offset; /* Offset of the name in str table. */
190 unsigned int dvd_visibility; /* External visibility. 0=static,1=global. */
191 ctf_id_t dvd_type; /* Type of variable. */
193
194typedef struct ctf_dvdef ctf_dvdef_t;
196typedef ctf_dvdef_t * ctf_dvdef_ref;
197typedef ctf_dtdef_t * ctf_dtdef_ref;
198
199/* Location information for CTF Types and CTF Variables. */
200
201typedef struct GTY (()) ctf_srcloc
203 const char * ctsloc_file;
204 unsigned int ctsloc_line;
205 unsigned int ctsloc_col;
207
209
210/* Helper enum and api for the GTY machinery to work on union dtu_d. */
218};
219
228 static bool equal (ctf_dtdef_ref, ctf_dtdef_ref);
229};
234 return htab_hash_pointer (dtd->dtd_key);
235}
240 return (dtd->dtd_key == dtd2->dtd_key);
242
243struct ctfc_dvd_hasher : ggc_ptr_hash <ctf_dvdef_t>
244{
246
247 static hashval_t hash (ctf_dvdef_ref);
248 static bool equal (ctf_dvdef_ref, ctf_dvdef_ref);
249};
254 return htab_hash_pointer (dvd->dvd_key);
255}
260 return (dvd->dvd_key == dvd2->dvd_key);
261}
262
263/* CTF container structure.
264 It is the context passed around when generating ctf debug info. There is
265 one container per translation unit. */
266
267typedef struct GTY (()) ctf_container
269 /* CTF Preamble. */
270 unsigned short ctfc_magic;
271 unsigned char ctfc_version;
272 unsigned char ctfc_flags;
273 uint32_t ctfc_cuname_offset;
275 /* CTF types. */
276 hash_table <ctfc_dtd_hasher> * GTY (()) ctfc_types;
277 /* CTF variables. */
278 hash_table <ctfc_dvd_hasher> * GTY (()) ctfc_vars;
279 /* CTF variables to be ignored. */
280 hash_table <ctfc_dvd_hasher> * GTY (()) ctfc_ignore_vars;
282 /* CTF string table. */
283 ctf_strtable_t ctfc_strtable;
284 /* Auxilliary string table. At this time, used for keeping func arg names
285 for BTF. */
286 ctf_strtable_t ctfc_aux_strtable;
288 uint64_t ctfc_num_types;
289 uint64_t ctfc_num_stypes;
290 uint64_t ctfc_num_global_funcs;
291 uint64_t ctfc_num_global_objts;
292
293 /* Number of vlen bytes - the variable length portion after ctf_type_t and
294 ctf_stype_t in the CTF section. This is used to calculate the offsets in
295 the CTF header. */
296 uint64_t ctfc_num_vlen_bytes;
298 /* Next CTF type id to assign. */
299 ctf_id_t ctfc_nextid;
300
301 /* Specify an explicit length of 0 so that the GC marking routines steer
302 clear of marking the CTF vars and CTF types twice. These lists below do
303 not own the pointed to objects, they simply hold references to them. */
304
305 /* List of pre-processed CTF Variables. CTF requires that the variables
306 appear in the sorted order of their names. */
307 ctf_dvdef_t ** GTY ((length ("0"))) ctfc_vars_list;
308 /* Count of pre-processed CTF Variables in the list. */
309 uint64_t ctfc_vars_list_count;
310 /* List of pre-processed CTF types. CTF requires that a shared type must
311 appear before the type that uses it. For the compiler, this means types
312 are emitted in sorted order of their type IDs. */
313 ctf_dtdef_t ** GTY ((length ("0"))) ctfc_types_list;
314 /* List of CTF function types for global functions. The order of global
315 function entries in the CTF funcinfo section is undefined by the
316 compiler. */
317 ctf_dtdef_t ** GTY ((length ("0"))) ctfc_gfuncs_list;
318 /* List of CTF variables at global scope. The order of global object entries
319 in the CTF objinfo section is undefined by the compiler. */
320 ctf_dvdef_t ** GTY ((length ("0"))) ctfc_gobjts_list;
321
322 /* Following members are for debugging only. They do not add functional
323 value to the task of CTF creation. These can be cleaned up once CTF
324 generation stabilizes. */
325
326 /* Keep a count of the number of bytes dumped in asm for debugging
327 purposes. */
328 uint64_t ctfc_numbytes_asm;
329 /* Total length of all strings in CTF. */
330 size_t ctfc_strlen;
331 /* Total length of all strings in aux string table. */
332 size_t ctfc_aux_strlen;
333
335
336/* Markers for which string table from the CTF container to use. */
338#define CTF_STRTAB 0 /* CTF string table. */
339#define CTF_AUX_STRTAB 1 /* CTF auxilliary string table. */
340
342
343extern GTY (()) ctf_container_ref tu_ctfc;
344
346
347/* If the next ctf type id is still set to the init value, no ctf records to
348 report. */
350
351/* Get the total number of CTF types in the container. */
352
354
355/* Get the total number of CTF variables in the container. */
356
358
359/* Get reference to the CTF string table or the CTF auxilliary
360 string table. */
361
363
364/* Get the length of the specified string table in the CTF container. */
365
367
368/* Get the number of bytes to represent the variable length portion of all CTF
369 types in the CTF container. */
370
372
373/* The compiler demarcates whether types are visible at top-level scope or not.
374 The only example so far of a type not visible at top-level scope is slices.
375 CTF_ADD_NONROOT is used to indicate the latter. */
376#define CTF_ADD_NONROOT 0 /* CTF type only visible in nested scope. */
377#define CTF_ADD_ROOT 1 /* CTF type visible at top-level scope. */
378
379/* These APIs allow to initialize and finalize the CTF machinery and
380 to add types to the CTF container associated to the current
381 translation unit. Used in dwarf2ctf.cc. */
382
383extern void ctf_init (void);
384extern void ctf_output (const char * filename);
385extern void ctf_finalize (void);
386
387extern void btf_output (const char * filename);
388extern void btf_init_postprocess (void);
389extern void btf_finalize (void);
390
392
394
395extern void ctf_add_cuname (ctf_container_ref, const char *);
396
398 dw_die_ref die);
400 dw_die_ref die);
402 dw_die_ref die);
403
404extern const char * ctf_add_string (ctf_container_ref, const char *,
405 uint32_t *, int);
406
409extern ctf_id_t ctf_add_enum (ctf_container_ref, uint32_t, const char *,
413extern ctf_id_t ctf_add_float (ctf_container_ref, uint32_t, const char *,
414 const ctf_encoding_t *, dw_die_ref);
416 const ctf_encoding_t *, dw_die_ref);
418 const ctf_encoding_t *, dw_die_ref);
420 dw_die_ref);
422 const ctf_arinfo_t *, dw_die_ref);
428 const ctf_funcinfo_t *, dw_die_ref, bool, int);
429extern ctf_id_t ctf_add_sou (ctf_container_ref, uint32_t, const char *,
430 uint32_t, size_t, dw_die_ref);
431
432extern int ctf_add_enumerator (ctf_container_ref, ctf_id_t, const char *,
434extern int ctf_add_member_offset (ctf_container_ref, dw_die_ref, const char *,
437 const char *, ctf_id_t);
438extern int ctf_add_variable (ctf_container_ref, const char *, ctf_id_t,
439 dw_die_ref, unsigned int, dw_die_ref);
440
443
444typedef bool (*funcs_traverse_callback) (ctf_dtdef_ref, void *);
446
447/* CTF section does not emit location information; at this time, location
448 information is needed for BTF CO-RE use-cases. */
449
452
453#endif /* GCC_CTFC_H */
bool traverse_btf_func_types(funcs_traverse_callback callback, void *data)
Definition btfout.cc:1497
void btf_init_postprocess(void)
Definition btfout.cc:1366
ctf_id_t get_btf_id(ctf_id_t key)
Definition btfout.cc:251
void btf_finalize(void)
Definition btfout.cc:1466
void btf_output(const char *filename)
Definition btfout.cc:1441
Definition hash-table.h:375
#define GTY(x)
Definition coretypes.h:41
union tree_node * tree
Definition coretypes.h:97
ctf_dvdef_ref ctf_dvd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:169
int ctf_add_variable(ctf_container_ref ctfc, const char *name, ctf_id_t ref, dw_die_ref die, unsigned int external_vis, dw_die_ref die_var_decl)
Definition ctfc.cc:705
ctf_id_t ctf_add_reftype(ctf_container_ref ctfc, uint32_t flag, ctf_id_t ref, uint32_t kind, dw_die_ref die)
Definition ctfc.cc:431
unsigned int ctfc_get_num_ctf_types(ctf_container_ref ctfc)
Definition ctfc.cc:49
ctf_id_t ctf_add_forward(ctf_container_ref ctfc, uint32_t flag, const char *name, uint32_t kind, dw_die_ref die)
Definition ctfc.cc:451
ctf_id_t ctf_add_slice(ctf_container_ref ctfc, uint32_t flag, ctf_id_t ref, uint32_t bit_offset, uint32_t bit_size, dw_die_ref die)
Definition ctfc.cc:492
int ctf_add_member_offset(ctf_container_ref ctfc, dw_die_ref sou, const char *name, ctf_id_t type, uint64_t bit_offset)
Definition ctfc.cc:664
ctf_id_t ctf_add_function(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_funcinfo_t *ctc, dw_die_ref die, bool from_global_func, int linkage)
Definition ctfc.cc:781
ctf_id_t ctf_add_sou(ctf_container_ref ctfc, uint32_t flag, const char *name, uint32_t kind, size_t size, dw_die_ref die)
Definition ctfc.cc:810
ctf_id_t ctf_lookup_tree_type(ctf_container_ref ctfc, const tree type)
Definition ctfc.cc:854
void ctf_init(void)
Definition ctfc.cc:1047
ctf_container_ref ctf_get_tu_ctfc(void)
Definition ctfc.cc:33
bool ctf_type_exists(ctf_container_ref ctfc, dw_die_ref type, ctf_id_t *type_id)
Definition ctfc.cc:872
ctf_strtable_t * ctfc_get_strtab(ctf_container_ref ctfc, int aux)
Definition ctfc.cc:65
size_t ctfc_get_strtab_len(ctf_container_ref ctfc, int aux)
Definition ctfc.cc:73
ctf_id_t ctf_add_pointer(ctf_container_ref ctfc, uint32_t flag, ctf_id_t ref, dw_die_ref die)
Definition ctfc.cc:548
int ctfc_get_dtd_srcloc(ctf_dtdef_ref dtd, ctf_srcloc_ref loc)
Definition ctfc.cc:893
size_t ctfc_get_num_vlen_bytes(ctf_container_ref ctfc)
Definition ctfc.cc:82
ctf_dtdef_ref ctf_dtd_lookup(const ctf_container_ref ctfc, const dw_die_ref type)
Definition ctfc.cc:136
const char * ctf_add_string(ctf_container_ref ctfc, const char *name, uint32_t *name_offset, int aux_str=CTF_STRTAB)
Definition ctfc.cc:318
ctf_id_t ctf_add_unknown(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_encoding_t *ep, dw_die_ref die)
Definition ctfc.cc:541
void ctfc_delete_container(ctf_container_ref ctfc)
Definition ctfc.cc:1004
bool ctfc_is_empty_container(ctf_container_ref ctfc)
Definition ctfc.cc:41
ctf_id_t ctf_add_integer(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_encoding_t *ep, dw_die_ref die)
Definition ctfc.cc:534
int ctf_add_enumerator(ctf_container_ref ctfc, ctf_id_t enid, const char *name, HOST_WIDE_INT value, dw_die_ref die)
Definition ctfc.cc:615
void ctf_add_cuname(ctf_container_ref ctfc, const char *filename)
Definition ctfc.cc:332
ctf_id_t ctf_add_enum(ctf_container_ref ctfc, uint32_t flag, const char *name, HOST_WIDE_INT size, bool eunsigned, dw_die_ref die)
Definition ctfc.cc:579
ctf_id_t ctf_add_float(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_encoding_t *ep, dw_die_ref die)
Definition ctfc.cc:527
ctf_id_t ctf_add_array(ctf_container_ref ctfc, uint32_t flag, const ctf_arinfo_t *arp, dw_die_ref die)
Definition ctfc.cc:555
ctf_container_ref tu_ctfc
Definition ctfc.cc:30
int ctfc_get_dvd_srcloc(ctf_dvdef_ref dvd, ctf_srcloc_ref loc)
Definition ctfc.cc:906
bool ctf_dvd_ignore_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:203
ctf_id_t ctf_add_typedef(ctf_container_ref ctfc, uint32_t flag, const char *name, ctf_id_t ref, dw_die_ref die)
Definition ctfc.cc:468
unsigned int ctfc_get_num_ctf_vars(ctf_container_ref ctfc)
Definition ctfc.cc:56
enum ctf_dtu_d_union_enum ctf_dtu_d_union_selector(ctf_dtdef_ref ctftype)
Definition ctfc.cc:91
int ctf_add_function_arg(ctf_container_ref ctfc, dw_die_ref func, const char *name, ctf_id_t type)
Definition ctfc.cc:749
ctf_dvdef_ref ctf_dvd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:169
struct ctf_dmdef ctf_dmdef_t
uint64_t ctf_id_t
Definition ctfc.h:49
bool ctf_type_exists(ctf_container_ref, dw_die_ref, ctf_id_t *)
Definition ctfc.cc:872
struct ctf_itype ctf_itype_t
struct ctf_sliceinfo ctf_sliceinfo_t
void btf_init_postprocess(void)
Definition btfout.cc:1366
void ctfc_delete_container(ctf_container_ref)
Definition ctfc.cc:1004
ctf_container_t * ctf_container_ref
Definition ctfc.h:339
void ctf_add_cuname(ctf_container_ref, const char *)
Definition ctfc.cc:332
size_t ctfc_get_num_vlen_bytes(ctf_container_ref)
Definition ctfc.cc:82
int ctf_add_variable(ctf_container_ref, const char *, ctf_id_t, dw_die_ref, unsigned int, dw_die_ref)
Definition ctfc.cc:705
ctf_dtu_d_union_enum
Definition ctfc.h:210
@ CTF_DTU_D_ARGUMENTS
Definition ctfc.h:214
@ CTF_DTU_D_SLICE
Definition ctfc.h:215
@ CTF_DTU_D_MEMBERS
Definition ctfc.h:211
@ CTF_DTU_D_ENCODING
Definition ctfc.h:213
@ CTF_DTU_D_ARRAY
Definition ctfc.h:212
ctf_dvdef_t * ctf_dvdef_ref
Definition ctfc.h:194
struct ctf_strtable ctf_strtable_t
int ctf_add_enumerator(ctf_container_ref, ctf_id_t, const char *, HOST_WIDE_INT, dw_die_ref)
Definition ctfc.cc:615
ctf_id_t get_btf_id(ctf_id_t)
Definition btfout.cc:251
unsigned int ctfc_get_num_ctf_types(ctf_container_ref)
Definition ctfc.cc:49
ctf_id_t ctf_add_array(ctf_container_ref, uint32_t, const ctf_arinfo_t *, dw_die_ref)
Definition ctfc.cc:555
void ctf_init(void)
Definition ctfc.cc:1047
ctf_container_ref ctf_get_tu_ctfc(void)
Definition ctfc.cc:33
ctf_id_t ctf_add_float(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:527
bool(* funcs_traverse_callback)(ctf_dtdef_ref, void *)
Definition ctfc.h:442
ctf_id_t ctf_lookup_tree_type(ctf_container_ref, const tree)
Definition ctfc.cc:854
struct ctf_encoding ctf_encoding_t
ctf_dtdef_t * ctf_dtdef_ref
Definition ctfc.h:195
enum ctf_dtu_d_union_enum ctf_dtu_d_union_selector(ctf_dtdef_ref)
Definition ctfc.cc:91
struct ctf_string ctf_string_t
ctf_id_t ctf_add_reftype(ctf_container_ref, uint32_t, ctf_id_t, uint32_t, dw_die_ref)
Definition ctfc.cc:431
int ctf_add_function_arg(ctf_container_ref, dw_die_ref, const char *, ctf_id_t)
Definition ctfc.cc:749
int ctfc_get_dvd_srcloc(ctf_dvdef_ref, ctf_srcloc_ref)
Definition ctfc.cc:906
void btf_finalize(void)
Definition btfout.cc:1466
ctf_strtable_t * ctfc_get_strtab(ctf_container_ref, int)
Definition ctfc.cc:65
bool ctfc_is_empty_container(ctf_container_ref)
Definition ctfc.cc:41
ctf_id_t ctf_add_enum(ctf_container_ref, uint32_t, const char *, HOST_WIDE_INT, bool, dw_die_ref)
Definition ctfc.cc:579
const char * ctf_add_string(ctf_container_ref, const char *, uint32_t *, int)
Definition ctfc.cc:318
ctf_id_t ctf_add_function(ctf_container_ref, uint32_t, const char *, const ctf_funcinfo_t *, dw_die_ref, bool, int)
Definition ctfc.cc:781
ctf_id_t ctf_add_typedef(ctf_container_ref, uint32_t, const char *, ctf_id_t, dw_die_ref)
Definition ctfc.cc:468
ctf_id_t ctf_add_integer(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:534
struct ctf_func_arg ctf_func_arg_t
void ctf_output(const char *filename)
Definition ctfout.cc:797
bool traverse_btf_func_types(funcs_traverse_callback, void *)
Definition btfout.cc:1497
ctf_id_t ctf_add_pointer(ctf_container_ref, uint32_t, ctf_id_t, dw_die_ref)
Definition ctfc.cc:548
ctf_srcloc_t * ctf_srcloc_ref
Definition ctfc.h:206
int ctf_add_member_offset(ctf_container_ref, dw_die_ref, const char *, ctf_id_t, uint64_t)
Definition ctfc.cc:664
struct ctf_funcinfo ctf_funcinfo_t
ctf_id_t ctf_add_unknown(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:541
unsigned int ctfc_get_num_ctf_vars(ctf_container_ref)
Definition ctfc.cc:56
size_t ctfc_get_strtab_len(ctf_container_ref, int)
Definition ctfc.cc:73
ctf_id_t ctf_add_slice(ctf_container_ref, uint32_t, ctf_id_t, uint32_t, uint32_t, dw_die_ref)
Definition ctfc.cc:492
int ctfc_get_dtd_srcloc(ctf_dtdef_ref, ctf_srcloc_ref)
Definition ctfc.cc:893
struct ctf_srcloc ctf_srcloc_t
ctf_id_t ctf_add_sou(ctf_container_ref, uint32_t, const char *, uint32_t, size_t, dw_die_ref)
Definition ctfc.cc:810
struct ctf_arinfo ctf_arinfo_t
ctf_container_ref tu_ctfc
Definition ctfc.cc:30
bool ctf_dvd_ignore_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:203
ctf_id_t ctf_add_forward(ctf_container_ref, uint32_t, const char *, uint32_t, dw_die_ref)
Definition ctfc.cc:451
struct ctf_container ctf_container_t
void ctf_finalize(void)
Definition ctfout.cc:831
void btf_output(const char *filename)
Definition btfout.cc:1441
ctf_dtdef_ref ctf_dtd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:136
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
Definition ctfc.h:83
ctf_id_t ctr_contents
Definition ctfc.h:84
unsigned int ctr_nelems
Definition ctfc.h:86
ctf_id_t ctr_index
Definition ctfc.h:85
Definition ctfc.h:266
hash_table< ctfc_dtd_hasher > * ctfc_types
Definition ctfc.h:274
size_t ctfc_strlen
Definition ctfc.h:328
ctf_dtdef_t ** ctfc_types_list
Definition ctfc.h:311
unsigned char ctfc_flags
Definition ctfc.h:270
unsigned short ctfc_magic
Definition ctfc.h:268
hash_table< ctfc_dvd_hasher > * ctfc_vars
Definition ctfc.h:276
uint64_t ctfc_num_vlen_bytes
Definition ctfc.h:294
uint64_t ctfc_num_stypes
Definition ctfc.h:287
ctf_id_t ctfc_nextid
Definition ctfc.h:297
hash_table< ctfc_dvd_hasher > * ctfc_ignore_vars
Definition ctfc.h:278
uint64_t ctfc_num_types
Definition ctfc.h:286
uint64_t ctfc_vars_list_count
Definition ctfc.h:307
ctf_strtable_t ctfc_strtable
Definition ctfc.h:281
uint64_t ctfc_num_global_funcs
Definition ctfc.h:288
uint32_t ctfc_cuname_offset
Definition ctfc.h:271
size_t ctfc_aux_strlen
Definition ctfc.h:330
ctf_dvdef_t ** ctfc_vars_list
Definition ctfc.h:305
ctf_dvdef_t ** ctfc_gobjts_list
Definition ctfc.h:318
uint64_t ctfc_numbytes_asm
Definition ctfc.h:326
ctf_dtdef_t ** ctfc_gfuncs_list
Definition ctfc.h:315
ctf_strtable_t ctfc_aux_strtable
Definition ctfc.h:284
uint64_t ctfc_num_global_objts
Definition ctfc.h:289
unsigned char ctfc_version
Definition ctfc.h:269
Definition ctfc.h:130
HOST_WIDE_INT dmd_value
Definition ctfc.h:135
ctf_id_t dmd_type
Definition ctfc.h:132
struct ctf_dmdef * dmd_next
Definition ctfc.h:136
uint32_t dmd_name_offset
Definition ctfc.h:133
const char * dmd_name
Definition ctfc.h:131
uint64_t dmd_offset
Definition ctfc.h:134
Definition ctfc.h:156
bool from_global_func
Definition ctfc.h:161
ctf_func_arg_t * dtu_argv
Definition ctfc.h:173
ctf_sliceinfo_t dtu_slice
Definition ctfc.h:175
ctf_itype_t dtd_data
Definition ctfc.h:160
ctf_dmdef_t * dtu_members
Definition ctfc.h:167
union ctf_dtdef::@11 dtd_u
uint32_t linkage
Definition ctfc.h:163
ctf_arinfo_t dtu_arr
Definition ctfc.h:169
dw_die_ref dtd_key
Definition ctfc.h:157
ctf_id_t dtd_type
Definition ctfc.h:159
bool dtd_enum_unsigned
Definition ctfc.h:164
const char * dtd_name
Definition ctfc.h:158
ctf_encoding_t dtu_enc
Definition ctfc.h:171
Definition ctfc.h:184
unsigned int dvd_visibility
Definition ctfc.h:188
uint32_t dvd_name_offset
Definition ctfc.h:187
const char * dvd_name
Definition ctfc.h:186
ctf_id_t dvd_type
Definition ctfc.h:189
dw_die_ref dvd_key
Definition ctfc.h:185
Definition ctfc.h:74
unsigned int cte_offset
Definition ctfc.h:76
unsigned int cte_bits
Definition ctfc.h:77
unsigned int cte_format
Definition ctfc.h:75
Definition ctfc.h:144
const char * farg_name
Definition ctfc.h:146
struct ctf_func_arg * farg_next
Definition ctfc.h:148
ctf_id_t farg_type
Definition ctfc.h:145
uint32_t farg_name_offset
Definition ctfc.h:147
Definition ctfc.h:92
ctf_id_t ctc_return
Definition ctfc.h:93
unsigned int ctc_flags
Definition ctfc.h:95
unsigned int ctc_argc
Definition ctfc.h:94
Definition ctfc.h:109
uint32_t ctti_lsizehi
Definition ctfc.h:116
uint32_t ctti_info
Definition ctfc.h:111
union ctf_itype::@10 _u
uint32_t _type
Definition ctfc.h:114
uint32_t ctti_lsizelo
Definition ctfc.h:117
uint32_t ctti_name
Definition ctfc.h:110
uint32_t _size
Definition ctfc.h:113
Definition ctfc.h:99
unsigned short cts_offset
Definition ctfc.h:101
unsigned short cts_bits
Definition ctfc.h:102
unsigned int cts_type
Definition ctfc.h:100
Definition ctfc.h:200
unsigned int ctsloc_line
Definition ctfc.h:202
unsigned int ctsloc_col
Definition ctfc.h:203
const char * ctsloc_file
Definition ctfc.h:201
Definition ctfc.h:54
struct ctf_string * cts_next
Definition ctfc.h:56
const char * cts_str
Definition ctfc.h:55
Definition ctfc.h:62
ctf_string_t * ctstab_head
Definition ctfc.h:63
int ctstab_num
Definition ctfc.h:65
size_t ctstab_len
Definition ctfc.h:66
ctf_string_t * ctstab_tail
Definition ctfc.h:64
const char * ctstab_estr
Definition ctfc.h:67
Definition ctfc.h:222
ctf_dtdef_ref compare_type
Definition ctfc.h:223
static bool equal(ctf_dtdef_ref, ctf_dtdef_ref)
Definition ctfc.h:236
static hashval_t hash(ctf_dtdef_ref)
Definition ctfc.h:230
Definition ctfc.h:242
ctf_dvdef_ref compare_type
Definition ctfc.h:243
static bool equal(ctf_dvdef_ref, ctf_dvdef_ref)
Definition ctfc.h:256
static hashval_t hash(ctf_dvdef_ref)
Definition ctfc.h:250
Definition dwarf2out.cc:3178
Definition hash-traits.h:321
#define bool
Definition system.h:893