This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't send queries to the MI interpreter


On 02/10/2017 06:07 PM, Pedro Alves wrote:
> On 02/10/2017 05:44 PM, Pedro Alves wrote:
> 
>> OK, I found the branch.  Pushed here now:
>>
>>   https://github.com/palves/gdb/commits/palves/console-pagination
> 
> And re-reading the branch again, I noticed this hunk:
> 
> @@ -1255,7 +1258,9 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args)
>       way, important error messages don't get lost when talking to GDB
>       over a pipe.  */
>    if (current_ui->instream != current_ui->stdin_stream
> -      || !input_interactive_p (current_ui))
> +      || !input_interactive_p (current_ui)
> +      /* We can't handle nested queries.  */
> +      || current_ui != main_ui)
>      {
>        old_chain = make_cleanup_restore_target_terminal ();
>  
> @@ -2045,36 +2050,48 @@ begin_line (void)
>      }
>  }
> 
> This is similar to your patch, but it handles something your
> version doesn't, I think.  That is the case of handling the secondary
> channel being a CLI interpreter, not an MI one, and that UI
> having been started on a terminal.

So with with all the rationale I've thrown out, and idea
that we shouldn't see a query anyway, and considering that
real MI commands shouldn't really query anyway (nobody sees
the query output), it may be actually impossible to find
a way to this with MI on the secondary channel, that will
remain stable going forward.  Hmm.

So how about using the hunk shown above, which should handle
your case as well, and while at it write a test that
uses CLI in the secondary UI instead, making sure a query
is auto-answered in that UI?

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]