binutils-gdb/gdb/tui
Tom Tromey 0c820d6793 Fix some valgrind errors in the TUI
The styling series introduced some new errors in the TUI -- the series
changed how source lines are allocated, without updating
tui_set_source_content_nil.

There are several failures but a typical one looks like:

==6274== Use of uninitialised value of size 8
==6274==    at 0x4E4A095: wclrtoeol (in /usr/lib64/libncursesw.so.6.1)
==6274==    by 0x4E47617: waddch (in /usr/lib64/libncursesw.so.6.1)
==6274==    by 0x8325CB: tui_puts_internal(_win_st*, char const*, int*) (tui-io.c:393)
==6274==    by 0x82E89D: tui_file::puts(char const*) (tui-file.c:39)
==6274==    by 0x84BF5F: vfprintf_unfiltered(ui_file*, char const*, __va_list_tag*) (utils.c:2026)

This patch rewrites tui_set_source_content_nil, fixing the bug.

This was also reported as PR tui/24197.

Verified by running valgrind before and after on x86-64 Fedora 29.

gdb/ChangeLog
2019-02-17  Tom Tromey  <tom@tromey.com>

	PR tui/24197:
	* tui/tui-source.c (tui_set_source_content_nil): Rewrite.
2019-02-17 10:39:45 -07:00
..
ChangeLog-1998-2003
tui-command.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-command.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-data.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-data.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-disasm.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-disasm.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-file.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-file.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-hooks.c gdb: Move declarations from symtab.h to source.h 2019-01-08 12:19:40 +00:00
tui-hooks.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-interp.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-io.c Normalize includes to use common/ 2019-01-25 15:28:16 -07:00
tui-io.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-layout.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-layout.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-out.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-out.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-regs.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-regs.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-source.c Fix some valgrind errors in the TUI 2019-02-17 10:39:45 -07:00
tui-source.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-stack.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-stack.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-win.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-win.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-windata.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-windata.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-wingeneral.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-wingeneral.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui-winsource.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui-winsource.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
tui.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tui.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00