From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26137 invoked by alias); 25 Mar 2008 15:56:48 -0000 Received: (qmail 26128 invoked by uid 22791); 25 Mar 2008 15:56:47 -0000 X-Spam-Check-By: sourceware.org Received: from mpv4.TIS.CWRU.Edu (HELO mpv4.tis.cwru.edu) (129.22.105.34) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Mar 2008 15:56:16 +0000 Received: from mpv8.TIS.CWRU.edu (mpv8.tis.CWRU.Edu [129.22.105.116]) by mpv4.tis.cwru.edu (MOS 3.8.6-GA) with ESMTP id CIZ40445; Tue, 25 Mar 2008 11:56:12 -0400 (EDT) Received: from z4.local (h69.240.40.69.ip.alltel.net [69.40.240.69]) by mpv8.TIS.CWRU.edu (MOS 4.0.4-FCS) with ESMTP id AQE43472 (AUTH cpr); Tue, 25 Mar 2008 11:56:11 -0400 Message-ID: <47E92093.3040704@case.edu> Date: Tue, 25 Mar 2008 15:56:00 -0000 From: Chet Ramey Reply-To: chet.ramey@case.edu User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Chet Ramey , Nick Roberts , Jan Kratochvil , gdb-patches@sourceware.org CC: chet.ramey@case.edu Subject: Re: [patch] Fix testsuite annotate-quit race (PR 544) References: <20080321204506.GA5033@host0.dyn.jankratochvil.net> <20080321210323.GA30247@caradoc.them.org> <20080321214448.GB29593@caradoc.them.org> <18406.14411.437345.335844@kahikatea.snap.net.nz> <20080323163027.GB13603@caradoc.them.org> <20080323164331.GA1195@host0.dyn.jankratochvil.net> <20080323173015.GA17514@caradoc.them.org> <18406.61574.596374.828002@kahikatea.snap.net.nz> <20080324025836.GA14474@caradoc.them.org> <47E84EEA.8000801@case.edu> <20080325025330.GA4677@caradoc.them.org> In-Reply-To: <20080325025330.GA4677@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=10/49, host=mpv4.tis.cwru.edu X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A090206.47E9209E.0239,ss=1,fgs=0, ip=69.40.240.69, so=2007-10-30 19:00:17, dmn=5.4.3/2008-02-01 X-Junkmail-IWF: false Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00386.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Mar 24, 2008 at 09:01:30PM -0400, Chet Ramey wrote: >> Daniel Jacobowitz wrote: >> >>> What I think is happening is that rl_redisplay has some optimizations >>> which cause it not to redisplay. And since we have a custom function >>> installed readline isn't calling the alternate hooks that force >>> display. So rl_redisplay does not actually meet the interface >>> associated with rl_redisplay_function despite being its default >>> value. Nasty. >> That's interesting, if true. Can anyone add detail confirming this? > > Sure. There's a check "rl_redisplay_function == rl_redisplay" in the > readline source, and another in the definition of > CUSTOM_REDISPLAY_FUNCTION. So that function is inherently special. > > From what Nick and Jan have found, stty -echo and then running GDB > with a custom redisplay function that just calls rl_redisplay > will not display the GDB prompt. You were pretty close to the answer; had you looked at the source around the check you identified, you would have found it (readline.c:readline_internal_setup()): /* If we're not echoing, we still want to at least print a prompt, because rl_redisplay will not do it for us. If the calling application has a custom redisplay function, though, let that function handle it. */ if (readline_echoing_p == 0 && rl_redisplay_function == rl_redisplay) { if (rl_prompt && rl_already_prompted == 0) { nprompt = _rl_strip_prompt (rl_prompt); fprintf (_rl_out_stream, "%s", nprompt); fflush (_rl_out_stream); free (nprompt); } } You've turned off echo, and the redisplay code won't print anything in that case. Readline, when using its internal redisplay function, chooses to print a prompt to at least visually clue the user that it's around. Having accepted responsibility for handling redisplay, gdb can do whatever it deems appropriate. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. No day but today. Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/