diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-05-30 22:54:05 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-06-07 22:52:54 -0400 |
commit | 8a39a981bd8d576de0d343b8c2eee47655d8c720 (patch) | |
tree | d0d36339b4cdf19b9a2a05ba9aa6fd862fa5a2d1 /gdb/tui/tui-source.h | |
parent | b56d975cc8083e49c35be3a35faf1744da54fabc (diff) | |
download | gdb-8a39a981bd8d576de0d343b8c2eee47655d8c720.zip gdb-8a39a981bd8d576de0d343b8c2eee47655d8c720.tar.gz gdb-8a39a981bd8d576de0d343b8c2eee47655d8c720.tar.bz2 |
gdb/tui: change some macros to functions
Change the `TUI_*` macros to access known windows to functions. Define
them in their respective files, because trying to define them in
tui-data.h would end up causing include cycles.
This makes static analysis (detection of unused include files in this
case) more accurate, and I think in general we should avoid hiding
code behind macros if not necessary.
Change-Id: I1e38cee843984c48ab34030b19dac0d726f851af
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/tui/tui-source.h')
-rw-r--r-- | gdb/tui/tui-source.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/tui/tui-source.h b/gdb/tui/tui-source.h index 103b11e..9a72ed9 100644 --- a/gdb/tui/tui-source.h +++ b/gdb/tui/tui-source.h @@ -82,4 +82,12 @@ private: gdb::unique_xmalloc_ptr<char> m_fullname; }; +/* Return the instance of the source window. */ + +inline tui_source_window * +tui_src_win () +{ + return gdb::checked_static_cast<tui_source_window *> (tui_win_list[SRC_WIN]); +} + #endif /* TUI_TUI_SOURCE_H */ |