This is the mail archive of the
mailing list for the GDB project.
Re: bug in mi when setting breakpoint
On Tue, Dec 18, 2007 at 12:04:29AM +1300, Nick Roberts wrote:
> > I am not aware of the exact changeset that changed the behaviour. Could you
> > point me to it please ? I am only aware of what is in gdb 6.7.1 now, sorry.
> I think it's this one:
> 2007-01-03 Jan Kratochvil <email@example.com>
> Daniel Jacobowitz <firstname.lastname@example.org>
> * Makefile.in (top.o): Update.
> * top.c (gdb_readline_wrapper_done, gdb_readline_wrapper_result)
> (saved_after_char_processing_hook, gdb_readline_wrapper_line)
> (struct gdb_readline_wrapper_cleanup, gdb_readline_wrapper_cleanup):
> (gdb_readline_wrapper): Rewrite to use asynchronous readline.
> I see behaviour changed around that time.
Ah okay Nick. This is really valuable info. Thank you.
> > So in short, MI disallows prompts. It does this by setting the member
> > prompt_proc_p of the struct interp_procs to a function that always returns
> > 0. This is done in _initialize_mi_interp() (in gdb/mi/mi-interp.c).
> Why does MI disallow prompts? Presumably it's for good reason and perhaps
> you're trying to subvert that. The function gdb_readline_wrapper used to
> be just that: a wrapper for readline. It didn't used to do things like
> call display_gdb_prompt. Perhaps its name should be changed.
I am not sure why MI disallows prompts. But I would think it is because MI has
its own prompt, which is the string "(gdb)", and which should appear at the
very end of the MI output. So allowing prompt spitted of other parts of the code
could possibly break the MI output format.
I guess Daniel or Jan could shed some light on this matter ?
> > I am not sure to understand why are saying this here :-)
> > But for what it is worth, the CLI interpreter allows prompt, yes. I am not
> > sure to understand why it is unfortunatel
> I'm trying to say that sub-prompts are really for the command line.
> > >
> > > Perhaps, for now, GDB could do something similar, i.e., set all the breakpoints
> > > in the breakpoint menu.
> > Hmmh, no. I think it is important to stay consistent with the format of the
> > "question" asked to the user in the pre 6.7.1 and make that question be
> > followed by a prompt. Otherwise this would break existing front ends.
> It's probably important not to break existing use, if possible, but you
> appear to be parsing CLI output that hasn't really been designed for use
> with front ends. So I don't think it's a question of being consistent.
Well, all the good graphical debuggers out there let the user choose
between function overloads when the user sets a breakpoint by specifier a
function name. So there must be a way to let the user choose.
I tried to parse the sub-prompt *MI* was spitting because I had not other
choice but parse the only thing the mi interpreter was outputing, even if
that output was not compliant with the documented MI format.
And all the front ends willing to provide that user experience are
forced to do the same.
So the consistency is maybe not a requirement, but I think it would be
really nice to have it.