[1/4] gdb: Remove register class specific layout names.

Message ID 90740f3ef5bac701c1653d469fcc9d34fb113517.1432163460.git.andrew.burgess@embecosm.com
State Committed
Headers

Commit Message

Andrew Burgess May 20, 2015, 11:17 p.m. UTC
  The layout command supports the layout names $FREGS, $GREGS, $SREGS,
and $REGS. The intention of these layout names was to display the tui
register window with a specific set of registers.

First, these layout names no longer work, and haven't for a while, using
any of them will just result in switching to the general register view.

Second there is already the command 'tui reg GROUP' command to set the
displayed register set to GROUP, so making the layout command also
control the register set feels like unnecessary overloading of the
layout command.

This commit removes all code relating to supporting the register set
specific names from the layout command.  Afterwards the user can select
an available layout using the layout command, and control the choice of
register set using the 'tui reg GROUP' command.

gdb/ChangeLog:

	* tui/tui-layout.c (tui_set_layout): Remove
	tui_register_display_type parameter.  Remove all checking of this
	parameter, and reindent function.  Update header comment.
	(tui_set_layout_for_display_command): Don't check for different
	register class types, don't pass a tui_register_display_type to
	tui_set_layout.
	(layout_names): Remove register set specific names.
	* tui/tui-layout.h (tui_set_layout): Remove
	tui_register_display_type parameter.
	* tui/tui.c (tui_rl_change_windows): Don't pass a
	tui_register_display_type to tui_set_layout.
	(tui_rl_delete_other_windows): Likewise.
	(tui_enable): Likewise.
	* tui/tui-data.h (TUI_FLOAT_REGS_NAME): Remove.
	(TUI_FLOAT_REGS_NAME_LOWER): Remove.
	(TUI_GENERAL_REGS_NAME): Remove.
	(TUI_GENERAL_REGS_NAME_LOWER): Remove.
	(TUI_SPECIAL_REGS_NAME): Remove.
	(TUI_SPECIAL_REGS_NAME_LOWER): Remove.
	(TUI_GENERAL_SPECIAL_REGS_NAME): Remove.
	(TUI_GENERAL_SPECIAL_REGS_NAME_LOWER): Remove.
	(enum tui_register_display_type): Remove.
	(struct tui_layout_def): Remove regs_display_type and
	float_regs_display_type fields.
	(struct tui_data_info): Remove regs_display_type field.
	* tui/tui-data.c (layout_def): Don't initialise removed fields.
	(tui_clear_win_detail): Don't initialise removed fields of
	win_info.
---
 gdb/ChangeLog        |  31 +++++++
 gdb/tui/tui-data.c   |  10 +-
 gdb/tui/tui-data.h   |  23 -----
 gdb/tui/tui-layout.c | 251 +++++++++++++++++++--------------------------------
 gdb/tui/tui-layout.h |   3 +-
 gdb/tui/tui.c        |   8 +-
 6 files changed, 127 insertions(+), 199 deletions(-)
  

Comments

Pedro Alves May 21, 2015, 8:42 a.m. UTC | #1
On 05/21/2015 12:17 AM, Andrew Burgess wrote:
> 
> Second there is already the command 'tui reg GROUP' command to set the
> displayed register set to GROUP, so making the layout command also
> control the register set feels like unnecessary overloading of the
> layout command.

(A tangent: I was playing with this a bit now, and found it quite odd
that there's a "tui reg next" command here, but
no "tui reg previous"...)

Thanks,
Pedro Alves
  
Andrew Burgess May 21, 2015, 11:33 a.m. UTC | #2
* Pedro Alves <palves@redhat.com> [2015-05-21 09:42:17 +0100]:

> On 05/21/2015 12:17 AM, Andrew Burgess wrote:
> > 
> > Second there is already the command 'tui reg GROUP' command to set the
> > displayed register set to GROUP, so making the layout command also
> > control the register set feels like unnecessary overloading of the
> > layout command.
> 
> (A tangent: I was playing with this a bit now, and found it quite odd
> that there's a "tui reg next" command here, but
> no "tui reg previous"...)

