Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Chet Ramey <chet.ramey@case.edu>
To: Chet Ramey <chet.ramey@case.edu>,
	Nick Roberts <nickrob@snap.net.nz>,
	        Jan Kratochvil <jan.kratochvil@redhat.com>,
	gdb-patches@sourceware.org
Cc: chet.ramey@case.edu
Subject: Re: [patch] Fix testsuite annotate-quit race (PR 544)
Date: Tue, 25 Mar 2008 15:56:00 -0000	[thread overview]
Message-ID: <47E92093.3040704@case.edu> (raw)
In-Reply-To: <20080325025330.GA4677@caradoc.them.org>

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/


      reply	other threads:[~2008-03-25 15:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 22:55 Jan Kratochvil
2008-03-18 23:18 ` Daniel Jacobowitz
2008-03-19  8:11   ` Jan Kratochvil
2008-03-19  8:46     ` Nick Roberts
2008-03-19  9:31       ` Jan Kratochvil
2008-03-19  9:56         ` Nick Roberts
2008-03-19 10:13           ` Jan Kratochvil
2008-03-21 20:45     ` Jan Kratochvil
2008-03-21 21:04       ` Daniel Jacobowitz
2008-03-21 21:45         ` Daniel Jacobowitz
2008-03-23 11:01           ` Nick Roberts
2008-03-23 16:30             ` Daniel Jacobowitz
2008-03-23 16:44               ` Jan Kratochvil
2008-03-23 17:30                 ` Daniel Jacobowitz
2008-03-24  0:07                   ` Nick Roberts
2008-03-24  2:58                     ` Daniel Jacobowitz
2008-03-24  7:42                       ` Jan Kratochvil
2008-03-24 12:00                         ` Daniel Jacobowitz
2008-03-24 13:03                           ` Jan Kratochvil
2008-03-24 13:27                             ` Daniel Jacobowitz
2008-03-25  1:02                       ` Chet Ramey
2008-03-25  2:53                         ` Daniel Jacobowitz
2008-03-25 15:56                           ` Chet Ramey [this message]

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=47E92093.3040704@case.edu \
    --to=chet.ramey@case.edu \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --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