/* Language independent support for printing types for GDB, the GNU debugger.
- Copyright (C) 1986-2020 Free Software Foundation, Inc.
+ Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.
struct typedef_hash_table;
struct ext_lang_type_printers;
+struct type_print_options
+{
+ /* True means that no special printing flags should apply. */
+ unsigned int raw : 1;
+
+ /* True means print methods in a class. */
+ unsigned int print_methods : 1;
+
+ /* True means print typedefs in a class. */
+ unsigned int print_typedefs : 1;
+
+ /* True means to print offsets, a la 'pahole'. */
+ unsigned int print_offsets : 1;
+
+ /* True means to print offsets in hex, otherwise use decimal. */
+ unsigned int print_in_hex : 1;
+
+ /* The number of nested type definitions to print. -1 == all. */
+ int print_nested_type_limit;
+
+ /* If not NULL, a local typedef hash table used when printing a
+ type. */
+ typedef_hash_table *local_typedefs;
+
+ /* If not NULL, a global typedef hash table used when printing a
+ type. */
+ typedef_hash_table *global_typedefs;
+
+ /* The list of type printers associated with the global typedef
+ table. This is intentionally opaque. */
+ struct ext_lang_type_printers *global_printers;
+};
+
struct print_offset_data
{
+ /* Indicate if the offset an d size fields should be printed in decimal
+ (default) or hexadecimal. */
+ bool print_in_hex = false;
+
/* The offset to be applied to bitpos when PRINT_OFFSETS is true.
This is needed for when we are printing nested structs and want
to make sure that the printed offset for each field carries over
certain field. */
static const int indentation;
+ explicit print_offset_data (const struct type_print_options *flags);
+
private:
/* Helper function for ptype/o implementation that prints
const char *for_what);
};
-struct type_print_options
-{
- /* True means that no special printing flags should apply. */
- unsigned int raw : 1;
-
- /* True means print methods in a class. */
- unsigned int print_methods : 1;
-
- /* True means print typedefs in a class. */
- unsigned int print_typedefs : 1;
-
- /* True means to print offsets, a la 'pahole'. */
- unsigned int print_offsets : 1;
-
- /* The number of nested type definitions to print. -1 == all. */
- int print_nested_type_limit;
-
- /* If not NULL, a local typedef hash table used when printing a
- type. */
- typedef_hash_table *local_typedefs;
-
- /* If not NULL, a global typedef hash table used when printing a
- type. */
- typedef_hash_table *global_typedefs;
-
- /* The list of type printers associated with the global typedef
- table. This is intentionally opaque. */
- struct ext_lang_type_printers *global_printers;
-};
-
extern const struct type_print_options type_print_raw_options;
/* A hash table holding typedef_field objects. This is more