Indeed, this is on my list of things to look at next (unless you're
already fixing it).

You'll also notice, at least on x86-64 that if you use 'tui reg next'
you get access to more register sets that are offered in the
tab-completion mechanism.  This too is something I plan to address in
the next series.

Thanks,
Andrew
  
Pedro Alves May 21, 2015, 11:34 a.m. UTC | #3
On 05/21/2015 12:33 PM, Andrew Burgess wrote:
> * Pedro Alves <palves@redhat.com> [2015-05-21 09:42:17 +0100]:
> 
>> On 05/21/2015 12:17 AM, Andrew Burgess wrote:
>>>
>>> Second there is already the command 'tui reg GROUP' command to set the
>>> displayed register set to GROUP, so making the layout command also
>>> control the register set feels like unnecessary overloading of the
>>> layout command.
>>
>> (A tangent: I was playing with this a bit now, and found it quite odd
>> that there's a "tui reg next" command here, but
>> no "tui reg previous"...)
> 
> Indeed, this is on my list of things to look at next (unless you're
> already fixing it).

I'm not fixing it.

> You'll also notice, at least on x86-64 that if you use 'tui reg next'
> you get access to more register sets that are offered in the
> tab-completion mechanism.  This too is something I plan to address in
> the next series.

Sounds all great, thanks!
  

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 28d6b71..40c70e7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,34 @@ 
+2015-05-20  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+	* tui/tui-layout.c (tui_set_layout): Remove
+	tui_register_display_type parameter.  Remove all checking of this
+	parameter, and reindent function.  Update header comment.
+	(tui_set_layout_for_display_command): Don't check for different
+	register class types, don't pass a tui_register_display_type to
+	tui_set_layout.
+	(layout_names): Remove register set specific names.
+	* tui/tui-layout.h (tui_set_layout): Remove
+	tui_register_display_type parameter.
+	* tui/tui.c (tui_rl_change_windows): Don't pass a
+	tui_register_display_type to tui_set_layout.
+	(tui_rl_delete_other_windows): Likewise.
+	(tui_enable): Likewise.
+	* tui/tui-data.h (TUI_FLOAT_REGS_NAME): Remove.
+	(TUI_FLOAT_REGS_NAME_LOWER): Remove.
+	(TUI_GENERAL_REGS_NAME): Remove.
+	(TUI_GENERAL_REGS_NAME_LOWER): Remove.
+	(TUI_SPECIAL_REGS_NAME): Remove.
+	(TUI_SPECIAL_REGS_NAME_LOWER): Remove.
+	(TUI_GENERAL_SPECIAL_REGS_NAME): Remove.
+	(TUI_GENERAL_SPECIAL_REGS_NAME_LOWER): Remove.
+	(enum tui_register_display_type): Remove.
+	(struct tui_layout_def): Remove regs_display_type and
+	float_regs_display_type fields.
+	(struct tui_data_info): Remove regs_display_type field.
+	* tui/tui-data.c (layout_def): Don't initialise removed fields.
+	(tui_clear_win_detail): Don't initialise removed fields of
+	win_info.
+
 2015-05-20  Joel Brobecker  <brobecker@adacore.com>
 
 	* infrun.c (handle_inferior_event_1): Renames handle_inferior_event.
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index ffd80d5..ed42c8d 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -44,9 +44,7 @@  static int default_tab_len = DEFAULT_TAB_LEN;
 static struct tui_win_info *win_with_focus = (struct tui_win_info *) NULL;
 static struct tui_layout_def layout_def = {
   SRC_WIN,			/* DISPLAY_MODE */
-  FALSE,			/* SPLIT */
-  TUI_UNDEFINED_REGS,		/* REGS_DISPLAY_TYPE */
-  TUI_SFLOAT_REGS};		/* FLOAT_REGS_DISPLAY_TYPE */
+  FALSE};			/* SPLIT */
 
 static int win_resized = FALSE;
 
