From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11584 invoked by alias); 17 Dec 2007 09:30:13 -0000 Received: (qmail 11574 invoked by uid 22791); 17 Dec 2007 09:30:12 -0000 X-Spam-Check-By: sourceware.org Received: from smtp1-g19.free.fr (HELO smtp1-g19.free.fr) (212.27.42.27) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Dec 2007 09:30:03 +0000 Received: from smtp1-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp1-g19.free.fr (Postfix) with ESMTP id 061871AB319; Mon, 17 Dec 2007 10:30:01 +0100 (CET) Received: from coin.localdomain (torimasen.com [82.237.12.13]) by smtp1-g19.free.fr (Postfix) with ESMTP id D220C1AB2AD; Mon, 17 Dec 2007 10:30:00 +0100 (CET) Received: by coin.localdomain (Postfix, from userid 1000) id 85A4D7A400; Mon, 17 Dec 2007 10:30:00 +0100 (CET) Date: Mon, 17 Dec 2007 09:30:00 -0000 From: Dodji Seketeli To: Nick Roberts Cc: dodji@seketeli.org, gdb@sourceware.org Subject: Re: bug in mi when setting breakpoint Message-ID: <20071217093000.GA4094@coin> Reply-To: dodji@seketeli.org References: <20071216125625.GE4783@coin> <18277.36237.521792.245470@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18277.36237.521792.245470@kahikatea.snap.net.nz> X-Operating-System: GNU/Linux User-Agent: Mutt Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00115.txt.bz2 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