diff options
author | Tom Tromey <tom@tromey.com> | 2020-06-16 17:55:57 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-06-16 18:02:20 -0600 |
commit | a350efd4fb368a35ada608f6bc26ccd3bed0ae6b (patch) | |
tree | a0f33da8020b08e20d56e414ae82a06c9c0ed7e6 /gdb/charset.c | |
parent | 39ec04904ff172dd67fd43ed3720f26d854732bf (diff) | |
download | gdb-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/charset.c')
0 files changed, 0 insertions, 0 deletions