@@ -224,8 +222,6 @@  tui_clear_win_detail (struct tui_win_info *win_info)
 	  win_info->detail.data_display_info.regs_content =
 	    (tui_win_content) NULL;
 	  win_info->detail.data_display_info.regs_content_count = 0;
-	  win_info->detail.data_display_info.regs_display_type =
-	    TUI_UNDEFINED_REGS;
 	  win_info->detail.data_display_info.regs_column_count = 1;
 	  win_info->detail.data_display_info.display_regs = FALSE;
 	  break;
@@ -544,8 +540,6 @@  init_win_info (struct tui_win_info *win_info)
       win_info->detail.data_display_info.data_content_count = 0;
       win_info->detail.data_display_info.regs_content = (tui_win_content) NULL;
       win_info->detail.data_display_info.regs_content_count = 0;
-      win_info->detail.data_display_info.regs_display_type =
-	TUI_UNDEFINED_REGS;
       win_info->detail.data_display_info.regs_column_count = 1;
       win_info->detail.data_display_info.display_regs = FALSE;
       win_info->detail.data_display_info.current_group = 0;
@@ -745,8 +739,6 @@  tui_free_window (struct tui_win_info *win_info)
 	  win_info->detail.data_display_info.data_content =
 	    (tui_win_content) NULL;
 	  win_info->detail.data_display_info.data_content_count = 0;
-	  win_info->detail.data_display_info.regs_display_type =
-	    TUI_UNDEFINED_REGS;
 	  win_info->detail.data_display_info.regs_column_count = 1;
 	  win_info->detail.data_display_info.display_regs = FALSE;
 	  win_info->generic.content = NULL;
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 7651efd..05263e3 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -92,15 +92,6 @@  struct tui_gen_win_info
 #define MAX_TARGET_WIDTH  10
 #define MAX_PID_WIDTH     19
 
-#define TUI_FLOAT_REGS_NAME                  "$FREGS"
-#define TUI_FLOAT_REGS_NAME_LOWER            "$fregs"
-#define TUI_GENERAL_REGS_NAME                "$GREGS"
-#define TUI_GENERAL_REGS_NAME_LOWER          "$gregs"
-#define TUI_SPECIAL_REGS_NAME                "$SREGS"
-#define TUI_SPECIAL_REGS_NAME_LOWER          "$sregs"
-#define TUI_GENERAL_SPECIAL_REGS_NAME        "$REGS"
-#define TUI_GENERAL_SPECIAL_REGS_NAME_LOWER  "$regs"
-
 /* Scroll direction enum.  */
 enum tui_scroll_direction
 {
@@ -139,17 +130,6 @@  enum tui_data_type
   TUI_STRUCT
 };
 
