Change more TUI functions to take a tui_source_window_base
authorTom Tromey <tom@tromey.com>
Mon, 17 Jun 2019 18:51:29 +0000 (12:51 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:40 +0000 (07:48 -0600)
Several more TUI functions should only be called with a source or
disassembly window.  This patch changes these functions so that this
can be caught at compile time.

gdb/ChangeLog
2019-06-25  Tom Tromey  <tom@tromey.com>

* tui/tui-winsource.h (tui_set_exec_info_content)
(tui_show_exec_info_content, tui_erase_exec_info_content)
(tui_clear_exec_info_content, tui_update_exec_info): Change
argument to tui_source_window_base.
* tui/tui-winsource.c (tui_set_exec_info_content)
(tui_show_exec_info_content, tui_erase_exec_info_content)
(tui_clear_exec_info_content, tui_update_exec_info): Change
argument to tui_source_window_base.

gdb/ChangeLog
gdb/tui/tui-winsource.c
gdb/tui/tui-winsource.h

index dc3a449678570a082ab9b3ab240beb8d62cdb71b..43f8a5da412e0c60978eff6226bacea4ba6c7a77 100644 (file)
@@ -1,3 +1,14 @@
+2019-06-25  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-winsource.h (tui_set_exec_info_content)
+       (tui_show_exec_info_content, tui_erase_exec_info_content)
+       (tui_clear_exec_info_content, tui_update_exec_info): Change
+       argument to tui_source_window_base.
+       * tui/tui-winsource.c (tui_set_exec_info_content)
+       (tui_show_exec_info_content, tui_erase_exec_info_content)
+       (tui_clear_exec_info_content, tui_update_exec_info): Change
+       argument to tui_source_window_base.
+
 2019-06-25  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-winsource.h (tui_set_exec_info_content): Return void.
index 2de5c53214ece7fc9e850bf4369f8e46b1581474..e55ce40a206d9eff9491aaf7011e2fca81886314 100644 (file)
@@ -483,12 +483,11 @@ tui_update_breakpoint_info (struct tui_win_info *win,
    based upon the input window which is either the source or
    disassembly window.  */
 void
-tui_set_exec_info_content (struct tui_win_info *win_info)
+tui_set_exec_info_content (struct tui_source_window_base *win_info)
 {
-  tui_source_window_base *base = (tui_source_window_base *) win_info;
-  if (base->execution_info != NULL)
+  if (win_info->execution_info != NULL)
     {
-      struct tui_gen_win_info *exec_info_ptr = base->execution_info;
+      struct tui_gen_win_info *exec_info_ptr = win_info->execution_info;
 
       if (exec_info_ptr->content == NULL)
        exec_info_ptr->content =
@@ -532,10 +531,9 @@ tui_set_exec_info_content (struct tui_win_info *win_info)
 
 
 void
-tui_show_exec_info_content (struct tui_win_info *win_info)
+tui_show_exec_info_content (struct tui_source_window_base *win_info)
 {
-  tui_source_window_base *base = (tui_source_window_base *) win_info;
-  struct tui_gen_win_info *exec_info = base->execution_info;
+  struct tui_gen_win_info *exec_info = win_info->execution_info;
   int cur_line;
 
   werase (exec_info->handle);
@@ -552,28 +550,24 @@ tui_show_exec_info_content (struct tui_win_info *win_info)
 
 
 void
-tui_erase_exec_info_content (struct tui_win_info *win_info)
+tui_erase_exec_info_content (struct tui_source_window_base *win_info)
 {
-  tui_source_window_base *base = (tui_source_window_base *) win_info;
-  struct tui_gen_win_info *exec_info = base->execution_info;
+  struct tui_gen_win_info *exec_info = win_info->execution_info;
 
   werase (exec_info->handle);
   exec_info->refresh_window ();
 }
 
 void
-tui_clear_exec_info_content (struct tui_win_info *win_info)
+tui_clear_exec_info_content (struct tui_source_window_base *win_info)
 {
-  tui_source_window_base *base = (tui_source_window_base *) win_info;
-  base->execution_info->content_in_use = FALSE;
+  win_info->execution_info->content_in_use = FALSE;
   tui_erase_exec_info_content (win_info);
-
-  return;
 }
 
 /* Function to update the execution info window.  */
 void
-tui_update_exec_info (struct tui_win_info *win_info)
+tui_update_exec_info (struct tui_source_window_base *win_info)
 {
   tui_set_exec_info_content (win_info);
   tui_show_exec_info_content (win_info);
index 3ed461a3157cc03b81522ad3d6bea0ef7c64be34..09a9d5abf4a0bb6826b4f125b22daa1475ecfa8c 100644 (file)
@@ -53,11 +53,11 @@ extern void tui_update_source_windows_with_line (struct symtab *,
 extern void tui_clear_source_content (struct tui_win_info *, int);
 extern void tui_erase_source_content (struct tui_win_info *, int);
 extern void tui_show_source_content (struct tui_win_info *);
-extern void tui_set_exec_info_content (struct tui_win_info *);
-extern void tui_show_exec_info_content (struct tui_win_info *);
-extern void tui_erase_exec_info_content (struct tui_win_info *);
-extern void tui_clear_exec_info_content (struct tui_win_info *);
-extern void tui_update_exec_info (struct tui_win_info *);
+extern void tui_set_exec_info_content (struct tui_source_window_base *);
+extern void tui_show_exec_info_content (struct tui_source_window_base *);
+extern void tui_erase_exec_info_content (struct tui_source_window_base *);
+extern void tui_clear_exec_info_content (struct tui_source_window_base *);
+extern void tui_update_exec_info (struct tui_source_window_base *);
 
 extern void tui_alloc_source_buffer (struct tui_win_info *);
 extern int tui_line_is_displayed (int,