This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit+7.6] [patch+7.6] [TUI] Fix scrolling crash 7.6 regression [Re: [PATCH] Fix gdb crash with tui]
On Thu, 14 Mar 2013 13:33:15 +0100, Pedro Alves wrote:
> On 03/13/2013 06:54 PM, Jan Kratochvil wrote:
> > That's true but I expect there has to be output a lot of other garbage like
> > "\tin " or "\n" so I did not consider "file" to be significant. I guess the
> > same crash could happen before just after much more scrollings.
>
> Hmm, I'm not seeing how. tui_show_source does no other output
> to gdb_stdout.
When I investigate it I agree there is no accidental output, I thought it is:
print_source_lines_base:
ui_out_field_int (uiout, "line", line);
ui_out_text (uiout, "\tin ");
ui_out_field_string (uiout, "file",
symtab_to_filename_for_display (s));
and TUI:
tui_ui_out_impl.text = tui_text;
tui_text:
if (data->line > 0)
{
if (strchr (string, '\n') != 0)
{
data->line = -1;
data->start_of_line = 0;
}
return;
}
That "\tin " is discarded thanks to that 'return' and 'data->line > 0'.
This was the mistake I made in the patch...
> > - /* TUI expects the "fullname" field. While it is
> > - !ui_out_is_mi_like_p compared to CLI it is !ui_source_list. */
> > + /* CLI expects only the "file" field. TUI expects only the
> > + "fullname" field (and TUI does break if "file" is printed).
> > + MI expects both the fields. ui_source_list is set only for CLI,
>
> s/both the fields/both fields/
done
> I'm wondering about whether this "fullname" handling gross-ness in the
> TUI is really necessary.
Probably not but I was fixing absolute pathnames across GDB, not fixing TUI.
I am still not done with the absolute pathnames task.
Checked in:
http://sourceware.org/ml/gdb-cvs/2013-03/msg00133.html
and for 7.6:
http://sourceware.org/ml/gdb-cvs/2013-03/msg00134.html
Thanks,
Jan