119 slot = htab_find_slot (table->
table, tdef, INSERT);
155 slot = htab_find_slot (table->
table, tf, INSERT);
171 obstack_init (&result->
storage);
183 htab_delete (
table->table);
184 obstack_free (&
table->storage, NULL);
210 htab_t new_table = (htab_t) nt;
213 new_slot = htab_find_slot (new_table, *slot, INSERT);
214 if (*new_slot == NULL)
271 if (
flags->global_typedefs == NULL)
277 slot = htab_find_slot (
flags->global_typedefs->table, &tf, INSERT);
297 = (
const char *) obstack_copy0 (&
flags->global_typedefs->storage,
298 applied, strlen (applied));
313 if (
flags->local_typedefs != NULL)
347 error (
_(
"Language not supported."));
375 return std::move (stb.
string ());
398 error (
_(
"'%s' has unknown type; cast it to its declared type"),
410 struct type *real_type = NULL;
426 for (++exp; *exp && !isspace (*exp); ++exp)
434 flags.print_methods = 0;
437 flags.print_methods = 1;
440 flags.print_typedefs = 0;
443 flags.print_typedefs = 1;
453 flags.print_offsets = 1;
454 flags.print_typedefs = 0;
455 flags.print_methods = 0;
460 error (
_(
"unrecognized flag '%c'"), *exp);
465 if (!*exp && !seen_one)
466 error (
_(
"flag expected"));
468 error (
_(
"expected space after format"));
481 if (show == -1 && expr->elts[0].opcode == OP_TYPE)
484 type = expr->elts[1].type;
522 if (
flags.print_offsets
589 for (i = 0; i < len; i++)
639 error (
_(
"internal error: unhandled type in print_type_scalar"));
643 error (
_(
"Invalid type code in symbol table."));
658 if (type_name != NULL)
661 if (expr->elts[0].opcode == OP_TYPE)
664 type = expr->elts[1].type;
689 "\"set print type\" must be followed by the name of a subcommand.\n");
758 _(
"Will not print nested types defined in a class\n"));
763 _(
"Will print %s nested types defined in a class\n"),
774 Print definition of type TYPE.\n\ 775 Usage: ptype[/FLAGS] TYPE | EXPRESSION\n\ 776 Argument may be any type (for example a type name defined by typedef,\n\ 777 or \"struct STRUCT-TAG\" or \"class CLASS-NAME\" or \"union UNION-TAG\"\n\ 778 or \"enum ENUM-TAG\") or an expression.\n\ 779 The selected stack frame's lexical context is used to look up the name.\n\ 780 Contrary to \"whatis\", \"ptype\" always unrolls any typedefs.\n\ 782 Available FLAGS are:\n\ 783 /r print in \"raw\" form; do not substitute typedefs\n\ 784 /m do not print methods defined in a class\n\ 785 /M print methods defined in a class\n\ 786 /t do not print typedefs defined in a class\n\ 787 /T print typedefs defined in a class\n\ 788 /o print offsets and sizes of fields in a struct (like pahole)\n"));
792 _(
"Print data type of expression EXP.\n\ 793 Only one level of typedefs is unrolled. See also \"ptype\"."));
797 _(
"Generic command for showing type-printing settings."),
800 _(
"Generic command for setting how types print."),
805 Set printing of methods defined in classes."),
_(
"\ 806 Show printing of methods defined in classes."), NULL,
812 Set printing of typedefs defined in classes."),
_(
"\ 813 Show printing of typedefs defined in classes."), NULL,
821 Set the number of recursive nested type definitions to print \ 822 (\"unlimited\" or -1 to show all)."),
_(
"\ 823 Show the number of recursive nested type definitions to print."), NULL,
void val_print_not_allocated(struct ui_file *stream)
struct type * value_rtti_type(struct value *v, int *full, LONGEST *top, int *using_enc)
static void set_print_type(const char *arg, int from_tty)
#define LA_PRINT_TYPEDEF(type, new_symbol, stream)
static const char * find_global_typedef(const struct type_print_options *flags, struct type *t)
#define TYPE_FIELD_NAME(thistype, n)
#define TYPE_N_BASECLASSES(thistype)
static void whatis_exp(const char *exp, int show)
gdb::unique_xmalloc_ptr< expression > expression_up
struct ext_lang_type_printers * start_ext_lang_type_printers(void)
static void set_print_type_typedefs(const char *args, int from_tty, struct cmd_list_element *c)
const struct type_print_options type_print_raw_options
static int copy_typedef_hash_element(void **slot, void *nt)
#define SYMBOL_CLASS(symbol)
void _initialize_typeprint(void)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
static int print_nested_type_limit
enum language la_language
static void show_print_type_typedefs(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
char * skip_spaces(char *chp)
struct typedef_hash_table * copy_typedef_hash(struct typedef_hash_table *table)
#define TYPE_FIELD_ENUMVAL(thistype, n)
void error_unknown_type(const char *sym_print_name)
void printf_filtered(const char *format,...)
#define TYPE_IS_REFERENCE(t)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
#define TYPE_N_TEMPLATE_ARGUMENTS(thistype)
void null_cleanup(void *arg)
static void do_free_typedef_hash(void *arg)
static void do_free_global_table(void *arg)
void val_print_not_associated(struct ui_file *stream)
struct type * check_typedef(struct type *type)
#define CATCH(EXCEPTION, MASK)
static void show_print_type_nested_types(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void typedef_print(struct type *type, struct symbol *newobj, struct ui_file *stream)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
void recursively_update_typedef_hash(struct typedef_hash_table *table, struct type *t)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static int print_typedefs
static void ptype_command(const char *type_name, int from_tty)
unsigned int print_typedefs
void free_typedef_hash(struct typedef_hash_table *table)
void free_ext_lang_type_printers(struct ext_lang_type_printers *printers)
#define SYMBOL_LINKAGE_NAME(symbol)
static struct type_print_options default_ptype_flags
void print_type_scalar(struct type *type, LONGEST val, struct ui_file *stream)
static struct symbol * new_symbol(struct die_info *, struct type *, struct dwarf2_cu *)
static hashval_t hash_typedef_field(const void *p)
struct cmd_list_element * setprintlist
#define TYPE_BASECLASS(thistype, index)
void printf_unfiltered(const char *format,...)
unsigned int print_methods
void cmd_show_list(struct cmd_list_element *list, int from_tty, const char *prefix)
void maintenance_print_type(const char *type_name, int from_tty)
void type_print_unknown_return_type(struct ui_file *stream)
#define LA_PRINT_TYPE(type, varstring, stream, show, level, flags)
int types_equal(struct type *a, struct type *b)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
const struct language_defn * current_language
#define TYPE_TARGET_TYPE(thistype)
void print_longest(struct ui_file *stream, int format, int use_c_format, LONGEST val_long)
const char * find_typedef_in_hash(const struct type_print_options *flags, struct type *t)
int print_nested_type_limit
char * apply_ext_lang_type_printers(struct ext_lang_type_printers *printers, struct type *type)
#define TYPE_CODE(thistype)
static int eq_typedef_field(const void *a, const void *b)
static void set_print_type_methods(const char *args, int from_tty, struct cmd_list_element *c)
void expression_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
void recursive_dump_type(struct type *type, int spaces)
static void whatis_command(const char *exp, int from_tty)
void get_user_print_options(struct value_print_options *opts)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
#define TYPE_NFIELDS(thistype)
static void set_print_type_nested_types(const char *args, int from_tty, struct cmd_list_element *c)
struct cmd_list_element * showprintlist
#define TYPE_TYPEDEF_FIELD(thistype, n)
#define TYPE_TYPEDEF_FIELD_COUNT(thistype)
expression_up parse_expression(const char *)
#define TYPE_TEMPLATE_ARGUMENT(thistype, n)
struct type * value_type(const struct value *value)
#define SYMBOL_TYPE(symbol)
struct value * access_value_history(int num)
struct value * evaluate_type(struct expression *exp)
void add_template_parameters(struct typedef_hash_table *table, struct type *t)
struct cleanup * make_cleanup_free_typedef_hash(struct typedef_hash_table *table)
void default_print_typedef(struct type *type, struct symbol *new_symbol, struct ui_file *stream)
std::string type_to_string(struct type *type)
#define LA_PRINT_CHAR(ch, type, stream)
void gdb_flush(struct ui_file *file)
struct typedef_hash_table * create_typedef_hash(void)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc)
struct cmd_list_element * showprinttypelist
static void show_print_type_methods(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static struct cleanup * create_global_typedef_table(struct type_print_options *flags)
PTR xcalloc(size_t number, size_t size)
void add_setshow_zuinteger_unlimited_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void error(const char *fmt,...)
void do_cleanups(struct cleanup *old_chain)
struct cmd_list_element * setprinttypelist
#define TYPE_SAFE_NAME(type)
struct type * value_rtti_indirect_type(struct value *v, int *full, LONGEST *top, int *using_enc)
static void show_print_type(const char *args, int from_tty)