summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-01-23 23:25:17 +0000
committerAndrew Cagney <cagney@redhat.com>2004-01-23 23:25:17 +0000
commitbf58351d83131ac210616aa1882f53cd9b06aed1 (patch)
tree824dd068f4ebfc9672548ab975dc32f9305949b4
parent53cf90a5bf51590119c2e7a562ab231f4f4b7b36 (diff)
downloadgdb-bf58351d83131ac210616aa1882f53cd9b06aed1.tar.gz
2004-01-23 Andrew Cagney <cagney@redhat.com>
* printcmd.c (display_command): Replace tui_set_display call with tui_set_layout_for_display_command. * tui/tui.h (enum tui_win_type): Define. (tui_set_layout): Delete declaration. (tui_set_layout_for_display_command): Rename set_tui_layout. * tui/tui-data.h (enum tui_layout_type): Define. * tui/tui-layout.h: Update copyright. Include "tui-data.h" and "tui.h". (tui_add_win_to_layout): Rename tuiAddWinToLayout. (tui_default_win_height): Rename tuiDefaultWinHeight. (tui_default_win_viewport_height): Rename tuiDefaultWinViewportHeight. (tui_set_layout): RenametuiSetLayout. * tui/tui-layout.c: Update references. * tui/tui.c: Update references. * tui/tui-disasm.c: Update references.
-rw-r--r--gdb/ChangeLog19
-rw-r--r--gdb/printcmd.c2
-rw-r--r--gdb/tui/tui-data.h2
-rw-r--r--gdb/tui/tui-disasm.c4
-rw-r--r--gdb/tui/tui-layout.c54
-rw-r--r--gdb/tui/tui-layout.h18
-rw-r--r--gdb/tui/tui.c10
-rw-r--r--gdb/tui/tui.h4
8 files changed, 66 insertions, 47 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fb8f036908b..44746f02584 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,22 @@
+2004-01-23 Andrew Cagney <cagney@redhat.com>
+
+ * printcmd.c (display_command): Replace tui_set_display call with
+ tui_set_layout_for_display_command.
+ * tui/tui.h (enum tui_win_type): Define.
+ (tui_set_layout): Delete declaration.
+ (tui_set_layout_for_display_command): Rename set_tui_layout.
+ * tui/tui-data.h (enum tui_layout_type): Define.
+ * tui/tui-layout.h: Update copyright. Include "tui-data.h" and
+ "tui.h".
+ (tui_add_win_to_layout): Rename tuiAddWinToLayout.
+ (tui_default_win_height): Rename tuiDefaultWinHeight.
+ (tui_default_win_viewport_height): Rename
+ tuiDefaultWinViewportHeight.
+ (tui_set_layout): RenametuiSetLayout.
+ * tui/tui-layout.c: Update references.
+ * tui/tui.c: Update references.
+ * tui/tui-disasm.c: Update references.
+
2004-01-23 David Carlton <carlton@kealia.com>
Partial workaround for PR c++/1511:
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 3c7ad4191d2..0502cf1cb24 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1356,7 +1356,7 @@ display_command (char *exp, int from_tty)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
if (tui_active && *exp == '$')
- display_it = (tui_set_layout (exp) == TUI_FAILURE);
+ display_it = (tui_set_layout_for_display_command (exp) == TUI_FAILURE);
#endif
if (display_it)
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index ea7c7860a77..6657fcdbda1 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -116,7 +116,7 @@ TuiList, *TuiListPtr;
/* The kinds of layouts available */
-typedef enum
+typedef enum tui_layout_type
{
SRC_COMMAND,
DISASSEM_COMMAND,
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 99143a4ed64..493c00ded68 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -279,7 +279,7 @@ tui_show_disassem (CORE_ADDR startAddr)
TuiLineOrAddress val;
val.addr = startAddr;
- tuiAddWinToLayout (DISASSEM_WIN);
+ tui_add_win_to_layout (DISASSEM_WIN);
tuiUpdateSourceWindow (disassemWin, s, val, FALSE);
/*
** if the focus was in the src win, put it in the asm win, if the
@@ -364,7 +364,7 @@ tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
/* Determine where to start the disassembly so that the pc is about in the
middle of the viewport. */
- pos = tuiDefaultWinViewportHeight (DISASSEM_WIN, DISASSEM_COMMAND) / 2;
+ pos = tui_default_win_viewport_height (DISASSEM_WIN, DISASSEM_COMMAND) / 2;
pc = tui_find_disassembly_address (pc, -pos);
if (pc < low)
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index e4093c14365..38d8de57a00 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -128,17 +128,14 @@ showLayout (TuiLayoutType layout)
}
-/*
- ** tuiSetLayout()
- ** 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 regsDisplayType.
- */
-TuiStatus
-tuiSetLayout (TuiLayoutType layoutType,
- TuiRegisterDisplayType regsDisplayType)
+/* 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
+ regsDisplayType. */
+enum tui_status
+tui_set_layout (enum tui_layout_type layoutType,
+ enum tui_register_display_type regsDisplayType)
{
TuiStatus status = TUI_SUCCESS;
@@ -268,14 +265,11 @@ tuiSetLayout (TuiLayoutType layoutType,
return status;
}
-/*
- ** tuiAddWinToLayout().
- ** Add the specified window to the layout in a logical way.
- ** This means setting up the most logical layout given the
- ** window to be added.
- */
+/* Add the specified window to the layout in a logical way. This
+ means setting up the most logical layout given the window to be
+ added. */
void
-tuiAddWinToLayout (TuiWinType type)
+tui_add_win_to_layout (enum tui_win_type type)
{
TuiLayoutType curLayout = currentLayout ();
@@ -365,14 +359,12 @@ tuiDefaultWinHeight (TuiWinType type, TuiLayoutType layout)
} /* tuiDefaultWinHeight */
-/*
- ** tuiDefaultWinViewportHeight().
- ** Answer the height of a window. If it hasn't been created yet,
- ** answer what the height of a window would be based upon its
- ** type and the layout.
- */
+/* Answer the height of a window. If it hasn't been created yet,
+ answer what the height of a window would be based upon its type and
+ the layout. */
int
-tuiDefaultWinViewportHeight (TuiWinType type, TuiLayoutType layout)
+tui_default_win_viewport_height (enum tui_win_type type,
+ enum tui_layout_type layout)
{
int h;
@@ -430,7 +422,7 @@ Source/Disassembly/Command layouts.\n");
** $REGS, $GREGS, $FREGS, $SREGS.
*/
TuiStatus
-tui_set_layout (const char *layoutName)
+tui_set_layout_for_display_command (const char *layoutName)
{
TuiStatus status = TUI_SUCCESS;
@@ -522,7 +514,7 @@ tui_set_layout (const char *layoutName)
status = TUI_FAILURE;
xfree (bufPtr);
- tuiSetLayout (newLayout, dpyType);
+ tui_set_layout (newLayout, dpyType);
}
}
else
@@ -568,15 +560,15 @@ _tuiHandleXDBLayout (TuiLayoutDefPtr layoutDef)
{
if (layoutDef->split)
{
- tuiSetLayout (SRC_DISASSEM_COMMAND, TUI_UNDEFINED_REGS);
+ tui_set_layout (SRC_DISASSEM_COMMAND, TUI_UNDEFINED_REGS);
tuiSetWinFocusTo (winList[layoutDef->displayMode]);
}
else
{
if (layoutDef->displayMode == SRC_WIN)
- tuiSetLayout (SRC_COMMAND, TUI_UNDEFINED_REGS);
+ tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS);
else
- tuiSetLayout (DISASSEM_DATA_COMMAND, layoutDef->regsDisplayType);
+ tui_set_layout (DISASSEM_DATA_COMMAND, layoutDef->regsDisplayType);
}
@@ -622,7 +614,7 @@ _tuiLayout_command (char *arg, int fromTTY)
tui_enable ();
/* Switch to the selected layout. */
- if (tui_set_layout (arg) != TUI_SUCCESS)
+ if (tui_set_layout_for_display_command (arg) != TUI_SUCCESS)
warning ("Invalid layout specified.\n%s", LAYOUT_USAGE);
}
diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h
index f6b0ed79c68..5df1f0be9f1 100644
--- a/gdb/tui/tui-layout.h
+++ b/gdb/tui/tui-layout.h
@@ -1,5 +1,8 @@
/* TUI layout window management.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2002, 2004 Free Software
+ Foundation, Inc.
+
Contributed by Hewlett-Packard Company.
This file is part of GDB.
@@ -22,9 +25,14 @@
#ifndef TUI_LAYOUT_H
#define TUI_LAYOUT_H
-extern void tuiAddWinToLayout (TuiWinType);
-extern int tuiDefaultWinHeight (TuiWinType, TuiLayoutType);
-extern int tuiDefaultWinViewportHeight (TuiWinType, TuiLayoutType);
-extern TuiStatus tuiSetLayout (TuiLayoutType, TuiRegisterDisplayType);
+#include "tui/tui.h"
+#include "tui/tui-data.h"
+
+extern void tui_add_win_to_layout (enum tui_win_type);
+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);
#endif /*TUI_LAYOUT_H */
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 5b9cff0e8c8..74fd7ae51ea 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -170,7 +170,7 @@ tui_rl_change_windows (int notused1, int notused2)
new_layout = SRC_COMMAND;
break;
}
- tuiSetLayout (new_layout, regs_type);
+ tui_set_layout (new_layout, regs_type);
}
return 0;
}
@@ -205,7 +205,7 @@ tui_rl_delete_other_windows (int notused1, int notused2)
new_layout = DISASSEM_COMMAND;
break;
}
- tuiSetLayout (new_layout, regs_type);
+ tui_set_layout (new_layout, regs_type);
}
return 0;
}
@@ -389,7 +389,7 @@ tui_enable (void)
def_prog_mode ();
tuiShowFrameInfo (0);
- tuiSetLayout (SRC_COMMAND, TUI_UNDEFINED_REGS);
+ tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS);
tuiSetWinFocusTo (srcWin);
keypad (cmdWin->generic.handle, TRUE);
wrefresh (cmdWin->generic.handle);
@@ -563,7 +563,7 @@ tui_show_source (const char *file, int line)
{
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
/* make sure that the source window is displayed */
- tuiAddWinToLayout (SRC_WIN);
+ tui_add_win_to_layout (SRC_WIN);
tuiUpdateSourceWindowsWithLine (cursal.symtab, line);
tuiUpdateLocatorFilename (file);
@@ -572,7 +572,7 @@ tui_show_source (const char *file, int line)
void
tui_show_assembly (CORE_ADDR addr)
{
- tuiAddWinToLayout (DISASSEM_WIN);
+ tui_add_win_to_layout (DISASSEM_WIN);
tuiUpdateSourceWindowsWithAddr (addr);
}
diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h
index 03d036da6cc..1aba29e8bd7 100644
--- a/gdb/tui/tui.h
+++ b/gdb/tui/tui.h
@@ -64,7 +64,7 @@ extern void strcat_to_buf (char *, int, const char *);
TuiStatus, *TuiStatusPtr;
/* Types of windows */
- typedef enum
+typedef enum tui_win_type
{
SRC_WIN = 0,
DISASSEM_WIN,
@@ -138,7 +138,7 @@ extern void tui_show_source (const char *file, int line);
extern struct ui_out *tui_out_new (struct ui_file *stream);
/* tuiLayout.c */
-extern TuiStatus tui_set_layout (const char *);
+extern enum tui_status tui_set_layout_for_display_command (const char *name);
/* tuiSourceWin.c */
extern void tuiUpdateAllExecInfos (void);