summaryrefslogtreecommitdiff
path: root/gdb/typeprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-12-07 19:58:09 +0000
committerTom Tromey <tromey@redhat.com>2012-12-07 19:58:09 +0000
commit172b3d501874456ae604e1f0bf32799fd6381083 (patch)
treea57a367cb675a57b1163184d8a5d67892fa29764 /gdb/typeprint.c
parent3733eb9b4214b9edf19e7f80e80d9e83fec9f700 (diff)
downloadgdb-172b3d501874456ae604e1f0bf32799fd6381083.tar.gz
* typeprint.c (_initialize_typeprint): Set completer
for "whatis" and "ptype". testsuite * gdb.base/completion.exp: Add tests for ptype and whatis completion.
Diffstat (limited to 'gdb/typeprint.c')
-rw-r--r--gdb/typeprint.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index cf3ba381a44..53cc9ebff0f 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -39,6 +39,7 @@
#include <ctype.h>
#include "cli/cli-utils.h"
#include "python/python.h"
+#include "completer.h"
extern void _initialize_typeprint (void);
@@ -680,7 +681,9 @@ show_print_type_typedefs (struct ui_file *file, int from_tty,
void
_initialize_typeprint (void)
{
- add_com ("ptype", class_vars, ptype_command, _("\
+ struct cmd_list_element *c;
+
+ 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\
@@ -694,10 +697,12 @@ Available FLAGS are:\n\
/M print methods defined in a class\n\
/t do not print typedefs defined in a class\n\
/T print typedefs defined in a class"));
+ set_cmd_completer (c, expression_completer);
- add_com ("whatis", class_vars, whatis_command,
- _("Print data type of expression EXP.\n\
+ c = add_com ("whatis", class_vars, whatis_command,
+ _("Print data type of expression EXP.\n\
Only one level of typedefs is unrolled. See also \"ptype\"."));
+ set_cmd_completer (c, expression_completer);
add_prefix_cmd ("type", no_class, show_print_type,
_("Generic command for showing type-printing settings."),