This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit/tui] Cleanup tui.h
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 07 Feb 2004 12:46:14 -0500
- Subject: [commit/tui] Cleanup tui.h
(as part of this tuiFree is deleted), committed,
Andrew
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h (Opaque, OpaquePtr OpaqueList): Delete definition.
(TuiPoint, TuiPointPtr): Ditto.
(TuiStatus, TuiStatusPtr): Ditto.
(TuiWinType, TuiWinTypePtr): Ditto.
(struct tui_point): Rename _TuiPoint.
(tui_get_low_disassembly_address): Rename
tuiGetLowDisassemblyAddress.
(tui_update_all_exec_infos): Rename tuiUpdateAllExecInfos.
(tuiFree): Delete declaration.
(OpaqueFuncPtr, TuiOpaqueFuncPtr): Delete definitions.
(TuiVoidFuncPtr, TuiIntFuncPtr): Delete definitions.
* tui/tui.c (tuiFree): Delete function.
* cli/cli-cmds.c (disassemble_command): Update references.
* tui/tui-data.c, tui/tui-data.h, tui/tui-disasm.c: Ditto.
* tui/tui-layout.c, tui/tui-regs.c, tui/tui-source.c: Ditto.
* tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c: Ditto.
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.40
diff -u -r1.40 cli-cmds.c
--- cli/cli-cmds.c 1 Feb 2004 05:49:28 -0000 1.40
+++ cli/cli-cmds.c 7 Feb 2004 17:43:11 -0000
@@ -850,8 +850,9 @@
#if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
- else if (tui_active)
- low = tuiGetLowDisassemblyAddress (low, pc);
+ if (tui_active)
+ /* FIXME: cagney/2004-02-07: This should be an observer. */
+ low = tui_get_low_disassembly_address (low, pc);
#endif
low += FUNCTION_START_OFFSET;
}
@@ -864,8 +865,9 @@
#if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
- else if (tui_active)
- low = tuiGetLowDisassemblyAddress (low, pc);
+ if (tui_active)
+ /* FIXME: cagney/2004-02-07: This should be an observer. */
+ low = tui_get_low_disassembly_address (low, pc);
#endif
low += FUNCTION_START_OFFSET;
}
Index: tui/tui-data.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-data.c,v
retrieving revision 1.4
diff -u -r1.4 tui-data.c
--- tui/tui-data.c 7 Feb 2004 16:31:21 -0000 1.4
+++ tui/tui-data.c 7 Feb 2004 17:43:12 -0000
@@ -49,8 +49,7 @@
static struct tui_gen_win_info _locator;
static struct tui_gen_win_info _execInfo[2];
static struct tui_win_info * _srcWinList[2];
-static struct tui_list _sourceWindows =
-{(OpaqueList) _srcWinList, 0};
+static struct tui_list _sourceWindows = {(void **) _srcWinList, 0};
static int _defaultTabLen = DEFAULT_TAB_LEN;
static struct tui_win_info * _winWithFocus = (struct tui_win_info *) NULL;
static struct tui_layout_def _layoutDef =
@@ -64,8 +63,8 @@
/*********************************
** Static function forward decls
**********************************/
-static void freeContent (tui_win_content, int, TuiWinType);
-static void freeContentElements (tui_win_content, int, TuiWinType);
+static void freeContent (tui_win_content, int, enum tui_win_type);
+static void freeContentElements (tui_win_content, int, enum tui_win_type);
@@ -152,8 +151,8 @@
void
tui_clear_source_windows (void)
{
- _sourceWindows.list[0] = (Opaque) NULL;
- _sourceWindows.list[1] = (Opaque) NULL;
+ _sourceWindows.list[0] = NULL;
+ _sourceWindows.list[1] = NULL;
_sourceWindows.count = 0;
}
@@ -176,7 +175,7 @@
tui_add_to_source_windows (struct tui_win_info * winInfo)
{
if (_sourceWindows.count < 2)
- _sourceWindows.list[_sourceWindows.count++] = (Opaque) winInfo;
+ _sourceWindows.list[_sourceWindows.count++] = (void *) winInfo;
}
@@ -321,7 +320,7 @@
struct tui_win_info *
tui_next_win (struct tui_win_info * curWin)
{
- TuiWinType type = curWin->generic.type;
+ enum tui_win_type type = curWin->generic.type;
struct tui_win_info * nextWin = (struct tui_win_info *) NULL;
if (curWin->generic.type == CMD_WIN)
@@ -350,7 +349,7 @@
struct tui_win_info *
tui_prev_win (struct tui_win_info * curWin)
{
- TuiWinType type = curWin->generic.type;
+ enum tui_win_type type = curWin->generic.type;
struct tui_win_info * prev = (struct tui_win_info *) NULL;
if (curWin->generic.type == SRC_WIN)
@@ -469,7 +468,7 @@
win->contentSize =
win->lastVisibleLine = 0;
win->handle = (WINDOW *) NULL;
- win->content = (OpaquePtr) NULL;
+ win->content = NULL;
win->contentInUse =
win->isVisible = FALSE;
win->title = 0;
@@ -480,7 +479,7 @@
** initContentElement().
*/
void
-initContentElement (struct tui_win_element * element, TuiWinType type)
+initContentElement (struct tui_win_element * element, enum tui_win_type type)
{
element->highlight = FALSE;
switch (type)
@@ -496,7 +495,7 @@
tui_init_generic_part (&element->whichElement.dataWindow);
element->whichElement.dataWindow.type = DATA_ITEM_WIN;
((struct tui_gen_win_info *) & element->whichElement.dataWindow)->content =
- (OpaquePtr) tui_alloc_content (1, DATA_ITEM_WIN);
+ (void **) tui_alloc_content (1, DATA_ITEM_WIN);
((struct tui_gen_win_info *)
& element->whichElement.dataWindow)->contentSize = 1;
break;
@@ -507,7 +506,7 @@
element->whichElement.data.name = (char *) NULL;
element->whichElement.data.type = TUI_REGISTER;
element->whichElement.data.itemNo = UNDEFINED_ITEM;
- element->whichElement.data.value = (Opaque) NULL;
+ element->whichElement.data.value = NULL;
element->whichElement.data.highlight = FALSE;
break;
case LOCATOR_WIN:
@@ -560,7 +559,7 @@
winInfo->detail.commandInfo.curch = 0;
break;
default:
- winInfo->detail.opaque = (Opaque) NULL;
+ winInfo->detail.opaque = NULL;
break;
}
@@ -569,7 +568,7 @@
struct tui_win_info *
-tui_alloc_win_info (TuiWinType type)
+tui_alloc_win_info (enum tui_win_type type)
{
struct tui_win_info * winInfo = (struct tui_win_info *) NULL;
@@ -589,7 +588,7 @@
** Allocates the content and elements in a block.
*/
tui_win_content
-tui_alloc_content (int numElements, TuiWinType type)
+tui_alloc_content (int numElements, enum tui_win_type type)
{
tui_win_content content = (tui_win_content) NULL;
char *elementBlockPtr = (char *) NULL;
@@ -616,7 +615,7 @@
}
else
{
- tuiFree ((char *) content);
+ xfree (content);
content = (tui_win_content) NULL;
}
}
@@ -637,21 +636,21 @@
struct tui_win_element * elementPtr;
int i, indexStart;
- if (winInfo->content == (OpaquePtr) NULL)
+ if (winInfo->content == NULL)
{
- winInfo->content = (OpaquePtr) tui_alloc_content (numElements, winInfo->type);
+ winInfo->content = (void **) tui_alloc_content (numElements, winInfo->type);
indexStart = 0;
}
else
indexStart = winInfo->contentSize;
- if (winInfo->content != (OpaquePtr) NULL)
+ if (winInfo->content != NULL)
{
for (i = indexStart; (i < numElements + indexStart); i++)
{
if ((elementPtr = (struct tui_win_element *)
xmalloc (sizeof (struct tui_win_element))) != (struct tui_win_element *) NULL)
{
- winInfo->content[i] = (Opaque) elementPtr;
+ winInfo->content[i] = (void *) elementPtr;
initContentElement (elementPtr, winInfo->type);
winInfo->contentSize++;
}
@@ -696,7 +695,7 @@
}
break;
case DATA_WIN:
- if (winInfo->generic.content != (OpaquePtr) NULL)
+ if (winInfo->generic.content != NULL)
{
tui_del_data_windows (winInfo->detail.dataDisplayInfo.regsContent,
winInfo->detail.dataDisplayInfo.regsContentCount);
@@ -746,7 +745,7 @@
}
break;
case DATA_WIN:
- if (winInfo->generic.content != (OpaquePtr) NULL)
+ if (winInfo->generic.content != NULL)
{
tui_free_data_content (winInfo->detail.dataDisplayInfo.regsContent,
winInfo->detail.dataDisplayInfo.regsContentCount);
@@ -762,7 +761,7 @@
TUI_UNDEFINED_REGS;
winInfo->detail.dataDisplayInfo.regsColumnCount = 1;
winInfo->detail.dataDisplayInfo.displayRegs = FALSE;
- winInfo->generic.content = (OpaquePtr) NULL;
+ winInfo->generic.content = NULL;
winInfo->generic.contentSize = 0;
}
break;
@@ -802,12 +801,12 @@
void
tui_free_win_content (struct tui_gen_win_info * winInfo)
{
- if (winInfo->content != (OpaquePtr) NULL)
+ if (winInfo->content != NULL)
{
freeContent ((tui_win_content) winInfo->content,
winInfo->contentSize,
winInfo->type);
- winInfo->content = (OpaquePtr) NULL;
+ winInfo->content = NULL;
}
winInfo->contentSize = 0;
@@ -875,12 +874,12 @@
** freeContent().
*/
static void
-freeContent (tui_win_content content, int contentSize, TuiWinType winType)
+freeContent (tui_win_content content, int contentSize, enum tui_win_type winType)
{
if (content != (tui_win_content) NULL)
{
freeContentElements (content, contentSize, winType);
- tuiFree ((char *) content);
+ xfree (content);
}
return;
@@ -891,7 +890,7 @@
** freeContentElements().
*/
static void
-freeContentElements (tui_win_content content, int contentSize, TuiWinType type)
+freeContentElements (tui_win_content content, int contentSize, enum tui_win_type type)
{
if (content != (tui_win_content) NULL)
{
@@ -900,8 +899,7 @@
if (type == SRC_WIN || type == DISASSEM_WIN)
{
/* free whole source block */
- if (content[0]->whichElement.source.line != (char *) NULL)
- tuiFree (content[0]->whichElement.source.line);
+ xfree (content[0]->whichElement.source.line);
}
else
{
@@ -915,7 +913,7 @@
switch (type)
{
case DATA_WIN:
- tuiFree ((char *) element);
+ xfree (element);
break;
case DATA_ITEM_WIN:
/*
@@ -923,13 +921,12 @@
** in a single block, but individually, as needed.
*/
if (element->whichElement.data.type != TUI_REGISTER)
- tuiFree ((char *)
- element->whichElement.data.name);
- tuiFree ((char *) element->whichElement.data.value);
- tuiFree ((char *) element);
+ xfree ((void *)element->whichElement.data.name);
+ xfree (element->whichElement.data.value);
+ xfree (element);
break;
case CMD_WIN:
- tuiFree ((char *) element->whichElement.command.line);
+ xfree (element->whichElement.command.line);
break;
default:
break;
@@ -938,7 +935,7 @@
}
}
if (type != DATA_WIN && type != DATA_ITEM_WIN)
- tuiFree ((char *) content[0]); /* free the element block */
+ xfree (content[0]); /* free the element block */
}
return;
Index: tui/tui-data.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-data.h,v
retrieving revision 1.8
diff -u -r1.8 tui-data.h
--- tui/tui-data.h 7 Feb 2004 16:31:22 -0000 1.8
+++ tui/tui-data.h 7 Feb 2004 17:43:13 -0000
@@ -35,11 +35,11 @@
struct tui_gen_win_info
{
WINDOW *handle; /* window handle */
- TuiWinType type; /* type of window */
+ enum tui_win_type type; /* type of window */
int width; /* window width */
int height; /* window height */
- TuiPoint origin; /* origin of window */
- OpaquePtr content; /* content of window */
+ struct tui_point origin; /* origin of window */
+ void **content; /* content of window */
int contentSize; /* Size of content (# of elements) */
int contentInUse; /* Can it be used, or is it already used? */
int viewportHeight; /* viewport height */
@@ -107,7 +107,7 @@
/* General list struct. */
struct tui_list
{
- OpaqueList list;
+ void **list;
int count;
};
@@ -153,7 +153,7 @@
/* Current Layout definition */
struct tui_layout_def
{
- TuiWinType displayMode;
+ enum tui_win_type displayMode;
int split;
enum tui_register_display_type regsDisplayType;
enum tui_register_display_type floatRegsDisplayType;
@@ -175,7 +175,7 @@
const char *name;
int itemNo; /* the register number, or data display number */
enum tui_data_type type;
- Opaque value;
+ void *value;
int highlight;
};
@@ -276,7 +276,7 @@
struct tui_source_info sourceInfo;
struct tui_data_info dataDisplayInfo;
struct tui_command_info commandInfo;
- Opaque opaque;
+ void *opaque;
}
detail;
int canHighlight; /* Can this window ever be highlighted? */
@@ -324,7 +324,7 @@
/* Data Manipulation Functions */
extern void tui_initialize_static_data (void);
extern struct tui_gen_win_info *tui_alloc_generic_win_info (void);
-extern struct tui_win_info *tui_alloc_win_info (TuiWinType);
+extern struct tui_win_info *tui_alloc_win_info (enum tui_win_type);
extern void tui_init_generic_part (struct tui_gen_win_info *);
extern void tui_init_win_info (struct tui_win_info *);
extern tui_win_content tui_alloc_content (int, enum tui_win_type);
Index: tui/tui-disasm.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-disasm.c,v
retrieving revision 1.8
diff -u -r1.8 tui-disasm.c
--- tui/tui-disasm.c 7 Feb 2004 16:31:22 -0000 1.8
+++ tui/tui-disasm.c 7 Feb 2004 17:43:13 -0000
@@ -175,7 +175,7 @@
enum tui_status
tui_set_disassem_content (CORE_ADDR pc)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
register int i;
register int offset = disassemWin->detail.sourceInfo.horizontalOffset;
register int lineWidth, maxLines;
@@ -358,7 +358,7 @@
disassembly window. This may or may not be the same as the
low address input. */
CORE_ADDR
-tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
+tui_get_low_disassembly_address (CORE_ADDR low, CORE_ADDR pc)
{
int pos;
@@ -377,7 +377,7 @@
tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection,
int numToScroll)
{
- if (disassemWin->generic.content != (OpaquePtr) NULL)
+ if (disassemWin->generic.content != NULL)
{
CORE_ADDR pc;
tui_win_content content;
Index: tui/tui-layout.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-layout.c,v
retrieving revision 1.11
diff -u -r1.11 tui-layout.c
--- tui/tui-layout.c 7 Feb 2004 16:31:22 -0000 1.11
+++ tui/tui-layout.c 7 Feb 2004 17:43:14 -0000
@@ -51,10 +51,10 @@
** Static Local Decls
********************************/
static void showLayout (enum tui_layout_type);
-static void _initGenWinInfo (struct tui_gen_win_info *, TuiWinType, int, int, int, int);
-static void _initAndMakeWin (Opaque *, TuiWinType, int, int, int, int, int);
+static void _initGenWinInfo (struct tui_gen_win_info *, enum tui_win_type, int, int, int, int);
+static void _initAndMakeWin (void **, enum tui_win_type, int, int, int, int, int);
static void _showSourceOrDisassemAndCommand (enum tui_layout_type);
-static void _makeSourceOrDisassemWindow (struct tui_win_info * *, TuiWinType, int, int);
+static void _makeSourceOrDisassemWindow (struct tui_win_info * *, enum tui_win_type, int, int);
static void _makeCommandWindow (struct tui_win_info * *, int, int);
static void _makeSourceWindow (struct tui_win_info * *, int, int);
static void _makeDisassemWindow (struct tui_win_info * *, int, int);
@@ -137,7 +137,7 @@
tui_set_layout (enum tui_layout_type layoutType,
enum tui_register_display_type regsDisplayType)
{
- TuiStatus status = TUI_SUCCESS;
+ enum tui_status status = TUI_SUCCESS;
if (layoutType != UNDEFINED_LAYOUT || regsDisplayType != TUI_UNDEFINED_REGS)
{
@@ -325,7 +325,7 @@
** type and the layout.
*/
int
-tuiDefaultWinHeight (TuiWinType type, enum tui_layout_type layout)
+tuiDefaultWinHeight (enum tui_win_type type, enum tui_layout_type layout)
{
int h;
@@ -422,10 +422,10 @@
** Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, REGS,
** $REGS, $GREGS, $FREGS, $SREGS.
*/
-TuiStatus
+enum tui_status
tui_set_layout_for_display_command (const char *layoutName)
{
- TuiStatus status = TUI_SUCCESS;
+ enum tui_status status = TUI_SUCCESS;
if (layoutName != (char *) NULL)
{
@@ -673,7 +673,7 @@
static void
_makeCommandWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- _initAndMakeWin ((Opaque *) winInfoPtr,
+ _initAndMakeWin ((void **) winInfoPtr,
CMD_WIN,
height,
tui_term_width (),
@@ -717,7 +717,7 @@
static void
_makeDataWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- _initAndMakeWin ((Opaque *) winInfoPtr,
+ _initAndMakeWin ((void **) winInfoPtr,
DATA_WIN,
height,
tui_term_width (),
@@ -804,7 +804,7 @@
if (m_winPtrIsNull (disassemWin))
{
_makeDisassemWindow (&disassemWin, asmHeight, srcHeight - 1);
- _initAndMakeWin ((Opaque *) & locator,
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
@@ -881,7 +881,7 @@
{
int totalHeight = (tui_term_height () - cmdWin->generic.height);
int srcHeight, dataHeight;
- TuiWinType winType;
+ enum tui_win_type winType;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
@@ -901,7 +901,7 @@
_makeSourceWindow (&winList[winType], srcHeight, dataHeight - 1);
else
_makeDisassemWindow (&winList[winType], srcHeight, dataHeight - 1);
- _initAndMakeWin ((Opaque *) & locator,
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
@@ -945,7 +945,7 @@
** _initGenWinInfo().
*/
static void
-_initGenWinInfo (struct tui_gen_win_info * winInfo, TuiWinType type,
+_initGenWinInfo (struct tui_gen_win_info * winInfo, enum tui_win_type type,
int height, int width, int originX, int originY)
{
int h = height;
@@ -971,25 +971,25 @@
** _initAndMakeWin().
*/
static void
-_initAndMakeWin (Opaque * winInfoPtr, TuiWinType winType,
+_initAndMakeWin (void ** winInfoPtr, enum tui_win_type winType,
int height, int width, int originX, int originY, int boxIt)
{
- Opaque opaqueWinInfo = *winInfoPtr;
+ void *opaqueWinInfo = *winInfoPtr;
struct tui_gen_win_info * generic;
- if (opaqueWinInfo == (Opaque) NULL)
+ if (opaqueWinInfo == NULL)
{
if (m_winIsAuxillary (winType))
- opaqueWinInfo = (Opaque) tui_alloc_generic_win_info ();
+ opaqueWinInfo = (void *) tui_alloc_generic_win_info ();
else
- opaqueWinInfo = (Opaque) tui_alloc_win_info (winType);
+ opaqueWinInfo = (void *) tui_alloc_win_info (winType);
}
if (m_winIsAuxillary (winType))
generic = (struct tui_gen_win_info *) opaqueWinInfo;
else
generic = &((struct tui_win_info *) opaqueWinInfo)->generic;
- if (opaqueWinInfo != (Opaque) NULL)
+ if (opaqueWinInfo != NULL)
{
_initGenWinInfo (generic, winType, height, width, originX, originY);
if (!m_winIsAuxillary (winType))
@@ -1009,7 +1009,7 @@
** _makeSourceOrDisassemWindow().
*/
static void
-_makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, TuiWinType type,
+_makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, enum tui_win_type type,
int height, int originY)
{
struct tui_gen_win_info * executionInfo = (struct tui_gen_win_info *) NULL;
@@ -1021,7 +1021,7 @@
executionInfo = tui_source_exec_info_win_ptr ();
else
executionInfo = tui_disassem_exec_info_win_ptr ();
- _initAndMakeWin ((Opaque *) & executionInfo,
+ _initAndMakeWin ((void **) & executionInfo,
EXEC_INFO_WIN,
height,
3,
@@ -1031,7 +1031,7 @@
/*
** Now create the source window.
*/
- _initAndMakeWin ((Opaque *) winInfoPtr,
+ _initAndMakeWin ((void **) winInfoPtr,
type,
height,
tui_term_width () - executionInfo->width,
@@ -1076,7 +1076,7 @@
_makeSourceWindow (winInfoPtr, srcHeight - 1, 0);
else
_makeDisassemWindow (winInfoPtr, srcHeight - 1, 0);
- _initAndMakeWin ((Opaque *) & locator,
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
Index: tui/tui-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-regs.c,v
retrieving revision 1.6
diff -u -r1.6 tui-regs.c
--- tui/tui-regs.c 7 Feb 2004 16:31:22 -0000 1.6
+++ tui/tui-regs.c 7 Feb 2004 17:43:17 -0000
@@ -76,19 +76,19 @@
/*****************************************
** STATIC LOCAL FUNCTIONS FORWARD DECLS **
******************************************/
-static TuiStatus _tuiSetRegsContent
+static enum tui_status _tuiSetRegsContent
(int, int, struct frame_info *, enum tui_register_display_type, int);
static const char *_tuiRegisterName (int);
-static TuiStatus _tuiGetRegisterRawValue (int, char *, struct frame_info *);
+static enum tui_status _tuiGetRegisterRawValue (int, char *, struct frame_info *);
static void _tuiSetRegisterElement
(int, struct frame_info *, struct tui_data_element *, int);
static void _tuiDisplayRegister (int, struct tui_gen_win_info *, enum precision_type);
static void _tuiRegisterFormat
(char *, int, int, struct tui_data_element *, enum precision_type);
-static TuiStatus _tuiSetGeneralRegsContent (int);
-static TuiStatus _tuiSetSpecialRegsContent (int);
-static TuiStatus _tuiSetGeneralAndSpecialRegsContent (int);
-static TuiStatus _tuiSetFloatRegsContent (enum tui_register_display_type, int);
+static enum tui_status _tuiSetGeneralRegsContent (int);
+static enum tui_status _tuiSetSpecialRegsContent (int);
+static enum tui_status _tuiSetGeneralAndSpecialRegsContent (int);
+static enum tui_status _tuiSetFloatRegsContent (enum tui_register_display_type, int);
static int _tuiRegValueHasChanged
(struct tui_data_element *, struct frame_info *, char *);
static void _tuiShowFloat_command (char *, int);
@@ -211,7 +211,7 @@
void
tui_show_registers (enum tui_register_display_type dpyType)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
int refreshValuesOnly = FALSE;
/* Say that registers should be displayed, even if there is a problem */
@@ -641,7 +641,7 @@
** _tuiSetGeneralRegsContent().
** Set the content of the data window to consist of the general registers.
*/
-static TuiStatus
+static enum tui_status
_tuiSetGeneralRegsContent (int refreshValuesOnly)
{
return (_tuiSetRegsContent (0,
@@ -663,10 +663,10 @@
** _tuiSetSpecialRegsContent().
** Set the content of the data window to consist of the special registers.
*/
-static TuiStatus
+static enum tui_status
_tuiSetSpecialRegsContent (int refreshValuesOnly)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
int endRegNum;
endRegNum = FP0_REGNUM - 1;
@@ -684,10 +684,10 @@
** _tuiSetGeneralAndSpecialRegsContent().
** Set the content of the data window to consist of the special registers.
*/
-static TuiStatus
+static enum tui_status
_tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
int endRegNum = (-1);
endRegNum = FP0_REGNUM - 1;
@@ -701,10 +701,10 @@
** _tuiSetFloatRegsContent().
** Set the content of the data window to consist of the float registers.
*/
-static TuiStatus
+static enum tui_status
_tuiSetFloatRegsContent (enum tui_register_display_type dpyType, int refreshValuesOnly)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
int startRegNum;
startRegNum = FP0_REGNUM;
@@ -759,10 +759,10 @@
** _tuiGetRegisterRawValue().
** Get the register raw value. The raw value is returned in regValue.
*/
-static TuiStatus
+static enum tui_status
_tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
if (target_has_registers)
{
@@ -796,9 +796,9 @@
dataElement->name = _tuiRegisterName (regNum);
dataElement->highlight = FALSE;
}
- if (dataElement->value == (Opaque) NULL)
- dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE);
- if (dataElement->value != (Opaque) NULL)
+ if (dataElement->value == NULL)
+ dataElement->value = xmalloc (MAX_REGISTER_SIZE);
+ if (dataElement->value != NULL)
_tuiGetRegisterRawValue (regNum, dataElement->value, frame);
}
@@ -812,13 +812,13 @@
** numbered from startRegNum to endRegNum. Note that if
** refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored.
*/
-static TuiStatus
+static enum tui_status
_tuiSetRegsContent (int startRegNum, int endRegNum,
struct frame_info *frame,
enum tui_register_display_type dpyType,
int refreshValuesOnly)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
int numRegs = endRegNum - startRegNum + 1;
int allocatedHere = FALSE;
@@ -842,7 +842,7 @@
if (!refreshValuesOnly || allocatedHere)
{
- dataWin->generic.content = (OpaquePtr) NULL;
+ dataWin->generic.content = NULL;
dataWin->generic.contentSize = 0;
tui_add_content_elements (&dataWin->generic, numRegs);
dataWin->detail.dataDisplayInfo.regsContent =
Index: tui/tui-source.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-source.c,v
retrieving revision 1.5
diff -u -r1.5 tui-source.c
--- tui/tui-source.c 7 Feb 2004 16:31:22 -0000 1.5
+++ tui/tui-source.c 7 Feb 2004 17:43:17 -0000
@@ -48,7 +48,7 @@
enum tui_status
tui_set_source_content (struct symtab *s, int lineNo, int noerror)
{
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
if (s != (struct symtab *) NULL && s->filename != (char *) NULL)
{
@@ -214,7 +214,7 @@
curLineNo++;
}
if (offset > 0)
- tuiFree (srcLine);
+ xfree (srcLine);
fclose (stream);
srcWin->generic.contentSize = nlines;
ret = TUI_SUCCESS;
@@ -323,7 +323,7 @@
tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection,
int numToScroll)
{
- if (srcWin->generic.content != (OpaquePtr) NULL)
+ if (srcWin->generic.content != NULL)
{
union tui_line_or_address l;
struct symtab *s;
Index: tui/tui-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-stack.c,v
retrieving revision 1.7
diff -u -r1.7 tui-stack.c
--- tui/tui-stack.c 7 Feb 2004 16:31:22 -0000 1.7
+++ tui/tui-stack.c 7 Feb 2004 17:43:17 -0000
@@ -280,7 +280,7 @@
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
struct tui_locator_element * element;
- if (locator->content[0] == (Opaque) NULL)
+ if (locator->content[0] == NULL)
{
tui_set_locator_info (filename, NULL, 0, 0);
return;
@@ -302,7 +302,7 @@
/* Allocate the locator content if necessary. */
if (locator->contentSize <= 0)
{
- locator->content = (OpaquePtr) tui_alloc_content (1, locator->type);
+ locator->content = (void **) tui_alloc_content (1, locator->type);
locator->contentSize = 1;
}
@@ -366,7 +366,7 @@
&low, (CORE_ADDR) NULL) == 0)
error ("No function contains program counter for selected frame.\n");
else
- low = tuiGetLowDisassemblyAddress (low, get_frame_pc (fi));
+ low = tui_get_low_disassembly_address (low, get_frame_pc (fi));
}
if (winInfo == srcWin)
Index: tui/tui-win.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-win.c,v
retrieving revision 1.11
diff -u -r1.11 tui-win.c
--- tui/tui-win.c 7 Feb 2004 16:31:22 -0000 1.11
+++ tui/tui-win.c 7 Feb 2004 17:43:21 -0000
@@ -63,7 +63,7 @@
********************************/
static void _makeVisibleWithNewHeight (struct tui_win_info *);
static void _makeInvisibleAndSetNewHeight (struct tui_win_info *, int);
-static TuiStatus _tuiAdjustWinHeights (struct tui_win_info *, int);
+static enum tui_status _tuiAdjustWinHeights (struct tui_win_info *, int);
static int _newHeightOk (struct tui_win_info *, int);
static void _tuiSetTabWidth_command (char *, int);
static void _tuiRefreshAll_command (char *, int);
@@ -563,7 +563,7 @@
void
tui_refresh_all_win (void)
{
- TuiWinType type;
+ enum tui_win_type type;
clearok (curscr, TRUE);
tui_refresh_all (winList);
@@ -613,7 +613,7 @@
struct tui_win_info *firstWin;
struct tui_win_info *secondWin;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
- TuiWinType winType;
+ enum tui_win_type winType;
int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2;
/* turn keypad off while we resize */
@@ -885,7 +885,7 @@
if (dataWin && dataWin->generic.isVisible)
tui_refresh_data_win ();
- tuiFree (bufPtr);
+ xfree (bufPtr);
printf_filtered ("Focus set to %s window.\n",
tui_win_name ((struct tui_gen_win_info *) tui_win_with_focus ()));
}
@@ -913,7 +913,7 @@
static void
_tuiAllWindowsInfo (char *arg, int fromTTY)
{
- TuiWinType type;
+ enum tui_win_type type;
struct tui_win_info * winWithFocus = tui_win_with_focus ();
for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
@@ -1052,7 +1052,7 @@
printf_filtered (WIN_HEIGHT_USAGE);
if (buf != (char *) NULL)
- tuiFree (buf);
+ xfree (buf);
}
else
printf_filtered (WIN_HEIGHT_USAGE);
@@ -1122,10 +1122,10 @@
** _tuiAdjustWinHeights().
** Function to adjust all window heights around the primary
*/
-static TuiStatus
+static enum tui_status
_tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight)
{
- TuiStatus status = TUI_FAILURE;
+ enum tui_status status = TUI_FAILURE;
if (_newHeightOk (primaryWinInfo, newHeight))
{
@@ -1350,7 +1350,7 @@
case DISASSEM_WIN:
tui_free_win_content (winInfo->detail.sourceInfo.executionInfo);
tui_make_visible (winInfo->detail.sourceInfo.executionInfo);
- if (winInfo->generic.content != (OpaquePtr) NULL)
+ if (winInfo->generic.content != NULL)
{
union tui_line_or_address lineOrAddr;
struct symtab_and_line cursal
@@ -1582,7 +1582,7 @@
else if (*winToScroll == cmdWin)
*winToScroll = (struct tui_win_info *) (tui_source_windows ())->list[0];
}
- tuiFree (buf);
+ xfree (buf);
}
return;
Index: tui/tui-wingeneral.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-wingeneral.c,v
retrieving revision 1.4
diff -u -r1.4 tui-wingeneral.c
--- tui/tui-wingeneral.c 7 Feb 2004 16:31:22 -0000 1.4
+++ tui/tui-wingeneral.c 7 Feb 2004 17:43:23 -0000
@@ -252,7 +252,7 @@
void
tui_refresh_all (struct tui_win_info * * list)
{
- TuiWinType type;
+ enum tui_win_type type;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
Index: tui/tui-winsource.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-winsource.c,v
retrieving revision 1.9
diff -u -r1.9 tui-winsource.c
--- tui/tui-winsource.c 7 Feb 2004 16:31:22 -0000 1.9
+++ tui/tui-winsource.c 7 Feb 2004 17:43:23 -0000
@@ -91,7 +91,7 @@
tui_update_source_window_as_is (struct tui_win_info * winInfo, struct symtab *s,
union tui_line_or_address lineOrAddr, int noerror)
{
- TuiStatus ret;
+ enum tui_status ret;
if (winInfo->generic.type == SRC_WIN)
ret = tui_set_source_content (s, lineOrAddr.lineNo, noerror);
@@ -314,7 +314,7 @@
enum tui_scroll_direction direction,
int numToScroll)
{
- if (winInfo->generic.content != (OpaquePtr) NULL)
+ if (winInfo->generic.content != NULL)
{
int offset;
struct symtab *s;
@@ -459,20 +459,20 @@
** based upon the input window which is either the source or
** disassembly window.
*/
-TuiStatus
+enum tui_status
tuiSetExecInfoContent (struct tui_win_info * winInfo)
{
- TuiStatus ret = TUI_SUCCESS;
+ enum tui_status ret = TUI_SUCCESS;
if (winInfo->detail.sourceInfo.executionInfo != (struct tui_gen_win_info *) NULL)
{
struct tui_gen_win_info * execInfoPtr = winInfo->detail.sourceInfo.executionInfo;
- if (execInfoPtr->content == (OpaquePtr) NULL)
+ if (execInfoPtr->content == NULL)
execInfoPtr->content =
- (OpaquePtr) tui_alloc_content (winInfo->generic.height,
+ (void **) tui_alloc_content (winInfo->generic.height,
execInfoPtr->type);
- if (execInfoPtr->content != (OpaquePtr) NULL)
+ if (execInfoPtr->content != NULL)
{
int i;
@@ -575,7 +575,7 @@
{
register char *srcLineBuf;
register int i, lineWidth, maxLines;
- TuiStatus ret = TUI_FAILURE;
+ enum tui_status ret = TUI_FAILURE;
maxLines = winInfo->generic.height; /* less the highlight box */
lineWidth = winInfo->generic.width - 1;
@@ -584,7 +584,7 @@
** will be re-used for all source displays. The only other time this will
** be done is when a window's size changes.
*/
- if (winInfo->generic.content == (OpaquePtr) NULL)
+ if (winInfo->generic.content == NULL)
{
srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char));
if (srcLineBuf == (char *) NULL)
@@ -595,9 +595,9 @@
{
/* allocate the content list */
if ((winInfo->generic.content =
- (OpaquePtr) tui_alloc_content (maxLines, SRC_WIN)) == (OpaquePtr) NULL)
+ (void **) tui_alloc_content (maxLines, SRC_WIN)) == NULL)
{
- tuiFree (srcLineBuf);
+ xfree (srcLineBuf);
srcLineBuf = (char *) NULL;
fputs_unfiltered (
"Unable to Allocate Memory for Source or Disassembly Display.\n",
Index: tui/tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.41
diff -u -r1.41 tui.c
--- tui/tui.c 7 Feb 2004 16:31:22 -0000 1.41
+++ tui/tui.c 7 Feb 2004 17:43:24 -0000
@@ -456,17 +456,6 @@
tui_update_gdb_sizes ();
}
-/* Wrapper on top of free() to ensure that input address
- is greater than 0x0. */
-void
-tuiFree (char *ptr)
-{
- if (ptr != (char *) NULL)
- {
- xfree (ptr);
- }
-}
-
void
strcat_to_buf (char *buf, int buflen, const char *itemToAdd)
{
@@ -577,7 +566,7 @@
}
int
-tui_is_window_visible (TuiWinType type)
+tui_is_window_visible (enum tui_win_type type)
{
if (tui_active == 0)
return 0;
Index: tui/tui.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.h,v
retrieving revision 1.19
diff -u -r1.19 tui.h
--- tui/tui.h 23 Jan 2004 23:25:17 -0000 1.19
+++ tui/tui.h 7 Feb 2004 17:43:24 -0000
@@ -38,63 +38,44 @@
struct ui_file;
-/* Opaque data type */
-typedef char *Opaque;
-typedef
-Opaque (*OpaqueFuncPtr) (va_list);
- typedef char **OpaqueList;
- typedef OpaqueList OpaquePtr;
-
-/* Generic function pointer */
- typedef void (*TuiVoidFuncPtr) (va_list);
- typedef int (*TuiIntFuncPtr) (va_list);
-/*
- typedef Opaque (*TuiOpaqueFuncPtr) (va_list);
- */
- typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
-
extern void strcat_to_buf (char *, int, const char *);
-/* Types of error returns */
- typedef enum tui_status
- {
- TUI_SUCCESS,
- TUI_FAILURE
- }
-TuiStatus, *TuiStatusPtr;
+/* Types of error returns. */
+enum tui_status
+{
+ TUI_SUCCESS,
+ TUI_FAILURE
+};
/* Types of windows */
-typedef enum tui_win_type
- {
- SRC_WIN = 0,
- DISASSEM_WIN,
- DATA_WIN,
- CMD_WIN,
- /* This must ALWAYS be AFTER the major windows last */
- MAX_MAJOR_WINDOWS,
- /* auxillary windows */
- LOCATOR_WIN,
- EXEC_INFO_WIN,
- DATA_ITEM_WIN,
- /* This must ALWAYS be next to last */
- MAX_WINDOWS,
- UNDEFINED_WIN /* LAST */
- }
-TuiWinType, *TuiWinTypePtr;
-
-/* This is a point definition */
- typedef struct _TuiPoint
- {
- int x, y;
- }
-TuiPoint, *TuiPointPtr;
+enum tui_win_type
+{
+ SRC_WIN = 0,
+ DISASSEM_WIN,
+ DATA_WIN,
+ CMD_WIN,
+ /* This must ALWAYS be AFTER the major windows last. */
+ MAX_MAJOR_WINDOWS,
+ /* Auxillary windows. */
+ LOCATOR_WIN,
+ EXEC_INFO_WIN,
+ DATA_ITEM_WIN,
+ /* This must ALWAYS be next to last. */
+ MAX_WINDOWS,
+ UNDEFINED_WIN /* LAST */
+};
+
+/* This is a point definition. */
+struct tui_point
+{
+ int x, y;
+};
/* GENERAL TUI FUNCTIONS */
/* tui.c */
-extern void tuiFree (char *);
-extern CORE_ADDR tuiGetLowDisassemblyAddress (CORE_ADDR, CORE_ADDR);
+extern CORE_ADDR tui_get_low_disassembly_address (CORE_ADDR, CORE_ADDR);
extern void tui_show_assembly (CORE_ADDR addr);
-extern int tui_is_window_visible (TuiWinType type);
+extern int tui_is_window_visible (enum tui_win_type type);
extern int tui_get_command_dimension (int *width, int *height);
/* Initialize readline and configure the keymap for the switching
@@ -137,10 +118,10 @@
extern struct ui_out *tui_out_new (struct ui_file *stream);
-/* tuiLayout.c */
+/* tui-layout.c */
extern enum tui_status tui_set_layout_for_display_command (const char *name);
-/* tuiSourceWin.c */
-extern void tuiUpdateAllExecInfos (void);
+/* tui-winsource.c */
+extern void tui_update_all_exec_infos (void);
#endif /* TUI_H */