* [MI, doc] flush output in -gdb-exit
@ 2009-12-17 7:46 Vladimir Prus
2009-12-17 13:13 ` Daniel Jacobowitz
2009-12-17 19:54 ` Eli Zaretskii
0 siblings, 2 replies; 6+ messages in thread
From: Vladimir Prus @ 2009-12-17 7:46 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MI, doc] flush output in -gdb-exit
2009-12-17 7:46 [MI, doc] flush output in -gdb-exit Vladimir Prus
@ 2009-12-17 13:13 ` Daniel Jacobowitz
2009-12-17 14:01 ` Vladimir Prus
2009-12-17 19:54 ` Eli Zaretskii
1 sibling, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2009-12-17 13:13 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
On Thu, Dec 17, 2009 at 10:46:03AM +0300, Vladimir Prus wrote:
>
> 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?
This is OK (with changelog), although I don't see why it's necessary -
when we exit, shouldn't that flush stdout?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MI, doc] flush output in -gdb-exit
2009-12-17 13:13 ` Daniel Jacobowitz
@ 2009-12-17 14:01 ` Vladimir Prus
2009-12-17 15:12 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Prus @ 2009-12-17 14:01 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
On Thursday 17 December 2009 16:13:32 Daniel Jacobowitz wrote:
> On Thu, Dec 17, 2009 at 10:46:03AM +0300, Vladimir Prus wrote:
> >
> > 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?
>
> This is OK (with changelog), although I don't see why it's necessary -
> when we exit, shouldn't that flush stdout?
It flushes stdout. However, it seems to my more convenient -- especially
when debugging frontend, if command response comes as soon as possible.
- Volodya
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MI, doc] flush output in -gdb-exit
2009-12-17 14:01 ` Vladimir Prus
@ 2009-12-17 15:12 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2009-12-17 15:12 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
On Thu, Dec 17, 2009 at 05:01:07PM +0300, Vladimir Prus wrote:
> It flushes stdout. However, it seems to my more convenient -- especially
> when debugging frontend, if command response comes as soon as possible.
Yeah, I agree.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MI, doc] flush output in -gdb-exit
2009-12-17 7:46 [MI, doc] flush output in -gdb-exit Vladimir Prus
2009-12-17 13:13 ` Daniel Jacobowitz
@ 2009-12-17 19:54 ` Eli Zaretskii
2009-12-21 10:02 ` Vladimir Prus
1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2009-12-17 19:54 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Thu, 17 Dec 2009 10:46:03 +0300
>
> OK?
Yes, after this:
> +take some time for GDB to actually exit. During that time, GDB
^^^ ^^^
@value{GDBN}
> +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
^^^ ^^^
Likewise.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [MI, doc] flush output in -gdb-exit
2009-12-17 19:54 ` Eli Zaretskii
@ 2009-12-21 10:02 ` Vladimir Prus
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Prus @ 2009-12-21 10:02 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 693 bytes --]
On Thursday 17 December 2009 22:56:08 Eli Zaretskii wrote:
> > From: Vladimir Prus <vladimir@codesourcery.com>
> > Date: Thu, 17 Dec 2009 10:46:03 +0300
> >
> > OK?
>
> Yes, after this:
>
> > +take some time for GDB to actually exit. During that time, GDB
> ^^^ ^^^
> @value{GDBN}
>
> > +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
> ^^^ ^^^
> Likewise.
Thanks for review. Here's what I've checked in.
- Volodya
[-- Attachment #2: gdb-exit-flush-final.diff --]
[-- Type: text/x-patch, Size: 2610 bytes --]
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.11158
diff -u -p -r1.11158 ChangeLog
--- gdb/ChangeLog 21 Dec 2009 09:50:26 -0000 1.11158
+++ gdb/ChangeLog 21 Dec 2009 10:01:18 -0000
@@ -1,5 +1,9 @@
2009-12-21 Vladimir Prus <vladimir@codesourcery.com>
+ * mi/mi-main.c (mi_cmd_gdb_exit): Flush raw_stdout.
+
+2009-12-21 Vladimir Prus <vladimir@codesourcery.com>
+
PR gdb/10884
* value.c (value_primitive_field): Call check_typedef
Index: gdb/doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.982
diff -u -p -r1.982 ChangeLog
--- gdb/doc/ChangeLog 21 Dec 2009 07:30:10 -0000 1.982
+++ gdb/doc/ChangeLog 21 Dec 2009 10:01:19 -0000
@@ -1,3 +1,8 @@
+2009-12-21 Vladimir Prus <vladimir@codesourcery.com>
+
+ * gdb.texinfo (GDB/MI Miscellaneous Commands): Clarify that
+ -gdb-exit behaviour.
+
2009-12-20 Joel Brobecker <brobecker@adacore.com>
* gpl.texi: Update to version 3 of the GPL.
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.648
diff -u -p -r1.648 gdb.texinfo
--- gdb/doc/gdb.texinfo 8 Dec 2009 14:06:02 -0000 1.648
+++ gdb/doc/gdb.texinfo 21 Dec 2009 10:01:20 -0000
@@ -21955,6 +21955,13 @@ Quitting @value{GDBN} just prints the re
<- ^exit
@end smallexample
+Please note that @samp{^exit} is printed immediately, but it might
+take some time for @value{GDBN} to actually exit. During that time, @value{GDBN}
+performs necessary cleanups, including killing programs being debugged
+or disconnecting from debug hardware, so the frontend should wait till
+@value{GDBN} exits and should only forcibly kill @value{GDBN} if it
+fails to exit in reasonable time.
+
@subheading A Bad Command
Here's what happens if you pass a non-existent command:
Index: gdb/mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.159
diff -u -p -r1.159 mi-main.c
--- gdb/mi/mi-main.c 30 Oct 2009 17:34:53 -0000 1.159
+++ gdb/mi/mi-main.c 21 Dec 2009 10:01:20 -0000
@@ -111,6 +111,7 @@ mi_cmd_gdb_exit (char *command, char **a
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);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-12-21 10:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17 7:46 [MI, doc] flush output in -gdb-exit Vladimir Prus
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox