This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix "interpreter-exec mi" output causing false FAILs
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, vladimir at codesourcery dot com
- Date: Tue, 13 Mar 2012 18:33:24 -0700
- Subject: Re: [patch] Fix "interpreter-exec mi" output causing false FAILs
- References: <20120307091534.GA17085@host2.jankratochvil.net>
Hey guys,
I just noticed this email sitting in my gdb-patches mbox, and I am
wondering if it has been reviewed?
On Wed, Mar 07, 2012 at 10:15:34AM +0100, Jan Kratochvil wrote:
> Hi,
>
> (gdb) interpreter-exec mi -break-list
> ^done,BreakpointTable={[...]}
> (gdb)
> (gdb) q
>
> which can cause false
> FAIL: gdb.dwarf2/dw2-filename.exp: info sources
> with "read1" from
> reproducer for races of expect incomplete reads
> http://sourceware.org/bugzilla/show_bug.cgi?id=12649
>
> No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.
>
>
> Thanks,
> Jan
>
>
> 2012-03-07 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Fix double prompt of 'interpreter-exec mi'.
> * mi/mi-interp.c (mi_execute_command_input_handler): New prototype.
> (mi_interpreter_resume): use it.
> (mi_execute_command_input_handler): New function.
> * mi/mi-main.c (mi_execute_command): Move prompt printing to
> mi_execute_command_input_handler.
>
> --- a/gdb/mi/mi-interp.c
> +++ b/gdb/mi/mi-interp.c
> @@ -40,6 +40,7 @@
> interpreter. */
>
> static void mi_execute_command_wrapper (char *cmd);
> +static void mi_execute_command_input_handler (char *cmd);
> static void mi_command_loop (int mi_version);
>
> /* These are hooks that we put in place while doing interpreter_exec
> @@ -151,7 +152,7 @@ mi_interpreter_resume (void *data)
> /* These overwrite some of the initialization done in
> _intialize_event_loop. */
> call_readline = gdb_readline2;
> - input_handler = mi_execute_command_wrapper;
> + input_handler = mi_execute_command_input_handler;
> add_file_handler (input_fd, stdin_event_handler, 0);
> async_command_editing_p = 0;
> /* FIXME: This is a total hack for now. PB's use of the MI
> @@ -297,6 +298,17 @@ mi_execute_command_wrapper (char *cmd)
> mi_execute_command (cmd, stdin == instream);
> }
>
> +/* mi_execute_command_wrapper wrapper suitable for INPUT_HANDLER. */
> +
> +static void
> +mi_execute_command_input_handler (char *cmd)
> +{
> + mi_execute_command_wrapper (cmd);
> +
> + fputs_unfiltered ("(gdb) \n", raw_stdout);
> + gdb_flush (raw_stdout);
> +}
> +
> static void
> mi1_command_loop (void)
> {
> --- a/gdb/mi/mi-main.c
> +++ b/gdb/mi/mi-main.c
> @@ -2027,9 +2027,6 @@ mi_execute_command (char *cmd, int from_tty)
>
> mi_parse_free (command);
> }
> -
> - fputs_unfiltered ("(gdb) \n", raw_stdout);
> - gdb_flush (raw_stdout);
> }
>
> static void
--
Joel