-/* Types of register displays.  */
-enum tui_register_display_type
-{
-  TUI_UNDEFINED_REGS,
-  TUI_GENERAL_REGS,
-  TUI_SFLOAT_REGS,
-  TUI_DFLOAT_REGS,
-  TUI_SPECIAL_REGS,
-  TUI_GENERAL_AND_SPECIAL_REGS
-};
-
 enum tui_line_or_address_kind
 {
   LOA_LINE,
@@ -172,8 +152,6 @@  struct tui_layout_def
 {
   enum tui_win_type display_mode;
   int split;
-  enum tui_register_display_type regs_display_type;
-  enum tui_register_display_type float_regs_display_type;
 };
 
 /* Elements in the Source/Disassembly Window.  */
@@ -263,7 +241,6 @@  struct tui_data_info
   int data_content_count;
   tui_win_content regs_content;	/* Start of regs display content.  */
   int regs_content_count;
-  enum tui_register_display_type regs_display_type;
   int regs_column_count;
   int display_regs;		/* Should regs be displayed at all?  */
   struct reggroup *current_group;
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 4c25d43..44aca5d 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -122,18 +122,13 @@  show_layout (enum tui_layout_type layout)
 
 
 /* Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
-   SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND.
-   If the layout is SRC_DATA_COMMAND, DISASSEM_DATA_COMMAND, or
-   UNDEFINED_LAYOUT, then the data window is populated according to
-   regs_display_type.  */
+   SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND.  */
 enum tui_status
-tui_set_layout (enum tui_layout_type layout_type,
-		enum tui_register_display_type regs_display_type)
+tui_set_layout (enum tui_layout_type layout_type)
 {
   enum tui_status status = TUI_SUCCESS;
 
-  if (layout_type != UNDEFINED_LAYOUT 
-      || regs_display_type != TUI_UNDEFINED_REGS)
+  if (layout_type != UNDEFINED_LAYOUT)
     {
       enum tui_layout_type cur_layout = tui_current_layout (),
 	new_layout = UNDEFINED_LAYOUT;
@@ -145,113 +140,98 @@  tui_set_layout (enum tui_layout_type layout_type,
 
       extract_display_start_addr (&gdbarch, &addr);
 
-      if (layout_type == UNDEFINED_LAYOUT
-	  && regs_display_type != TUI_UNDEFINED_REGS)
-	{
-	  if (cur_layout == SRC_DISASSEM_COMMAND)
-	    new_layout = DISASSEM_DATA_COMMAND;
-	  else if (cur_layout == SRC_COMMAND 
-		   || cur_layout == SRC_DATA_COMMAND)
-	    new_layout = SRC_DATA_COMMAND;
-	  else if (cur_layout == DISASSEM_COMMAND 
-		   || cur_layout == DISASSEM_DATA_COMMAND)
-	    new_layout = DISASSEM_DATA_COMMAND;
-	}
-      else
-	new_layout = layout_type;
+      new_layout = layout_type;
 
-      regs_populate = (new_layout == SRC_DATA_COMMAND 
-		       || new_layout == DISASSEM_DATA_COMMAND 
-		       || regs_display_type != TUI_UNDEFINED_REGS);
-      if (new_layout != cur_layout
-	  || regs_display_type != TUI_UNDEFINED_REGS)
+      regs_populate = (new_layout == SRC_DATA_COMMAND
+		       || new_layout == DISASSEM_DATA_COMMAND);
+      if (new_layout != cur_layout)
 	{
-	  if (new_layout != cur_layout)
-	    {
-	      show_layout (new_layout);
+	  show_layout (new_layout);
 
-	      /* Now determine where focus should be.  */
-	      if (win_with_focus != TUI_CMD_WIN)
+	  /* Now determine where focus should be.  */
+	  if (win_with_focus != TUI_CMD_WIN)
+	    {
+	      switch (new_layout)
 		{
-		  switch (new_layout)
-		    {
-		    case SRC_COMMAND:
-		      tui_set_win_focus_to (TUI_SRC_WIN);
-		      layout_def->display_mode = SRC_WIN;
-		      layout_def->split = FALSE;
-		      break;
-		    case DISASSEM_COMMAND:
-		      /* The previous layout was not showing code.
-		         This can happen if there is no source
-		         available:
-
-		         1. if the source file is in another dir OR
-		         2. if target was compiled without -g
-		         We still want to show the assembly though!  */
-
-		      tui_get_begin_asm_address (&gdbarch, &addr);
-		      tui_set_win_focus_to (TUI_DISASM_WIN);
-		      layout_def->display_mode = DISASSEM_WIN;
-		      layout_def->split = FALSE;
-		      break;
-		    case SRC_DISASSEM_COMMAND:
-		      /* The previous layout was not showing code.
-		         This can happen if there is no source
-		         available:
-
-		         1. if the source file is in another dir OR
-		         2. if target was compiled without -g
-		         We still want to show the assembly though!  */
-
-		      tui_get_begin_asm_address (&gdbarch, &addr);
-		      if (win_with_focus == TUI_SRC_WIN)
-			tui_set_win_focus_to (TUI_SRC_WIN);
-		      else
-			tui_set_win_focus_to (TUI_DISASM_WIN);
-		      layout_def->split = TRUE;
-		      break;
-		    case SRC_DATA_COMMAND:
-		      if (win_with_focus != TUI_DATA_WIN)
-			tui_set_win_focus_to (TUI_SRC_WIN);
-		      else
-			tui_set_win_focus_to (TUI_DATA_WIN);
-		      layout_def->display_mode = SRC_WIN;
-		      layout_def->split = FALSE;
-		      break;
-		    case DISASSEM_DATA_COMMAND:
-		      /* The previous layout was not showing code.
-		         This can happen if there is no source
-		         available:
-
-			 1. if the source file is in another dir OR
-		         2. if target was compiled without -g
-		         We still want to show the assembly though!  */
-
-		      tui_get_begin_asm_address (&gdbarch, &addr);
-		      if (win_with_focus != TUI_DATA_WIN)
-			tui_set_win_focus_to (TUI_DISASM_WIN);
-		      else
-			tui_set_win_focus_to (TUI_DATA_WIN);
-		      layout_def->display_mode = DISASSEM_WIN;
-		      layout_def->split = FALSE;
-		      break;
-		    default:
-		      break;
-		    }
+		case SRC_COMMAND:
+		  tui_set_win_focus_to (TUI_SRC_WIN);
+		  layout_def->display_mode = SRC_WIN;
+		  layout_def->split = FALSE;
+		  break;
+		case DISASSEM_COMMAND:
+		  /* The previous layout was not showing code.
+		     This can happen if there is no source
+		     available:
+
+		     1. if the source file is in another dir OR
+		     2. if target was compiled without -g
+		     We still want to show the assembly though!  */
+
+		  tui_get_begin_asm_address (&gdbarch, &addr);
+		  tui_set_win_focus_to (TUI_DISASM_WIN);
+		  layout_def->display_mode = DISASSEM_WIN;
+		  layout_def->split = FALSE;
+		  break;
+		case SRC_DISASSEM_COMMAND:
+		  /* The previous layout was not showing code.
+		     This can happen if there is no source
+		     available:
+
+		     1. if the source file is in another dir OR
+		     2. if target was compiled without -g
+		     We still want to show the assembly though!  */
+
+		  tui_get_begin_asm_address (&gdbarch, &addr);
+		  if (win_with_focus == TUI_SRC_WIN)
+		    tui_set_win_focus_to (TUI_SRC_WIN);
+		  else
+		    tui_set_win_focus_to (TUI_DISASM_WIN);
+		  layout_def->split = TRUE;
+		  break;
+		case SRC_DATA_COMMAND:
+		  if (win_with_focus != TUI_DATA_WIN)
+		    tui_set_win_focus_to (TUI_SRC_WIN);
+		  else
+		    tui_set_win_focus_to (TUI_DATA_WIN);
+		  layout_def->display_mode = SRC_WIN;
+		  layout_def->split = FALSE;
+		  break;
+		case DISASSEM_DATA_COMMAND:
+		  /* The previous layout was not showing code.
+		     This can happen if there is no source
+		     available:
+
+		     1. if the source file is in another dir OR
+		     2. if target was compiled without -g
+		     We still want to show the assembly though!  */
+
+		  tui_get_begin_asm_address (&gdbarch, &addr);
+		  if (win_with_focus != TUI_DATA_WIN)
+		    tui_set_win_focus_to (TUI_DISASM_WIN);
+		  else
+		    tui_set_win_focus_to (TUI_DATA_WIN);
+		  layout_def->display_mode = DISASSEM_WIN;
+		  layout_def->split = FALSE;
+		  break;
+		default:
+		  break;
 		}
-	      /*
-	       * Now update the window content.
-	       */
-	      if (!regs_populate 
-		  && (new_layout == SRC_DATA_COMMAND 
-		      || new_layout == DISASSEM_DATA_COMMAND))
-		tui_display_all_data ();
-
-	      tui_update_source_windows_with_addr (gdbarch, addr);
 	    }
+	  /*
+	   * Now update the window content.
+	   */
+	  if (!regs_populate
+	      && (new_layout == SRC_DATA_COMMAND
+		  || new_layout == DISASSEM_DATA_COMMAND))
+	    tui_display_all_data ();
+
+	  tui_update_source_windows_with_addr (gdbarch, addr);
+
 	  if (regs_populate)
 	    {
-              tui_show_registers (TUI_DATA_WIN->detail.data_display_info.current_group);
+	      struct reggroup *group =
+		TUI_DATA_WIN->detail.data_display_info.current_group;
+	      tui_show_registers (group);
 	    }
 	}
     }
@@ -370,7 +350,6 @@  tui_default_win_viewport_height (enum tui_win_type type,
   return h;
 }
 
-
 /* Function to initialize gdb commands, for tui window layout
    manipulation.  */
 
@@ -413,7 +392,6 @@  tui_set_layout_for_display_command (const char *layout_name)
       int i;
       char *buf_ptr;
       enum tui_layout_type new_layout = UNDEFINED_LAYOUT;
-      enum tui_register_display_type dpy_type = TUI_UNDEFINED_REGS;
       enum tui_layout_type cur_layout = tui_current_layout ();
 
       buf_ptr = (char *) xstrdup (layout_name);
@@ -421,8 +399,7 @@  tui_set_layout_for_display_command (const char *layout_name)
 	buf_ptr[i] = toupper (buf_ptr[i]);
 
       /* First check for ambiguous input.  */
-      if (strlen (buf_ptr) <= 1 
-	  && (*buf_ptr == 'S' || *buf_ptr == '$'))
+      if (strlen (buf_ptr) <= 1 && *buf_ptr == 'S')
 	{
 	  warning (_("Ambiguous command input."));
 	  status = TUI_FAILURE;
@@ -435,59 +412,13 @@  tui_set_layout_for_display_command (const char *layout_name)
 	    new_layout = DISASSEM_COMMAND;
 	  else if (subset_compare (buf_ptr, "SPLIT"))
 	    new_layout = SRC_DISASSEM_COMMAND;
-	  else if (subset_compare (buf_ptr, "REGS") 
-		   || subset_compare (buf_ptr, TUI_GENERAL_SPECIAL_REGS_NAME)
-		   || subset_compare (buf_ptr, TUI_GENERAL_REGS_NAME)
-		   || subset_compare (buf_ptr, TUI_FLOAT_REGS_NAME)
-		   || subset_compare (buf_ptr, TUI_SPECIAL_REGS_NAME))
+	  else if (subset_compare (buf_ptr, "REGS"))
 	    {
-	      if (cur_layout == SRC_COMMAND 
+	      if (cur_layout == SRC_COMMAND
 		  || cur_layout == SRC_DATA_COMMAND)
 		new_layout = SRC_DATA_COMMAND;
 	      else
 		new_layout = DISASSEM_DATA_COMMAND;
-
-	      /* Could ifdef out the following code. when compile with
-		 -z, there are null pointer references that cause a
-		 core dump if 'layout regs' is the first layout
-		 command issued by the user. HP has asked us to hook
-		 up this code.  - edie epstein  */
-	      if (subset_compare (buf_ptr, TUI_FLOAT_REGS_NAME))
-		{
-		  if (TUI_DATA_WIN->detail.data_display_info.regs_display_type
-		      != TUI_SFLOAT_REGS
-		      && TUI_DATA_WIN->detail.data_display_info.regs_display_type
-		      != TUI_DFLOAT_REGS)
-		    dpy_type = TUI_SFLOAT_REGS;
-		  else
-		    dpy_type =
-		      TUI_DATA_WIN->detail.data_display_info.regs_display_type;
-		}
-	      else if (subset_compare (buf_ptr,
-				      TUI_GENERAL_SPECIAL_REGS_NAME))
-		dpy_type = TUI_GENERAL_AND_SPECIAL_REGS;
-	      else if (subset_compare (buf_ptr, TUI_GENERAL_REGS_NAME))
-		dpy_type = TUI_GENERAL_REGS;
-	      else if (subset_compare (buf_ptr, TUI_SPECIAL_REGS_NAME))
-		dpy_type = TUI_SPECIAL_REGS;
-	      else if (TUI_DATA_WIN)
-		{
-		  if (TUI_DATA_WIN->detail.data_display_info.regs_display_type
-		      != TUI_UNDEFINED_REGS)
-		    dpy_type
-		      = TUI_DATA_WIN->detail.data_display_info.regs_display_type;
-		  else
-		    dpy_type = TUI_GENERAL_REGS;
-		}
-
-	      /* End of potential ifdef.
-	       */
-
-	      /* If ifdefed out code above, then assume that the user
-		 wishes to display the general purpose registers .
-	      */
-
-	      /* dpy_type = TUI_GENERAL_REGS; */
 	    }
 	  else if (subset_compare (buf_ptr, "NEXT"))
 	    new_layout = next_layout ();
@@ -496,7 +427,7 @@  tui_set_layout_for_display_command (const char *layout_name)
 	  else
 	    status = TUI_FAILURE;
 
-	  tui_set_layout (new_layout, dpy_type);
+	  tui_set_layout (new_layout);
 	}
       xfree (buf_ptr);
     }
diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h
index 6dedb7d..623d254 100644
--- a/gdb/tui/tui-layout.h
+++ b/gdb/tui/tui-layout.h
@@ -30,7 +30,6 @@  extern int tui_default_win_height (enum tui_win_type,
 				   enum tui_layout_type);
 extern int tui_default_win_viewport_height (enum tui_win_type,
 					    enum tui_layout_type);
-extern enum tui_status tui_set_layout (enum tui_layout_type,
-				       enum tui_register_display_type);
+extern enum tui_status tui_set_layout (enum tui_layout_type);
 
 #endif /*TUI_LAYOUT_H */
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index b04e106..308e7ae 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -150,7 +150,6 @@  tui_rl_change_windows (int notused1, int notused2)
   if (tui_active)
     {
       enum tui_layout_type new_layout;
-      enum tui_register_display_type regs_type = TUI_UNDEFINED_REGS;
 
       new_layout = tui_current_layout ();
 
@@ -182,7 +181,7 @@  tui_rl_change_windows (int notused1, int notused2)
 	  new_layout = SRC_COMMAND;
 	  break;
 	}
-      tui_set_layout (new_layout, regs_type);
+      tui_set_layout (new_layout);
     }
   return 0;
 }
@@ -198,7 +197,6 @@  tui_rl_delete_other_windows (int notused1, int notused2)
   if (tui_active)
     {
       enum tui_layout_type new_layout;
-      enum tui_register_display_type regs_type = TUI_UNDEFINED_REGS;
 
       new_layout = tui_current_layout ();
 
@@ -217,7 +215,7 @@  tui_rl_delete_other_windows (int notused1, int notused2)
 	  new_layout = DISASSEM_COMMAND;
 	  break;
 	}
-      tui_set_layout (new_layout, regs_type);
+      tui_set_layout (new_layout);
     }
   return 0;
 }
@@ -464,7 +462,7 @@  tui_enable (void)
       def_prog_mode ();
 
       tui_show_frame_info (0);
-      tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS);
+      tui_set_layout (SRC_COMMAND);
       tui_set_win_focus_to (TUI_SRC_WIN);
       keypad (TUI_CMD_WIN->generic.handle, TRUE);
       wrefresh (TUI_CMD_WIN->generic.handle);