aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-regs.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-05-30 22:54:05 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-06-07 22:52:54 -0400
commit8a39a981bd8d576de0d343b8c2eee47655d8c720 (patch)
treed0d36339b4cdf19b9a2a05ba9aa6fd862fa5a2d1 /gdb/tui/tui-regs.h
parentb56d975cc8083e49c35be3a35faf1744da54fabc (diff)
downloadgdb-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-regs.h')
-rw-r--r--gdb/tui/tui-regs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index 07b9513..4a799e6 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -145,4 +145,12 @@ private:
gdbarch *m_gdbarch = nullptr;
};
+/* Return the instance of the registers window. */
+
+inline tui_data_window *
+tui_data_win ()
+{
+ return gdb::checked_static_cast<tui_data_window *> (tui_win_list[DATA_WIN]);
+}
+
#endif /* TUI_TUI_REGS_H */