diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-28 14:48:45 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-07-17 12:19:04 -0600 |
commit | b73dd8779c0530e91c6e5067eab4cb7ca3f794d5 (patch) | |
tree | e717d03900daf50b3c3644b10d40b2927bdce635 /gdb/tui/tui-hooks.c | |
parent | ae2b53806d3ce384e349c722b21a7ad246102d5b (diff) | |
download | gdb-b73dd8779c0530e91c6e5067eab4cb7ca3f794d5.zip gdb-b73dd8779c0530e91c6e5067eab4cb7ca3f794d5.tar.gz gdb-b73dd8779c0530e91c6e5067eab4cb7ca3f794d5.tar.bz2 |
Make source windows be self-updating
This changes the TUI source window to register itself on the
source_styling_changed observable, and removes a bit of code from
tui-hooks.c. This reduces the number of uses of the TUI_SRC_WIN
global.
gdb/ChangeLog
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_source_window): New constructor. Add
observer.
(~tui_source_window): New destructor.
(tui_source_window::style_changed): New method.
* tui/tui-hooks.c (tui_redisplay_source): Remove.
(tui_attach_detach_observers): Update.
* tui/tui-data.h (struct tui_source_window): Make constructor not
inline. Add destructor.
(struct tui_source_window) <style_changed>: New method.
<m_observable>: New member.
Diffstat (limited to 'gdb/tui/tui-hooks.c')
-rw-r--r-- | gdb/tui/tui-hooks.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index 7101053..84acd3a 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -204,18 +204,6 @@ tui_normal_stop (struct bpstats *bs, int print_frame) 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_SRC_WIN->refill (); - } -} - /* Token associated with observers registered while TUI hooks are installed. */ static const gdb::observers::token tui_observers_token {}; @@ -251,8 +239,6 @@ tui_attach_detach_observers (bool 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. */ |