This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Queries in MI [was Re: MI usage inside a user-defined commands]
On Thu, Jul 07, 2005 at 10:51:50AM +1200, Nick Roberts wrote:
> > > The user should be asked:
> > >
> > > Make breakpoint pending on future shared library load? (y or [n])
> >
> > Yes, that does seem like a bug - but how would you perform the query?
>
> On older versions of GDB (example slightly changed because -interpreter-exec
> and pending breakpoints didn't exist):
>
> (gdb)
> quit
> &"quit\n"
> ~"The program is running. Exit anyway? (y or n) "
> n
> &"Not confirmed.\n"
> ^error,msg="Not confirmed."
> (gdb)
>
> which worked as for CLI. However, presumably this operation is synchronous.
> If MI becomes properly asynchronous then I'm not sure how to do it. Perhaps
> the the frontend could prepend a token on the input, just as MI already uses
> tokens for output.
Is it possible that FE's would want to automate the response to a query?
If so, does it make sense to put the query in the MI protocol?
For instance, a FE could implement a way to allow users to set a
breakpoint in the source window by class name/function. Then, when the
FE tries to automate the command, GDB could respond with a query,
the FE could present the user with choices (in dialog) and then send the
response back.
With the current response, the FE has no way of doing this.
Bob Rossi