From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5640 invoked by alias); 27 Jul 2011 17:14:10 -0000 Received: (qmail 5631 invoked by uid 22791); 27 Jul 2011 17:14:09 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jul 2011 17:13:55 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6RHDsD2015635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 27 Jul 2011 13:13:55 -0400 Received: from host1.jankratochvil.net (ovpn-116-20.ams2.redhat.com [10.36.116.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6RHDq2c006529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 27 Jul 2011 13:13:54 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p6RHDpoS000835 for ; Wed, 27 Jul 2011 19:13:51 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p6RHDpuA000834 for gdb-patches@sourceware.org; Wed, 27 Jul 2011 19:13:51 +0200 Date: Wed, 27 Jul 2011 17:41:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [help patch] whatis vs. ptype - the difference #2 Message-ID: <20110727171351.GA32153@host1.jankratochvil.net> References: <20110726213021.GA14823@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110726213021.GA14823@host1.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00773.txt.bz2 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 * typeprint.c (_initialize_typeprint): Extend the help of "whatis" and "ptype" by their typedefs difference. gdb/testsuite/ 2011-07-27 Jan Kratochvil * 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