This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix crash on NULL rl_prompt
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