Mirror of the gdb mailing list
 help / color / mirror / Atom feed
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 09:30:00 -0000	[thread overview]
Message-ID: <20071217093000.GA4094@coin> (raw)
In-Reply-To: <18277.36237.521792.245470@kahikatea.snap.net.nz>

On Mon, Dec 17, 2007 at 09:41:49AM +1300, Nick Roberts wrote:
[...]
> 
> Your patch appears to introduce new behaviour.  The question to ask is what
> change broke this behaviour?  I suspect it was the change to readline made at
> the start to this year.  GDB seems to go into gdb_readline_wrapper from
> decode_line_2 and stay there.

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.

But yeah, it actually boils down to the decode_line_2() that calls
command_line_input() to get input from the user (and display a prompt at
the same time).

That code patch It eventually ends up in display_gdb_prompt() which job is
to (surprise!) display our now famous prompt.

One of the first thing that display_gdb_prompt() does is to check if the
current interpreter has disabled prompts or not, by calling
current_interp_display_prompt_p(). This last function calls returns 0,
meaning that the current interpreter (in my case MI) disallows prompts so
the prompt is simply not displayed.

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).

[...]

> 
> Unfortunately CLI also uses sub-prompts for several other commands: queries e.g
> pending breakpoints, exiting after exevution has started; the "commands"
> command.  I don't think that they fit well with the MI paradigm: MI expects
> MI output.  With queries, GDB takes affirmative action, e.g., creates pending
> breakpoints regardless of the value of "show breakpoint pending" and exits
> regardless of the value of "show confirm".

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

> 
> 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.

Cheers,

-- 
Dodji Seketeli
http://www.seketeli.org/dodji


  parent reply	other threads:[~2007-12-17  9:30 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 [this message]
2007-12-17 11:04     ` Nick Roberts
2007-12-17 11:43       ` Dodji Seketeli
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=20071217093000.GA4094@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