GDB (xrefs)
Classes | Functions | Variables
/tmp/gdb-8.1/gdb/typeprint.c File Reference
#include "defs.h"
#include "gdb_obstack.h"
#include "bfd.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "value.h"
#include "gdbcore.h"
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
#include "language.h"
#include "cp-abi.h"
#include "typeprint.h"
#include "valprint.h"
#include <ctype.h>
#include "cli/cli-utils.h"
#include "extension.h"
#include "completer.h"

Go to the source code of this file.

Classes

struct  typedef_hash_table
 

Functions

static hashval_t hash_typedef_field (const void *p)
 
static int eq_typedef_field (const void *a, const void *b)
 
void recursively_update_typedef_hash (struct typedef_hash_table *table, struct type *t)
 
void add_template_parameters (struct typedef_hash_table *table, struct type *t)
 
struct typedef_hash_tablecreate_typedef_hash (void)
 
void free_typedef_hash (struct typedef_hash_table *table)
 
static void do_free_typedef_hash (void *arg)
 
struct cleanupmake_cleanup_free_typedef_hash (struct typedef_hash_table *table)
 
static int copy_typedef_hash_element (void **slot, void *nt)
 
struct typedef_hash_tablecopy_typedef_hash (struct typedef_hash_table *table)
 
static void do_free_global_table (void *arg)
 
static struct cleanupcreate_global_typedef_table (struct type_print_options *flags)
 
static const char * find_global_typedef (const struct type_print_options *flags, struct type *t)
 
const char * find_typedef_in_hash (const struct type_print_options *flags, struct type *t)
 
void typedef_print (struct type *type, struct symbol *newobj, struct ui_file *stream)
 
void default_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream)
 
void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show)
 
std::string type_to_string (struct type *type)
 
void type_print_unknown_return_type (struct ui_file *stream)
 
void error_unknown_type (const char *sym_print_name)
 
static void whatis_exp (const char *exp, int show)
 
static void whatis_command (const char *exp, int from_tty)
 
static void ptype_command (const char *type_name, int from_tty)
 
void print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
 
void maintenance_print_type (const char *type_name, int from_tty)
 
static void set_print_type (const char *arg, int from_tty)
 
static void show_print_type (const char *args, int from_tty)
 
static void set_print_type_methods (const char *args, int from_tty, struct cmd_list_element *c)
 
