public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Introduce reset_locator function in tui-layout.c
Date: Thu, 18 Jul 2019 01:24:00 -0000	[thread overview]
Message-ID: <1bf605de8e9ae4fcf77c21067ddaf4a242a873f7@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 1bf605de8e9ae4fcf77c21067ddaf4a242a873f7 ***

commit 1bf605de8e9ae4fcf77c21067ddaf4a242a873f7
Author:     Tom Tromey <tom@tromey.com>
AuthorDate: Fri Jun 28 23:56:25 2019 -0600
Commit:     Tom Tromey <tom@tromey.com>
CommitDate: Wed Jul 17 12:19:13 2019 -0600

    Introduce reset_locator function in tui-layout.c
    
    init_and_make_win in tui-layout.c is now only called for the locator
    -- earlier changes have made most of the cases here obsolete.  This
    patch removes init_and_make_win and introduces a reset_locator
    function.  Window creation is now much simpler to follow, because it
    is no longer quite so dynamic.  (Though it will become even simpler in
    coming patches.)
    
    gdb/ChangeLog
    2019-07-17  Tom Tromey  <tom@tromey.com>
    
            * tui/tui-layout.c (show_source_disasm_command): Use
            reset_locator.
            (reset_locator): New function.
            (init_and_make_win): Remove.
            (show_source_or_disasm_and_command): Use reset_locator.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1c56652d8a..76549e029a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2019-07-17  Tom Tromey  <tom@tromey.com>
+
+	* tui/tui-layout.c (show_source_disasm_command): Use
+	reset_locator.
+	(reset_locator): New function.
+	(init_and_make_win): Remove.
+	(show_source_or_disasm_and_command): Use reset_locator.
+
 2019-07-17  Tom Tromey  <tom@tromey.com>
 
 	* tui/tui-winsource.c (tui_set_exec_info_content): Remove
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 23537b7f49..ab849a9813 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -43,10 +43,8 @@
 ** Static Local Decls
 ********************************/
 static void show_layout (enum tui_layout_type);
-static tui_gen_win_info *init_and_make_win (tui_gen_win_info *,
-					    enum tui_win_type,
-					    int, int, int, int,
-					    enum tui_box);
+static void reset_locator (tui_gen_win_info *,
+			   int, int, int, int);
 static void show_source_or_disasm_and_command (enum tui_layout_type);
 static struct tui_win_info *make_command_window (int, int);
 static struct tui_win_info *make_source_window (int, int);
@@ -614,13 +612,11 @@ show_source_disasm_command (void)
 	{
 	  tui_win_list[DISASSEM_WIN]
 	    = make_disasm_window (asm_height, src_height - 1);
-	  init_and_make_win (locator,
-			     LOCATOR_WIN,
-			     2 /* 1 */ ,
-			     tui_term_width (),
-			     0,
-			     (src_height + asm_height) - 1,
-			     DONT_BOX_WINDOW);
+	  reset_locator (locator,
+			 2 /* 1 */ ,
+			 tui_term_width (),
+			 0,
+			 (src_height + asm_height) - 1);
 	}
       else
 	{
@@ -696,13 +692,11 @@ show_data (enum tui_layout_type new_layout)
       else
 	tui_win_list[win_type]
 	  = make_disasm_window (src_height, data_height - 1);
-      init_and_make_win (locator,
-			     LOCATOR_WIN,
-			     2 /* 1 */ ,
-			     tui_term_width (),
-			     0,
-			     total_height - 1,
-			     DONT_BOX_WINDOW);
+      reset_locator (locator,
+		     2 /* 1 */ ,
+		     tui_term_width (),
+		     0,
+		     total_height - 1);
       base = (tui_source_window_base *) tui_win_list[win_type];
     }
   else
@@ -751,48 +745,13 @@ tui_gen_win_info::reset (enum tui_win_type win_type,
   origin.y = origin_y_;
 }
 
-/* init_and_make_win().
- */
-static tui_gen_win_info *
-init_and_make_win (tui_gen_win_info *win_info, 
-		   enum tui_win_type win_type,
-		   int height, int width, 
-		   int origin_x, int origin_y,
-		   enum tui_box box_it)
+static void
+reset_locator (tui_gen_win_info *win_info, 
+	       int height, int width, 
+	       int origin_x, int origin_y)
 {
-  if (win_info == NULL)
-    {
-      switch (win_type)
-	{
-	case SRC_WIN:
-	  win_info = new tui_source_window ();
-	  break;
-
-	case DISASSEM_WIN:
-	  win_info = new tui_disasm_window ();
-	  break;
-
-	case DATA_WIN:
-	  win_info = new tui_data_window ();
-	  break;
-
-	case CMD_WIN:
-	  win_info = new tui_cmd_window ();
-	  break;
-
-	case EXEC_INFO_WIN:
-	  win_info = new tui_exec_info_window ();
-	  break;
-
-	default:
-	  gdb_assert_not_reached (_("unhandled window type"));
-	}
-    }
-
-  win_info->reset (win_type, height, width, origin_x, origin_y);
-  tui_make_window (win_info, box_it);
-
-  return win_info;
+  win_info->reset (LOCATOR_WIN, height, width, origin_x, origin_y);
+  tui_make_window (win_info, DONT_BOX_WINDOW);
 }
 
 
@@ -825,13 +784,11 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
 	    *win_info_ptr = make_source_window (src_height - 1, 0);
 	  else
 	    *win_info_ptr = make_disasm_window (src_height - 1, 0);
-	  init_and_make_win (locator,
-			     LOCATOR_WIN,
-			     2 /* 1 */ ,
-			     tui_term_width (),
-			     0,
-			     src_height - 1,
-			     DONT_BOX_WINDOW);
+	  reset_locator (locator,
+			 2 /* 1 */ ,
+			 tui_term_width (),
+			 0,
+			 src_height - 1);
 	  base = (tui_source_window_base *) *win_info_ptr;
 	}
       else


             reply	other threads:[~2019-07-18  1:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18  1:24 gdb-buildbot [this message]
2019-07-18  1:25 ` *** COMPILATION FAILED *** Failures on Solaris11-sparcv9-m64, branch master *** BREAKAGE *** gdb-buildbot
2019-07-18  2:07 ` *** COMPILATION FAILED *** Failures on Solaris11-amd64-m64, " gdb-buildbot
2019-07-18  2:45 ` *** COMPILATION FAILED *** Failures on NetBSD-x86_64-m64, " gdb-buildbot
2019-07-19 13:25 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-07-19 13:35 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-07-19 13:35 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-07-19 13:42 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-07-19 13:58 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-07-19 14:05 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2019-07-19 14:05 ` Failures on Fedora-i686, branch master gdb-buildbot
2019-07-19 14:46 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-native-gdbserver-m32, branch master *** BREAKAGE *** gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bf605de8e9ae4fcf77c21067ddaf4a242a873f7@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).