Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: Decouple "set confirm" from `from_tty'.
Date: Mon, 23 Jan 2012 17:15:00 -0000	[thread overview]
Message-ID: <4F1D955E.3080902@redhat.com> (raw)
In-Reply-To: <20120123162500.GA25825@host2.jankratochvil.net>

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  <palves@redhat.com>

	* top.c (caution): Update comment.
	(execute_command): Don't consider the current value of `caution'.

gdb/testsuite/
2012-01-23  Pedro Alves  <palves@redhat.com>

	* 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


      reply	other threads:[~2012-01-23 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 11:33 Pedro Alves
2012-01-20 14:31 ` Joel Brobecker
2012-01-23 17:36   ` Pedro Alves
2012-01-23 16:30 ` Jan Kratochvil
2012-01-23 17:15   ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1D955E.3080902@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox