From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12756 invoked by alias); 23 Jan 2012 17:14:38 -0000 Received: (qmail 12746 invoked by uid 22791); 23 Jan 2012 17:14:36 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Mon, 23 Jan 2012 17:14:08 +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 q0NHE8RQ002296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Jan 2012 12:14:08 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0NHE768032704; Mon, 23 Jan 2012 12:14:07 -0500 Message-ID: <4F1D955E.3080902@redhat.com> Date: Mon, 23 Jan 2012 17:15:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Jan Kratochvil CC: GDB Patches Subject: Re: Decouple "set confirm" from `from_tty'. References: <4F194C6F.2080404@redhat.com> <20120123162500.GA25825@host2.jankratochvil.net> In-Reply-To: <20120123162500.GA25825@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-01/txt/msg00783.txt.bz2 On 01/23/2012 04:25 PM, Jan Kratochvil wrote: > On Fri, 20 Jan 2012 12:13:51 +0100, Pedro Alves wrote: >> Comments? > > Just that I would prefer renaming to be a separate commit, otherwise it > somehow complicates later regressions analysis etc. Sure very minor note. > > The real change here is negligible in size compared to the renaming. Sure. I've now committed the patch below, which is the same, but without the renaming. gdb/ 2012-01-23 Pedro Alves * top.c (caution): Update comment. (execute_command): Don't consider the current value of `caution'. gdb/testsuite/ 2012-01-23 Pedro Alves * gdb.base/call-signal-resume.exp: Allow output after "return". --- gdb/testsuite/gdb.base/call-signal-resume.exp | 4 ++-- gdb/top.c | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.base/call-signal-resume.exp b/gdb/testsuite/gdb.base/call-signal-resume.exp index 1c4517d..d383f5c 100644 --- a/gdb/testsuite/gdb.base/call-signal-resume.exp +++ b/gdb/testsuite/gdb.base/call-signal-resume.exp @@ -99,7 +99,7 @@ if { "$frame_number" == "" } { # Pop the dummy frame. gdb_test "frame $frame_number" ".*" gdb_test_no_output "set confirm off" -gdb_test_no_output "return" +gdb_test "return" "" # Resume execution, the program should continue without any signal. @@ -132,7 +132,7 @@ if { "$frame_number" == "" } { # Pop the dummy frame. gdb_test "frame $frame_number" ".*" gdb_test_no_output "set confirm off" -gdb_test_no_output "return" +gdb_test "return" "" # Continue again, this time we should get to the signal handler. diff --git a/gdb/top.c b/gdb/top.c index c4e913d..346d73b 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -98,9 +98,11 @@ int use_windows = 0; extern char lang_frame_mismatch_warn[]; /* language.c */ -/* Flag for whether we want all the "from_tty" gubbish printed. */ +/* Flag for whether we want to confirm potentially dangerous + operations. Default is yes. */ + +int caution = 1; -int caution = 1; /* Default is yes, sigh. */ static void show_caution (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -471,13 +473,13 @@ execute_command (char *p, int from_tty) if (c->class == class_user) execute_user_command (c, arg); else if (c->type == set_cmd || c->type == show_cmd) - do_setshow_command (arg, from_tty & caution, c); + do_setshow_command (arg, from_tty, c); else if (!cmd_func_p (c)) error (_("That is not a command, just a help topic.")); else if (deprecated_call_command_hook) - deprecated_call_command_hook (c, arg, from_tty & caution); + deprecated_call_command_hook (c, arg, from_tty); else - cmd_func (c, arg, from_tty & caution); + cmd_func (c, arg, from_tty); /* If the interpreter is in sync mode (we're running a user command's list, running command hooks or similars), and we