[help patch] whatis vs. ptype - the difference

Jan Kratochvil jan.kratochvil@redhat.com
Wed Jul 27 03:39:00 GMT 2011


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\"."));
 }



More information about the Gdb-patches mailing list