[PATCH 2/2] Fix crash when exiting TUI with gdb -tui

Christian Biesinger cbiesinger@google.com
Mon Jun 8 17:57:27 GMT 2020


On Sat, Jun 6, 2020 at 3:13 PM Tom Tromey <tom@tromey.com> wrote:
> --- a/gdb/tui/tui.c
> +++ b/gdb/tui/tui.c
> @@ -270,6 +270,12 @@ tui_set_key_mode (enum tui_key_mode mode)
>  void
>  tui_initialize_readline (void)
>  {
> +  static bool initialized;
> +
> +  if (initialized)
> +    return;
> +  initialized = true;

Would it make sense to rename this function to
tui_ensure_readline_initialized() or something, to make it clear that
it can be called more than once?

Christian


More information about the Gdb-patches mailing list