/* Language independent support for printing types for GDB, the GNU debugger.
- Copyright (C) 1986-2013 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "language.h"
#include "cp-abi.h"
#include "typeprint.h"
-#include "gdb_string.h"
-#include "exceptions.h"
#include "valprint.h"
-#include <errno.h>
#include <ctype.h>
#include "cli/cli-utils.h"
-#include "python/python.h"
+#include "extension.h"
#include "completer.h"
extern void _initialize_typeprint (void);
struct type_print_options *flags = arg;
free_typedef_hash (flags->global_typedefs);
- free_type_printers (flags->global_printers);
+ free_ext_lang_type_printers (flags->global_printers);
}
/* Create the global typedef hash. */
{
gdb_assert (flags->global_typedefs == NULL && flags->global_printers == NULL);
flags->global_typedefs = create_typedef_hash ();
- flags->global_printers = start_type_printers ();
+ flags->global_printers = start_ext_lang_type_printers ();
return make_cleanup (do_free_global_table, flags);
}
/* Look up the type T in the global typedef hash. If it is found,
return the typedef name. If it is not found, apply the
- type-printers, if any, given by start_type_printers and return the
+ type-printers, if any, given by start_script_type_printers and return the
result. A NULL return means that the name was not found. */
static const char *
return new_tf->name;
}
- /* Put an entry into the hash table now, in case apply_type_printers
- recurses. */
+ /* Put an entry into the hash table now, in case
+ apply_ext_lang_type_printers recurses. */
new_tf = XOBNEW (&flags->global_typedefs->storage, struct typedef_field);
new_tf->name = NULL;
new_tf->type = t;
*slot = new_tf;
- applied = apply_type_printers (flags->global_printers, t);
+ applied = apply_ext_lang_type_printers (flags->global_printers, t);
if (applied != NULL)
{
{
if (((TYPE_CODE (type) == TYPE_CODE_PTR)
|| (TYPE_CODE (type) == TYPE_CODE_REF))
- && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+ && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
real_type = value_rtti_indirect_type (val, &full, &top, &using_enc);
- else if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
real_type = value_rtti_type (val, &full, &top, &using_enc);
}
{
printf_unfiltered (
"\"set print type\" must be followed by the name of a subcommand.\n");
- help_list (setprintlist, "set print type ", -1, gdb_stdout);
+ help_list (setprintlist, "set print type ", all_commands, gdb_stdout);
}
static void
c = add_com ("ptype", class_vars, ptype_command, _("\
Print definition of type TYPE.\n\
-Usage: ptype[/FLAGS] TYPE-NAME | EXPRESSION\n\
-Argument may be a type name defined by typedef, or \"struct STRUCT-TAG\"\n\
-or \"class CLASS-NAME\" or \"union UNION-TAG\" or \"enum ENUM-TAG\".\n\
+Usage: ptype[/FLAGS] TYPE | EXPRESSION\n\
+Argument may be any type (for example a type name defined by typedef,\n\
+or \"struct STRUCT-TAG\" or \"class CLASS-NAME\" or \"union UNION-TAG\"\n\
+or \"enum ENUM-TAG\") or an expression.\n\
The selected stack frame's lexical context is used to look up the name.\n\
Contrary to \"whatis\", \"ptype\" always unrolls any typedefs.\n\
\n\