public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug server/15746] "monitor exit", then "quit" leaves gdb still running
Date: Fri, 04 Nov 2022 09:52:54 +0000	[thread overview]
Message-ID: <bug-15746-4717-rnRJkBB5nU@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15746-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=15746

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
This fixes it:
...
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index fe4041662ef..6a2afb69b54 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -488,7 +488,18 @@ quit_command (const char *args, int from_tty)
   if (!quit_confirm ())
     error (_("Not confirmed."));

-  query_if_trace_running (from_tty);
+  try
+    {
+      query_if_trace_running (from_tty);
+    }
+  catch (const gdb_exception_error &ex)
+    {
+      exception_print (gdb_stderr, ex);
+    }
+  catch (const gdb_exception_quit &)
+    {
+      /* A quit event happens while we're quitting?  Keep quitting.  */
+    }

   quit_force (args ? &exit_code : NULL, from_tty);
 }
...

Now we have:
...
Quit anyway? (y or n) y
Remote connection closed
$ 
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-11-04  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 19:05 [Bug server/15746] New: " dje at google dot com
2013-08-30 14:09 ` [Bug server/15746] " msaleem at codesourcery dot com
2013-08-30 14:36 ` msaleem at codesourcery dot com
2022-11-04  9:49 ` vries at gcc dot gnu.org
2022-11-04  9:52 ` vries at gcc dot gnu.org [this message]
2022-11-04 17:50 ` vries at gcc dot gnu.org
2022-11-08 17:50 ` vries at gcc dot gnu.org
2022-11-08 17:55 ` cvs-commit at gcc dot gnu.org

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=bug-15746-4717-rnRJkBB5nU@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).