From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24272 invoked by alias); 11 Aug 2012 17:46:30 -0000 Received: (qmail 24264 invoked by uid 22791); 11 Aug 2012 17:46:29 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-wg0-f73.google.com (HELO mail-wg0-f73.google.com) (74.125.82.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Aug 2012 17:46:06 +0000 Received: by wgbdt12 with SMTP id dt12so117815wgb.0 for ; Sat, 11 Aug 2012 10:46:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:content-type:content-transfer-encoding:message-id:date :to:cc:subject:in-reply-to:references:x-mailer:from :x-gm-message-state; bh=UvZjUj6P95BvZ3a6Fru+WKjxIdvKGOei6yJUUQwgwMA=; b=nAm2wCRju4bsQbFiHsFXkGUYghnEtXJqaupn45YKvfABsNmTZx7U6MQsQqK4KmCo68 1AntwF8PMWqapJYove2zTpnUSs+4AmJiEY3W7Qi1MNfveqTxYwB98zkJ++2SKCGza5tH WlQOI2idiE35rWR4Nj3fPc2M2AefiCiSDYDvI5smuPB8/T+iHFx7x8m+KelKRraxpSsA S2UaH7Zp7fQrs/nb2+z8uA9nFG2q79u0mZPIaoIShfiIooSDEKmZtvqPpP+LY4PSlRG+ s2+mLWo7/87CQF6T1IXCjbjPqvrH6hNrUyaVaT41n3nwUNnOiCgQNe7VZJWnOO+oIHh5 Of5A== Received: by 10.14.184.71 with SMTP id r47mr6204630eem.4.1344707165206; Sat, 11 Aug 2012 10:46:05 -0700 (PDT) Received: by 10.14.184.71 with SMTP id r47mr6204623eem.4.1344707165144; Sat, 11 Aug 2012 10:46:05 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id 46si3338442eed.1.2012.08.11.10.46.05 (version=TLSv1/SSLv3 cipher=AES128-SHA); Sat, 11 Aug 2012 10:46:05 -0700 (PDT) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 58862200057; Sat, 11 Aug 2012 10:46:03 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20518.39513.919419.510863@ruffy2.mtv.corp.google.com> Date: Sat, 11 Aug 2012 17:46:00 -0000 To: Jan Kratochvil Cc: Tom Tromey , Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: Regression for gdb.base/default.exp: show convenience [Re: [RFA, doc RFA] Implement $_memeq, $_streq, $_strlen] In-Reply-To: <20120811080812.GA21746@host2.jankratochvil.net> References: <834nodfi6f.fsf@gnu.org> <20514.39220.59446.622043@ruffy2.mtv.corp.google.com> <871ujhgt7h.fsf@fleche.redhat.com> <20516.35488.801568.883424@ruffy.mtv.corp.google.com> <20120811080812.GA21746@host2.jankratochvil.net> From: dje@google.com X-Gm-Message-State: ALoCoQkVcsu7lDUVoiZlZXUC9HenoHcyuG2xcCZ4vWTi+ltDLAfLOSaHHBmxhlrY3Qg4aiYOBMtpmw7jK7QsmOdPJcfXMcfdoXIZL7qkwPNCe91K7uVE+LQKHf3Zyp3EYJrkFcOLKUIBqvl6LlW6TIcfFvc4wn2iZkjrWptLDYi04Ni/xyl33H/uzluEt0WEPE/012s02nVrwNFLUXbAoImD5HECuMtdTA== 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: 2012-08/txt/msg00342.txt.bz2 Jan Kratochvil writes: > On Fri, 10 Aug 2012 06:14:24 +0200, dje@google.com wrote: > > Ok to check in? > > 96e5de1146522ad853b4cb51ff58fdad6ad79f7d is the first bad commit > commit 96e5de1146522ad853b4cb51ff58fdad6ad79f7d > Author: Doug Evans > Date: Fri Aug 10 20:25:50 2012 +0000 > > Add $_memeq, $_regex, $_streq, $_strlen convenience functions. > > -PASS: gdb.base/default.exp: show convenience > +FAIL: gdb.base/default.exp: show convenience ($_probe_arg0 = not found) > > It happens on all OSes/archs but only without --without-python. Blech. I'm used to skimming over a (small) list of failures and this one got lost. [Note to self: Finish installation of validate_failures.py.] There are two ways to proceed here, based on the answer to this question: Does "show conv" include convenience functions? I can argue either way, but I prefer it including functions, so I've updated the respective text. Tested on amd64-linux with/without Python. I will check this in in a few days if there are no objections. [modulo doc RFA: Eli?] btw, I changed "print $foo=1" to "set $foo=1" in the output of "help show conv". I think it's cleaner. 2012-08-11 Doug Evans * value.c (show_convenience): Tweak comment. (_initialize_values): Mention convenience functions in the help text for "show convenience". doc/ * gdb.texinfo (Convenience Vars): Update text for "show convenience" to include functions. testsuite/ * gdb.base/default.exp: Update expected output of "show convenience". Index: value.c =================================================================== RCS file: /cvs/src/src/gdb/value.c,v retrieving revision 1.160 diff -u -p -r1.160 value.c --- value.c 13 Jun 2012 15:50:19 -0000 1.160 +++ value.c 11 Aug 2012 17:36:59 -0000 @@ -2255,11 +2255,17 @@ show_convenience (char *ignore, int from printf_filtered (("\n")); } if (!varseen) - printf_unfiltered (_("No debugger convenience variables now defined.\n" - "Convenience variables have " - "names starting with \"$\";\n" - "use \"set\" as in \"set " - "$foo = 5\" to define them.\n")); + { + /* This text does not mention convenience functions on purpose. + The user can't create them except via Python, and if Python support + is installed this message will never be printed ($_streq will + exist). */ + printf_unfiltered (_("No debugger convenience variables now defined.\n" + "Convenience variables have " + "names starting with \"$\";\n" + "use \"set\" as in \"set " + "$foo = 5\" to define them.\n")); + } } /* Extract a value as a C number (either long or double). @@ -3363,14 +3369,18 @@ void _initialize_values (void) { add_cmd ("convenience", no_class, show_convenience, _("\ -Debugger convenience (\"$foo\") variables.\n\ -These variables are created when you assign them values;\n\ -thus, \"print $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\ +Debugger convenience (\"$foo\") variables and functions.\n\ +Convenience variables are created when you assign them values;\n\ +thus, \"set $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\ \n\ A few convenience variables are given values automatically:\n\ \"$_\"holds the last address examined with \"x\" or \"info lines\",\n\ -\"$__\" holds the contents of the last address examined with \"x\"."), - &showlist); +\"$__\" holds the contents of the last address examined with \"x\"." +#ifdef HAVE_PYTHON +"\n\n\ +Convenience functions are defined via the Python API." +#endif + ), &showlist); add_cmd ("values", no_set_class, show_values, _("\ Elements of value history around item number IDX (or last ten)."), Index: doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.1000 diff -u -p -r1.1000 gdb.texinfo --- doc/gdb.texinfo 10 Aug 2012 20:25:56 -0000 1.1000 +++ doc/gdb.texinfo 11 Aug 2012 17:37:00 -0000 @@ -9225,9 +9225,10 @@ variable, when used as an expression, ha @table @code @kindex show convenience -@cindex show all user variables +@cindex show all user variables and functions @item show convenience -Print a list of convenience variables used so far, and their values. +Print a list of convenience variables used so far, and their values, +as well as a list of the convenience functions. Abbreviated @code{show conv}. @kindex init-if-undefined Index: testsuite/gdb.base/default.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/default.exp,v retrieving revision 1.60 diff -u -p -r1.60 default.exp --- testsuite/gdb.base/default.exp 7 Aug 2012 05:49:02 -0000 1.60 +++ testsuite/gdb.base/default.exp 11 Aug 2012 17:37:00 -0000 @@ -595,11 +595,10 @@ gdb_test "show complaints" "Max number o gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm" #test show convenience -# This is tricker as there are multiple internal convenience vars and we -# can't assume any particular order. -gdb_test_list_exact "show convenience" "show convenience" \ - "\[^\r\n\]+\[\r\n\]+" \ - "\[^\r\n\]+" \ +# This is trickier as there are multiple internal convenience vars and +# functions and we can't assume any particular order. +# And we have to handle the extra convenience funs provided by Python. +set show_conv_list \ { \ {$_sdata = void} \ {$_siginfo = void} \ @@ -618,6 +617,19 @@ gdb_test_list_exact "show convenience" " {$_probe_arg10 = } \ {$_probe_arg11 = } \ } +if ![skip_python_tests] { + append show_conv_list \ + { + {$_memeq = } \ + {$_regex = } \ + {$_streq = } \ + {$_strlen = } \ + } +} +gdb_test_list_exact "show convenience" "show convenience" \ + "\[^\r\n\]+\[\r\n\]+" \ + "\[^\r\n\]+" \ + $show_conv_list #test show directories gdb_test "show directories" "Source directories searched: .cdir\[:;\].cwd" "show directories"