GDB (xrefs)

/tmp/gdb-8.1/gdb/typeprint.h
Go to the documentation of this file.
1 /* Language independent support for printing types for GDB, the GNU debugger.
2 Copyright (C) 1986-2018 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19 #ifndef TYPEPRINT_H
20 #define TYPEPRINT_H
21
22 enum language;
23 struct ui_file;
24 struct typedef_hash_table;
25 struct ext_lang_type_printers;
26
27 struct print_offset_data
28 {
29 /* The offset to be applied to bitpos when PRINT_OFFSETS is true.
30 This is needed for when we are printing nested structs and want
31 to make sure that the printed offset for each field carries over
32 the offset of the outter struct. */
33 unsigned int offset_bitpos = 0;
34
35 /* END_BITPOS is the one-past-the-end bit position of the previous
36 field (where we expect the current field to be if there is no
37 hole). */
38 unsigned int end_bitpos = 0;
39 };
40
41 struct type_print_options
42 {
43 /* True means that no special printing flags should apply. */
44 unsigned int raw : 1;
45
46 /* True means print methods in a class. */
47 unsigned int print_methods : 1;
48
49 /* True means print typedefs in a class. */
50 unsigned int print_typedefs : 1;
51
52 /* True means to print offsets, a la 'pahole'. */
53 unsigned int print_offsets : 1;
54
55 /* The number of nested type definitions to print. -1 == all. */
56 int print_nested_type_limit;
57
58 /* If not NULL, a local typedef hash table used when printing a
59 type. */
60 struct typedef_hash_table *local_typedefs;
61
62 /* If not NULL, a global typedef hash table used when printing a
63 type. */
64 struct typedef_hash_table *global_typedefs;
65
66 /* The list of type printers associated with the global typedef
67 table. This is intentionally opaque. */
68 struct ext_lang_type_printers *global_printers;
69 };
70
71 extern const struct type_print_options type_print_raw_options;
72
73 void recursively_update_typedef_hash (struct typedef_hash_table *,
74 struct type *);
75
76 void add_template_parameters (struct typedef_hash_table *, struct type *);
77
78 struct typedef_hash_table *create_typedef_hash (void);
79
80 void free_typedef_hash (struct typedef_hash_table *);
81
82 struct cleanup *make_cleanup_free_typedef_hash (struct typedef_hash_table *);
83
84 struct typedef_hash_table *copy_typedef_hash (struct typedef_hash_table *);
85
86 const char *find_typedef_in_hash (const struct type_print_options *,
87 struct type *);
88
89 void print_type_scalar (struct type * type, LONGEST, struct ui_file *);
90
91 void c_type_print_varspec_suffix (struct type *, struct ui_file *, int,
92 int, int, const struct type_print_options *);
93
94 void c_type_print_args (struct type *, struct ui_file *, int, enum language,
95 const struct type_print_options *);
96
97 /* Print <unknown return type> to stream STREAM. */
98
99 void type_print_unknown_return_type (struct ui_file *stream);
100
101 /* Throw an error indicating that the user tried to use a symbol that
102 has unknown type. SYM_PRINT_NAME is the name of the symbol, to be
103 included in the error message. */
104 extern void error_unknown_type (const char *sym_print_name);
105
106 extern void val_print_not_allocated (struct ui_file *stream);
107
108 extern void val_print_not_associated (struct ui_file *stream);
109
110 #endif
make_cleanup_free_typedef_hash
struct cleanup * make_cleanup_free_typedef_hash(struct typedef_hash_table *)
Definition: typeprint.c:200
type_print_options::raw
unsigned int raw
Definition: typeprint.h:44
find_typedef_in_hash
const char * find_typedef_in_hash(const struct type_print_options *, struct type *)
Definition: typeprint.c:311
error_unknown_type
void error_unknown_type(const char *sym_print_name)
Definition: typeprint.c:396
cleanup
Definition: cleanups.c:38
ui_file
Definition: ui-file.h:26
type_print_options::global_printers
struct ext_lang_type_printers * global_printers
Definition: typeprint.h:68
type_print_raw_options
const struct type_print_options type_print_raw_options
Definition: typeprint.c:40
print_offset_data
Definition: typeprint.h:27
c_type_print_args
void c_type_print_args(struct type *, struct ui_file *, int, enum language, const struct type_print_options *)
add_template_parameters
void add_template_parameters(struct typedef_hash_table *, struct type *)
Definition: typeprint.c:135
print_type_scalar
void print_type_scalar(struct type *type, LONGEST, struct ui_file *)
Definition: typeprint.c:577
type
Definition: gdbtypes.h:749
type_print_options::print_typedefs
unsigned int print_typedefs
Definition: typeprint.h:50
free_typedef_hash
void free_typedef_hash(struct typedef_hash_table *)
Definition: typeprint.c:179
type_print_options::print_methods
unsigned int print_methods
Definition: typeprint.h:47
ext_lang_type_printers
Definition: extension.h:143
val_print_not_allocated
void val_print_not_allocated(struct ui_file *stream)
Definition: typeprint.c:832
val_print_not_associated
void val_print_not_associated(struct ui_file *stream)
Definition: typeprint.c:840
type_print_options::print_nested_type_limit
int print_nested_type_limit
Definition: typeprint.h:56
copy_typedef_hash
struct typedef_hash_table * copy_typedef_hash(struct typedef_hash_table *)
Definition: typeprint.c:223
type_print_options
Definition: typeprint.h:41
recursively_update_typedef_hash
void recursively_update_typedef_hash(struct typedef_hash_table *, struct type *)
Definition: typeprint.c:106
print_offset_data::offset_bitpos
unsigned int offset_bitpos
Definition: typeprint.h:33
type_print_unknown_return_type
void type_print_unknown_return_type(struct ui_file *stream)
Definition: typeprint.c:388
type_print_options::print_offsets
unsigned int print_offsets
Definition: typeprint.h:53
language
language
Definition: defs.h:203
type_print_options::global_typedefs
struct typedef_hash_table * global_typedefs
Definition: typeprint.h:64
create_typedef_hash
struct typedef_hash_table * create_typedef_hash(void)
Definition: typeprint.c:164
print_offset_data::end_bitpos
unsigned int end_bitpos
Definition: typeprint.h:38
typedef_hash_table
Definition: typeprint.c:72
type_print_options::local_typedefs
struct typedef_hash_table * local_typedefs
Definition: typeprint.h:60
c_type_print_varspec_suffix
void c_type_print_varspec_suffix(struct type *, struct ui_file *, int, int, int, const struct type_print_options *)
Definition: c-typeprint.c:719
LONGEST
long long LONGEST
Definition: common-types.h:52