/* GDB hooks for TUI.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include "ui-out.h"
#include "top.h"
#include "observable.h"
+#include "source.h"
#include <unistd.h>
#include <fcntl.h>
tui_refresh_frame_and_register_information (/*registers_too_p=*/1);
}
+/* Observer for source_cache_cleared. */
+
+static void
+tui_redisplay_source ()
+{
+ if (tui_is_window_visible (SRC_WIN))
+ {
+ /* Force redisplay. */
+ tui_refill_source_window (tui_win_list[SRC_WIN]);
+ }
+}
+
/* Token associated with observers registered while TUI hooks are
installed. */
-static const gdb::observers::token tui_observers_token;
+static const gdb::observers::token tui_observers_token {};
/* Attach or detach a single observer, according to ATTACH. */
tui_normal_stop, attach);
attach_or_detach (gdb::observers::register_changed,
tui_register_changed, attach);
+ attach_or_detach (gdb::observers::source_styling_changed,
+ tui_redisplay_source, attach);
}
/* Install the TUI specific hooks. */