aboutsummaryrefslogtreecommitdiff
path: root/gdb/debuginfod-support.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-06-16 17:55:57 -0600
committerTom Tromey <tom@tromey.com>2020-06-16 18:02:20 -0600
commita350efd4fb368a35ada608f6bc26ccd3bed0ae6b (patch)
treea0f33da8020b08e20d56e414ae82a06c9c0ed7e6 /gdb/debuginfod-support.h
parent39ec04904ff172dd67fd43ed3720f26d854732bf (diff)
downloadgdb-a350efd4fb368a35ada608f6bc26ccd3bed0ae6b.zip
gdb-a350efd4fb368a35ada608f6bc26ccd3bed0ae6b.tar.gz
gdb-a350efd4fb368a35ada608f6bc26ccd3bed0ae6b.tar.bz2
Fix crash when exiting TUI with gdb -tui
PR tui/25348 points out that, when "gdb -tui" is used, then exiting the TUI will cause a crash. This happens because tui_setup_io stashes some readline variables -- but because this happens before readline is initialized, some of these are NULL. Then, when exiting the TUI, the NULL values are "restored", causing a crash in readline. This patch fixes the problem by ensuring that readline is initialized first. Back in commit 11061048d ("Give a name to the TUI SingleKey keymap"), a call to rl_initialize was removed from tui_initialize_readline; this patch resurrects the call, but moves it to the end of the function, so as not to remove the ability to modify the SingleKey map from .inputrc. gdb/ChangeLog 2020-06-16 Tom Tromey <tom@tromey.com> PR tui/25348: * tui/tui.c (tui_ensure_readline_initialized): Rename from tui_initialize_readline. Only run once. Call rl_initialize. * tui/tui.h (tui_ensure_readline_initialized): Rename from tui_initialize_readline. * tui/tui-io.c (tui_setup_io): Call tui_ensure_readline_initialized. * tui/tui-interp.c (tui_interp::init): Update.
Diffstat (limited to 'gdb/debuginfod-support.h')
0 files changed, 0 insertions, 0 deletions