From: Dodji Seketeli <dodji@seketeli.org>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: dodji@seketeli.org, gdb@sourceware.org
Subject: Re: bug in mi when setting breakpoint
Date: Mon, 17 Dec 2007 11:43:00 -0000 [thread overview]
Message-ID: <20071217114300.GC4094@coin> (raw)
In-Reply-To: <18278.22461.132427.492561@kahikatea.snap.net.nz>
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 <jan.kratochvil@redhat.com>
> Daniel Jacobowitz <dan@codesourcery.com>
>
> * 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):
> New.
> (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.
Ah, okay.
>
> > >
> > > 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.
Cheers,
--
Dodji Seketeli
http://www.seketeli.org/dodji
next prev parent reply other threads:[~2007-12-17 11:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-16 12:56 Dodji Seketeli
2007-12-16 20:42 ` Nick Roberts
2007-12-16 21:21 ` Vladimir Prus
2007-12-16 22:00 ` Nick Roberts
2007-12-17 9:30 ` Dodji Seketeli
2007-12-17 11:04 ` Nick Roberts
2007-12-17 11:43 ` Dodji Seketeli [this message]
2008-01-15 3:37 ` Nick Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071217114300.GC4094@coin \
--to=dodji@seketeli.org \
--cc=gdb@sourceware.org \
--cc=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox