Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [MI, doc] flush output in -gdb-exit
Date: Thu, 17 Dec 2009 07:46:00 -0000	[thread overview]
Message-ID: <200912171046.03355.vladimir@codesourcery.com> (raw)


I've noticed that under frontend, -gdb-exit may "timeout", even though it sends "^exit"
immediately. There was a flush missing. This patch adds it, and clarifies that frontend
should wait for GDB to actually exit, not just acknoledge the request.

OK?

- Volodya

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e880838..1824a6c 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -21955,6 +21955,13 @@ Quitting @value{GDBN} just prints the result class @samp{^exit}.
 <- ^exit
 @end smallexample

+Please note that @samp{^exit} is printed immediately, but it might
+take some time for GDB to actually exit.  During that time, GDB
+performs necessary cleanups, including killing programs being debugged
+or disconnecting from debug hardware, so the frontend should wait till
+GDB exits and should only forcibly kill GDB if it fails to exit in
+reasonable time.
+
 @subheading A Bad Command

 Here's what happens if you pass a non-existent command:
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 2332752..0c8e917 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -111,6 +111,7 @@ mi_cmd_gdb_exit (char *command, char **argv, int argc)
     fputs_unfiltered (current_token, raw_stdout);
   fputs_unfiltered ("^exit\n", raw_stdout);
   mi_out_put (uiout, raw_stdout);
+  gdb_flush (raw_stdout);
   /* FIXME: The function called is not yet a formal libgdb function.  */
   quit_force (NULL, FROM_TTY);
 }

- Volodya


             reply	other threads:[~2009-12-17  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17  7:46 Vladimir Prus [this message]
2009-12-17 13:13 ` Daniel Jacobowitz
2009-12-17 14:01   ` Vladimir Prus
2009-12-17 15:12     ` Daniel Jacobowitz
2009-12-17 19:54 ` Eli Zaretskii
2009-12-21 10:02   ` Vladimir Prus

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=200912171046.03355.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@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