static void show_print_type_methods (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void set_print_type_typedefs (const char *args, int from_tty, struct cmd_list_element *c)
 
static void show_print_type_typedefs (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void set_print_type_nested_types (const char *args, int from_tty, struct cmd_list_element *c)
 
static void show_print_type_nested_types (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
void _initialize_typeprint (void)
 
void val_print_not_allocated (struct ui_file *stream)
 
void val_print_not_associated (struct ui_file *stream)
 

Variables

const struct type_print_options type_print_raw_options
 
static struct type_print_options default_ptype_flags
 
struct cmd_list_elementsetprinttypelist
 
struct cmd_list_elementshowprinttypelist
 
static int print_methods = 1
 
static int print_typedefs = 1
 
static int print_nested_type_limit = 0
 

Function Documentation

◆ _initialize_typeprint()

void _initialize_typeprint ( void  )

◆ add_template_parameters()

void add_template_parameters ( struct typedef_hash_table table,
struct type t 
)

◆ copy_typedef_hash()

struct typedef_hash_table* copy_typedef_hash ( struct typedef_hash_table table)

◆ copy_typedef_hash_element()

static int copy_typedef_hash_element ( void **  slot,
void *  nt 
)
static

Definition at line 208 of file typeprint.c.

Referenced by copy_typedef_hash().

◆ create_global_typedef_table()

static struct cleanup* create_global_typedef_table ( struct type_print_options flags)
static

◆ create_typedef_hash()

struct typedef_hash_table* create_typedef_hash ( void  )

◆ default_print_typedef()

void default_print_typedef ( struct type type,
struct symbol new_symbol,
struct ui_file stream 
)

Definition at line 344 of file typeprint.c.

References _, and error().

◆ do_free_global_table()

static void do_free_global_table ( void *  arg)
static

Definition at line 239 of file typeprint.c.

References flags, free_ext_lang_type_printers(), and free_typedef_hash().

Referenced by create_global_typedef_table().

◆ do_free_typedef_hash()

static void do_free_typedef_hash ( void *  arg)
static

Definition at line 192 of file typeprint.c.

References free_typedef_hash().

Referenced by make_cleanup_free_typedef_hash().

◆ eq_typedef_field()

static int eq_typedef_field ( const void *  a,
const void *  b 
)
static

Definition at line 95 of file typeprint.c.

References decl_field::type, and types_equal().

Referenced by create_typedef_hash().

◆ error_unknown_type()

void error_unknown_type ( const char *  sym_print_name)

Definition at line 396 of file typeprint.c.

References _, and error().

Referenced by evaluate_subexp_for_sizeof(), evaluate_subexp_standard(), and gen_expr().

◆ find_global_typedef()

static const char* find_global_typedef ( const struct type_print_options flags,
struct type t 
)
static

◆ find_typedef_in_hash()

const char* find_typedef_in_hash ( const struct type_print_options flags,
struct type t 
)

◆ free_typedef_hash()

void free_typedef_hash ( struct typedef_hash_table table)

Definition at line 179 of file typeprint.c.

References typedef_hash_table::table, and xfree().

Referenced by do_free_global_table(), and do_free_typedef_hash().

◆ hash_typedef_field()

static hashval_t hash_typedef_field ( const void *  p)
static

Definition at line 84 of file typeprint.c.

References check_typedef(), decl_field::type, and TYPE_SAFE_NAME.

Referenced by create_typedef_hash().

◆ maintenance_print_type()

void maintenance_print_type ( const char *  type_name,
int  from_tty 
)

Definition at line 653 of file typeprint.c.

References evaluate_type(), parse_expression(), recursive_dump_type(), type, and value_type().

Referenced by _initialize_maint_cmds().

◆ make_cleanup_free_typedef_hash()

struct cleanup* make_cleanup_free_typedef_hash ( struct typedef_hash_table table)

Definition at line 200 of file typeprint.c.

References do_free_typedef_hash(), and make_cleanup().

Referenced by c_type_print_base_struct_union().

◆ print_type_scalar()

void print_type_scalar ( struct type type,
LONGEST  val,
struct ui_file stream 
)

◆ ptype_command()

static void ptype_command ( const char *  type_name,
int  from_tty 
)
static

Definition at line 559 of file typeprint.c.

References whatis_exp().

Referenced by _initialize_typeprint().

◆ recursively_update_typedef_hash()

void recursively_update_typedef_hash ( struct typedef_hash_table table,
struct type t 
)

◆ set_print_type()

static void set_print_type ( const char *  arg,
int  from_tty 
)
static

Definition at line 686 of file typeprint.c.

References all_commands, gdb_stdout, help_list(), printf_unfiltered(), and setprintlist.

Referenced by _initialize_typeprint().

◆ set_print_type_methods()

static void set_print_type_methods ( const char *  args,
int  from_tty,
struct cmd_list_element c 
)
static

Definition at line 702 of file typeprint.c.

References default_ptype_flags, type_print_options::print_methods, and print_methods.

Referenced by _initialize_typeprint().

◆ set_print_type_nested_types()

static void set_print_type_nested_types ( const char *  args,
int  from_tty,
struct cmd_list_element c 
)
static

◆ set_print_type_typedefs()

static void set_print_type_typedefs ( const char *  args,
int  from_tty,
struct cmd_list_element c 
)
static

◆ show_print_type()

static void show_print_type ( const char *  args,
int  from_tty 
)
static

Definition at line 694 of file typeprint.c.

References cmd_show_list(), and showprinttypelist.

Referenced by _initialize_typeprint().

◆ show_print_type_methods()

static void show_print_type_methods ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 709 of file typeprint.c.

References _, and fprintf_filtered().

Referenced by _initialize_typeprint().

◆ show_print_type_nested_types()

static void show_print_type_nested_types ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 752 of file typeprint.c.

References _, and fprintf_filtered().

Referenced by _initialize_typeprint().

◆ show_print_type_typedefs()

static void show_print_type_typedefs ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 726 of file typeprint.c.

References _, and fprintf_filtered().

Referenced by _initialize_typeprint().

◆ type_print()

void type_print ( struct type type,
const char *  varstring,
struct ui_file stream,
int  show 
)

◆ type_print_unknown_return_type()

void type_print_unknown_return_type ( struct ui_file stream)

◆ type_to_string()

std::string type_to_string ( struct type type)

◆ typedef_print()

void typedef_print ( struct type type,
struct symbol newobj,
struct ui_file stream 
)

Definition at line 336 of file typeprint.c.

References LA_PRINT_TYPEDEF.

Referenced by print_symbol_info().

◆ val_print_not_allocated()

void val_print_not_allocated ( struct ui_file stream)

◆ val_print_not_associated()

void val_print_not_associated ( struct ui_file stream)

◆ whatis_command()

static void whatis_command ( const char *  exp,
int  from_tty 
)
static

Definition at line 548 of file typeprint.c.

References whatis_exp().

Referenced by _initialize_typeprint().

◆ whatis_exp()

static void whatis_exp ( const char *  exp,
int  show 
)
static

Variable Documentation

◆ default_ptype_flags

struct type_print_options default_ptype_flags
static
Initial value:
=
{
0,
1,
1,
0,
0,
NULL,
NULL,
NULL
}

Definition at line 54 of file typeprint.c.

Referenced by set_print_type_methods(), set_print_type_nested_types(), set_print_type_typedefs(), type_print(), and whatis_exp().

◆ print_methods

int print_methods = 1
static

Definition at line 699 of file typeprint.c.

Referenced by _initialize_typeprint(), and set_print_type_methods().

◆ print_nested_type_limit

int print_nested_type_limit = 0
static

Definition at line 737 of file typeprint.c.

Referenced by _initialize_typeprint(), and set_print_type_nested_types().

◆ print_typedefs

int print_typedefs = 1
static

Definition at line 716 of file typeprint.c.

Referenced by _initialize_typeprint(), and set_print_type_typedefs().

◆ setprinttypelist

struct cmd_list_element* setprinttypelist

Definition at line 681 of file typeprint.c.

Referenced by _initialize_typeprint().

◆ showprinttypelist

struct cmd_list_element* showprinttypelist

Definition at line 683 of file typeprint.c.

Referenced by _initialize_typeprint(), and show_print_type().

◆ type_print_raw_options

const struct type_print_options type_print_raw_options