* 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.
+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.
+
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* objfiles.h (struct objfile): Add objfile_obstack field.
#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;
}
#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;
}
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 =
/*********************************
** 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);
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;
}
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;
}
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)
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)
win->contentSize =
win->lastVisibleLine = 0;
win->handle = (WINDOW *) NULL;
- win->content = (OpaquePtr) NULL;
+ win->content = NULL;
win->contentInUse =
win->isVisible = FALSE;
win->title = 0;
** 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)
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;
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:
winInfo->detail.commandInfo.curch = 0;
break;
default:
- winInfo->detail.opaque = (Opaque) NULL;
+ winInfo->detail.opaque = NULL;
break;
}
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;
** 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;
}
else
{
- tuiFree ((char *) content);
+ xfree (content);
content = (tui_win_content) NULL;
}
}
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++;
}
}
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);
}
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);
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;
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;
** 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;
** 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)
{
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
{
switch (type)
{
case DATA_WIN:
- tuiFree ((char *) element);
+ xfree (element);
break;
case DATA_ITEM_WIN:
/*
** 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;
}
}
if (type != DATA_WIN && type != DATA_ITEM_WIN)
- tuiFree ((char *) content[0]); /* free the element block */
+ xfree (content[0]); /* free the element block */
}
return;
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 */
/* General list struct. */
struct tui_list
{
- OpaqueList list;
+ void **list;
int count;
};
/* 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;
const char *name;
int itemNo; /* the register number, or data display number */
enum tui_data_type type;
- Opaque value;
+ void *value;
int highlight;
};
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? */
/* 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);
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;
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;
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;
** 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);
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)
{
** 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;
** 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)
{
static void
_makeCommandWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- _initAndMakeWin ((Opaque *) winInfoPtr,
+ _initAndMakeWin ((void **) winInfoPtr,
CMD_WIN,
height,
tui_term_width (),
static void
_makeDataWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- _initAndMakeWin ((Opaque *) winInfoPtr,
+ _initAndMakeWin ((void **) winInfoPtr,
DATA_WIN,
height,
tui_term_width (),
if (m_winPtrIsNull (disassemWin))
{
_makeDisassemWindow (&disassemWin, asmHeight, srcHeight - 1);
- _initAndMakeWin ((Opaque *) & locator,
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
{
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 ();
_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 (),
** _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;
** _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))
** _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;
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,
/*
** Now create the source window.
*/
- _initAndMakeWin ((Opaque *) winInfoPtr,
+ _initAndMakeWin ((void **) winInfoPtr,
type,
height,
tui_term_width () - executionInfo->width,
_makeSourceWindow (winInfoPtr, srcHeight - 1, 0);
else
_makeDisassemWindow (winInfoPtr, srcHeight - 1, 0);
- _initAndMakeWin ((Opaque *) & locator,
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
/*****************************************
** 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);
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 */
** _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,
** _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;
** _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;
** _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;
** _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)
{
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);
}
** 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;
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 =
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)
{
curLineNo++;
}
if (offset > 0)
- tuiFree (srcLine);
+ xfree (srcLine);
fclose (stream);
srcWin->generic.contentSize = nlines;
ret = TUI_SUCCESS;
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;
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;
/* 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;
}
&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)
********************************/
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);
void
tui_refresh_all_win (void)
{
- TuiWinType type;
+ enum tui_win_type type;
clearok (curscr, TRUE);
tui_refresh_all (winList);
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 */
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 ()));
}
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++)
printf_filtered (WIN_HEIGHT_USAGE);
if (buf != (char *) NULL)
- tuiFree (buf);
+ xfree (buf);
}
else
printf_filtered (WIN_HEIGHT_USAGE);
** _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))
{
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
else if (*winToScroll == cmdWin)
*winToScroll = (struct tui_win_info *) (tui_source_windows ())->list[0];
}
- tuiFree (buf);
+ xfree (buf);
}
return;
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++)
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);
enum tui_scroll_direction direction,
int numToScroll)
{
- if (winInfo->generic.content != (OpaquePtr) NULL)
+ if (winInfo->generic.content != NULL)
{
int offset;
struct symtab *s;
** 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;
{
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;
** 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)
{
/* 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",
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)
{
}
int
-tui_is_window_visible (TuiWinType type)
+tui_is_window_visible (enum tui_win_type type)
{
if (tui_active == 0)
return 0;
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
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 */