* [help patch] whatis vs. ptype - the difference
@ 2011-07-27 3:39 Jan Kratochvil
2011-07-27 17:41 ` [help patch] whatis vs. ptype - the difference #2 Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2011-07-27 3:39 UTC (permalink / raw)
To: gdb-patches
Hi,
just noticed the original user confusion came from the GDB help; not from the
GDB manual. So that it may be a bit pointed out there.
Wording review welcomed.
Thanks,
Jan
gdb/
2011-07-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* typeprint.c (_initialize_typeprint): Extend the help of "whatis" and
"ptype" by their typedefs difference.
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -316,8 +316,10 @@ _initialize_typeprint (void)
Print definition of type TYPE.\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\
-The selected stack frame's lexical context is used to look up the name."));
+The selected stack frame's lexical context is used to look up the name.\n\
+Contrary to \"whatis\", \"ptype\" always unrolls any typedefs."));
add_com ("whatis", class_vars, whatis_command,
- _("Print data type of expression EXP."));
+ _("Print data type of expression EXP.\n\
+Only one level of typedefs is unrolled. See also \"ptype\"."));
}
^ permalink raw reply [flat|nested] 4+ messages in thread* [help patch] whatis vs. ptype - the difference #2
2011-07-27 3:39 [help patch] whatis vs. ptype - the difference Jan Kratochvil
@ 2011-07-27 17:41 ` Jan Kratochvil
2011-07-27 17:41 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2011-07-27 17:41 UTC (permalink / raw)
To: gdb-patches
A small formal regression fix:
On Tue, 26 Jul 2011 23:30:21 +0200, Jan Kratochvil wrote:
Hi,
just noticed the original user confusion came from the GDB help; not from the
GDB manual. So that it may be a bit pointed out there.
Wording review welcomed.
Thanks,
Jan
gdb/
2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
* typeprint.c (_initialize_typeprint): Extend the help of "whatis" and
"ptype" by their typedefs difference.
gdb/testsuite/
2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/help.exp (help whatis): Update the expected string.
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -316,8 +316,10 @@ _initialize_typeprint (void)
Print definition of type TYPE.\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\
-The selected stack frame's lexical context is used to look up the name."));
+The selected stack frame's lexical context is used to look up the name.\n\
+Contrary to \"whatis\", \"ptype\" always unrolls any typedefs."));
add_com ("whatis", class_vars, whatis_command,
- _("Print data type of expression EXP."));
+ _("Print data type of expression EXP.\n\
+Only one level of typedefs is unrolled. See also \"ptype\"."));
}
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -685,7 +685,7 @@ test_class_help "user-defined" {
# test help watch
gdb_test "help watch" "Set a watchpoint for an expression\.\[\r\n\]+Usage: watch .-l.-location. EXPRESSION\[\r\n\]+A watchpoint stops execution of your program whenever the value of\[\r\n\]+an expression changes\.\[\r\n\]+If -l or -location is given, this evaluates EXPRESSION and watches\[\r\n\]+the memory to which it refers\." "help watch"
# test help whatis
-gdb_test "help whatis" "Print data type of expression EXP\." "help whatis"
+gdb_test "help whatis" "Print data type of expression EXP\.\r\nOnly one level .*" "help whatis"
# test help where
gdb_test "help where" "Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\.\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables\." "help where"
# test help x
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-27 17:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-27 3:39 [help patch] whatis vs. ptype - the difference Jan Kratochvil
2011-07-27 17:41 ` [help patch] whatis vs. ptype - the difference #2 Jan Kratochvil
2011-07-27 17:41 ` Tom Tromey
2011-07-27 18:56 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox