Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: tromey@redhat.com,  gdb-patches@sourceware.org
Subject: Re: [patch] Fix crash on NULL rl_prompt
Date: Tue, 30 Mar 2010 17:55:00 -0000	[thread overview]
Message-ID: <201003301855.08267.pedro@codesourcery.com> (raw)
In-Reply-To: <20100330172940.GA17534@host0.dyn.jankratochvil.net>

On Tuesday 30 March 2010 18:29:40, Jan Kratochvil wrote:
> On Tue, 30 Mar 2010 19:25:18 +0200, Pedro Alves wrote:
> > GDB always gives readline a non-NULL prompt, from what I've seen.
> 
> gdb/tui/tui-io.c
> tui_setup_io (int mode)
>   if (mode)
>       rl_prompt = 0;
> 

Yes, but rl_set_prompt should be called shortly after, and before
tui_prep_terminal, so TUI displays a prompt as well.  Try
setting a watchpoint on rl_prompt, a break on tui_prep_terminal
and switching to the TUI and back.

On Tuesday 30 March 2010 18:30:48, Tom Tromey wrote:
> I see it as defensive programming.

Yes, of course.

> We can always un-approve it, if you would rather wait to see if a
> reproducer is available.

I'll leave it up to you to decide.  But if this goes in,
perhaps a comment saying this is being defensive would be good.

-- 
Pedro Alves


  reply	other threads:[~2010-03-30 17:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 23:40 Jan Kratochvil
2010-03-30 15:57 ` Tom Tromey
2010-03-30 16:12   ` Pedro Alves
2010-03-30 16:23     ` Tom Tromey
2010-03-30 16:41       ` Pedro Alves
2010-03-30 17:05         ` Jan Kratochvil
2010-03-30 17:13           ` Tom Tromey
2010-03-30 17:25           ` Pedro Alves
2010-03-30 17:29             ` Jan Kratochvil
2010-03-30 17:55               ` Pedro Alves [this message]
2010-03-31 21:27                 ` [cancel] " Jan Kratochvil
2010-03-30 17:31             ` Tom Tromey
2010-03-30 20:50             ` Pedro Alves

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=201003301855.08267.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=tromey@redhat.com \
    /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