aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-09-01 10:49:00 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-09-01 10:49:00 +0000
commitcb50eddded7154b37be9fe4b39df549c48c2d583 (patch)
tree1481e5ae553457e0b84984850c68ad5668c92250 /gdb/tui
parent50265402245de3e54551c2b2e6e06885e89c734f (diff)
downloadfsf-binutils-gdb-cb50eddded7154b37be9fe4b39df549c48c2d583.zip
fsf-binutils-gdb-cb50eddded7154b37be9fe4b39df549c48c2d583.tar.gz
fsf-binutils-gdb-cb50eddded7154b37be9fe4b39df549c48c2d583.tar.bz2
* tuiData.h (FILE_PREFIX): Don't define.
(blankStr, locationStr, breakStr): Don't declare. (breakLocationStr, nullStr, historyLimit, setHistoryLimitTo): Likewise. (displayableWinContentOf, displayableWinContentAt): Likewise. (winElementHeight, winByName, freeAllWindows): Likewise. * tuiData.c (blankStr, locationStr, breakStr): Remove. (breakLocationStr, nullStr, historyLimit, setHistoryLimitTo): Remove. (displayableWinContentOf, displayableWinContentAt): Remove. (winElementHeight, winByName, freeAllWindows): Remove.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/ChangeLog13
-rw-r--r--gdb/tui/tuiData.c293
-rw-r--r--gdb/tui/tuiData.h13
3 files changed, 15 insertions, 304 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 9b8e260..a29d002 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,5 +1,18 @@
2002-09-01 Stephane Carrez <stcarrez@nerim.fr>
+ * tuiData.h (FILE_PREFIX): Don't define.
+ (blankStr, locationStr, breakStr): Don't declare.
+ (breakLocationStr, nullStr, historyLimit, setHistoryLimitTo): Likewise.
+ (displayableWinContentOf, displayableWinContentAt): Likewise.
+ (winElementHeight, winByName, freeAllWindows): Likewise.
+
+ * tuiData.c (blankStr, locationStr, breakStr): Remove.
+ (breakLocationStr, nullStr, historyLimit, setHistoryLimitTo): Remove.
+ (displayableWinContentOf, displayableWinContentAt): Remove.
+ (winElementHeight, winByName, freeAllWindows): Remove.
+
+2002-09-01 Stephane Carrez <stcarrez@nerim.fr>
+
* tuiStack.c (tui_make_status_line): New function to create the
status line.
(tuiShowLocatorContent): Use it instead of displayableWinContentAt.
diff --git a/gdb/tui/tuiData.c b/gdb/tui/tuiData.c
index 29ed9b0..225583e 100644
--- a/gdb/tui/tuiData.c
+++ b/gdb/tui/tuiData.c
@@ -40,6 +40,7 @@
#endif
#include "defs.h"
+#include "symtab.h"
#include "tui.h"
#include "tuiData.h"
#include "tuiGeneralWin.h"
@@ -50,24 +51,10 @@
TuiWinInfoPtr winList[MAX_MAJOR_WINDOWS];
/***************************
-** Private Definitions
-****************************/
-#define FILE_WIDTH 30
-#define PROC_WIDTH 40
-#define LINE_WIDTH 4
-#define PC_WIDTH 8
-
-/***************************
** Private data
****************************/
-static char *_tuiNullStr = TUI_NULL_STR;
-static char *_tuiBlankStr = " ";
-static char *_tuiLocationStr = " >";
-static char *_tuiBreakStr = " * ";
-static char *_tuiBreakLocationStr = " *>";
static TuiLayoutType _currentLayout = UNDEFINED_LAYOUT;
static int _termHeight, _termWidth;
-static int _historyLimit = DEFAULT_HISTORY_COUNT;
static TuiGenWinInfo _locator;
static TuiGenWinInfo _execInfo[2];
static TuiWinInfoPtr _srcWinList[2];
@@ -286,61 +273,6 @@ clearWinDetail (TuiWinInfoPtr winInfo)
/*
- ** blankStr()
- ** Accessor for the blank string.
- */
-char *
-blankStr (void)
-{
- return _tuiBlankStr;
-} /* blankStr */
-
-
-/*
- ** locationStr()
- ** Accessor for the location string.
- */
-char *
-locationStr (void)
-{
- return _tuiLocationStr;
-} /* locationStr */
-
-
-/*
- ** breakStr()
- ** Accessor for the break string.
- */
-char *
-breakStr (void)
-{
- return _tuiBreakStr;
-} /* breakStr */
-
-
-/*
- ** breakLocationStr()
- ** Accessor for the breakLocation string.
- */
-char *
-breakLocationStr (void)
-{
- return _tuiBreakLocationStr;
-} /* breakLocationStr */
-
-
-/*
- ** nullStr()
- ** Accessor for the null string.
- */
-char *
-nullStr (void)
-{
- return _tuiNullStr;
-} /* nullStr */
-
-
-/*
** sourceExecInfoPtr().
** Accessor for the source execution info ptr.
*/
@@ -375,29 +307,6 @@ locatorWinInfoPtr (void)
/*
- ** historyLimit().
- ** Accessor for the history limit
- */
-int
-historyLimit (void)
-{
- return _historyLimit;
-} /* historyLimit */
-
-
-/*
- ** setHistoryLimitTo().
- ** Mutator for the history limit
- */
-void
-setHistoryLimitTo (int h)
-{
- _historyLimit = h;
-
- return;
-} /* setHistoryLimitTo */
-
-/*
** termHeight().
** Accessor for the termHeight
*/
@@ -549,189 +458,7 @@ tuiPrevWin (TuiWinInfoPtr curWin)
}
return prev;
-} /* tuiPrevWin */
-
-
-/*
- ** displayableWinContentOf().
- ** Answer a the content at the location indicated by index. Note
- ** that if this is a locator window, the string returned should be
- ** freed after use.
- */
-char *
-displayableWinContentOf (TuiGenWinInfoPtr winInfo, TuiWinElementPtr elementPtr)
-{
-
- char *string = nullStr ();
-
- if (elementPtr != (TuiWinElementPtr) NULL || winInfo->type == LOCATOR_WIN)
- {
- /*
- ** Now convert the line to a displayable string
- */
- switch (winInfo->type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- string = elementPtr->whichElement.source.line;
- break;
- case CMD_WIN:
- string = elementPtr->whichElement.command.line;
- break;
- case LOCATOR_WIN:
- if ((string = (char *) xmalloc (
- (termWidth () + 1) * sizeof (char))) == (char *) NULL)
- string = nullStr ();
- else
- {
- char lineNo[50], pc[50], buf[50], *fname, *pname;
- register int strSize = termWidth (), i, procWidth, fileWidth;
-
- /*
- ** First determine the amount of file/proc name width
- ** we have available
- */
- i = strSize - (PC_WIDTH + LINE_WIDTH
- + 25 /* pc and line labels */
- + strlen (FILE_PREFIX) + 1 /* file label */
- + 15 /* procedure label */ );
- if (i >= FILE_WIDTH + PROC_WIDTH)
- {
- fileWidth = FILE_WIDTH;
- procWidth = PROC_WIDTH;
- }
- else
- {
- fileWidth = i / 2;
- procWidth = i - fileWidth;
- }
-
- /* Now convert elements to string form */
- if (elementPtr != (TuiWinElementPtr) NULL &&
- *elementPtr->whichElement.locator.fileName != (char) 0 &&
- srcWin->generic.isVisible)
- fname = elementPtr->whichElement.locator.fileName;
- else
- fname = "??";
- if (elementPtr != (TuiWinElementPtr) NULL &&
- *elementPtr->whichElement.locator.procName != (char) 0)
- pname = elementPtr->whichElement.locator.procName;
- else
- pname = "??";
- if (elementPtr != (TuiWinElementPtr) NULL &&
- elementPtr->whichElement.locator.lineNo > 0)
- sprintf (lineNo, "%d",
- elementPtr->whichElement.locator.lineNo);
- else
- strcpy (lineNo, "??");
- if (elementPtr != (TuiWinElementPtr) NULL &&
- elementPtr->whichElement.locator.addr != 0)
- sprintf (pc, "0x%lx",
- (long) elementPtr->whichElement.locator.addr);
- else
- strcpy (pc, "??");
- /*
- ** Now create the locator line from the string version
- ** of the elements. We could use sprintf() here but
- ** that wouldn't ensure that we don't overrun the size
- ** of the allocated buffer. strcat_to_buf() will.
- */
- *string = (char) 0;
- /* Filename */
- strcat_to_buf (string, strSize, " ");
- strcat_to_buf (string, strSize, FILE_PREFIX);
- if (strlen (fname) > fileWidth)
- {
- strncpy (buf, fname, fileWidth - 1);
- buf[fileWidth - 1] = '*';
- buf[fileWidth] = (char) 0;
- }
- else
- strcpy (buf, fname);
- strcat_to_buf (string, strSize, buf);
- /* procedure/class name */
- sprintf (buf, "%15s", PROC_PREFIX);
- strcat_to_buf (string, strSize, buf);
- if (strlen (pname) > procWidth)
- {
- strncpy (buf, pname, procWidth - 1);
- buf[procWidth - 1] = '*';
- buf[procWidth] = (char) 0;
- }
- else
- strcpy (buf, pname);
- strcat_to_buf (string, strSize, buf);
- sprintf (buf, "%10s", LINE_PREFIX);
- strcat_to_buf (string, strSize, buf);
- strcat_to_buf (string, strSize, lineNo);
- sprintf (buf, "%10s", PC_PREFIX);
- strcat_to_buf (string, strSize, buf);
- strcat_to_buf (string, strSize, pc);
- for (i = strlen (string); i < strSize; i++)
- string[i] = ' ';
- string[strSize] = (char) 0;
- }
- break;
- case EXEC_INFO_WIN:
- string = elementPtr->whichElement.simpleString;
- break;
- default:
- break;
- }
- }
- return string;
-} /* displayableWinContentOf */
-
-
-/*
- ** winContentAt().
- ** Answer a the content at the location indicated by index
- */
-char *
-displayableWinContentAt (TuiGenWinInfoPtr winInfo, int index)
-{
- return (displayableWinContentOf (winInfo, (TuiWinElementPtr) winInfo->content[index]));
-} /* winContentAt */
-
-
-/*
- ** winElementHeight().
- ** Answer the height of the element in lines
- */
-int
-winElementHeight (TuiGenWinInfoPtr winInfo, TuiWinElementPtr element)
-{
- int h;
-
- if (winInfo->type == DATA_WIN)
-/* FOR NOW SAY IT IS ONLY ONE LINE HIGH */
- h = 1;
- else
- h = 1;
-
- return h;
-} /* winElementHeight */
-
-
-/*
- ** winByName().
- ** Answer the window represented by name
- */
-TuiWinInfoPtr
-winByName (char *name)
-{
- TuiWinInfoPtr winInfo = (TuiWinInfoPtr) NULL;
- int i = 0;
-
- while (i < MAX_MAJOR_WINDOWS && m_winPtrIsNull (winInfo))
- {
- if (strcmp (name, winName (&(winList[i]->generic))) == 0)
- winInfo = winList[i];
- i++;
- }
-
- return winInfo;
-} /* winByName */
+}
/*
@@ -1205,22 +932,6 @@ freeWinContent (TuiGenWinInfoPtr winInfo)
} /* freeWinContent */
-/*
- ** freeAllWindows().
- */
-void
-freeAllWindows (void)
-{
- TuiWinType type = SRC_WIN;
-
- for (; type < MAX_MAJOR_WINDOWS; type++)
- if (m_winPtrNotNull (winList[type]) &&
- winList[type]->generic.type != UNDEFINED_WIN)
- freeWindow (winList[type]);
- return;
-} /* freeAllWindows */
-
-
void
tuiDelDataWindows (TuiWinContent content, int contentSize)
{
diff --git a/gdb/tui/tuiData.h b/gdb/tui/tuiData.h
index 0ce7ed2..8a4eb9f 100644
--- a/gdb/tui/tuiData.h
+++ b/gdb/tui/tuiData.h
@@ -72,7 +72,6 @@ TuiGenWinInfo, *TuiGenWinInfoPtr;
#define MIN_CMD_WIN_HEIGHT 3
/* Strings to display in the TUI status line. */
-#define FILE_PREFIX "File: "
#define PROC_PREFIX "In: "
#define LINE_PREFIX "Line: "
#define PC_PREFIX "PC: "
@@ -347,35 +346,23 @@ extern TuiWinContent allocContent (int, TuiWinType);
extern int addContentElements (TuiGenWinInfoPtr, int);
extern void initContentElement (TuiWinElementPtr, TuiWinType);
extern void freeWindow (TuiWinInfoPtr);
-extern void freeAllWindows (void);
extern void freeWinContent (TuiGenWinInfoPtr);
extern void freeDataContent (TuiWinContent, int);
extern void freeAllSourceWinsContent (void);
extern void tuiDelWindow (TuiWinInfoPtr);
extern void tuiDelDataWindows (TuiWinContent, int);
-extern TuiWinInfoPtr winByName (char *);
extern TuiWinInfoPtr partialWinByName (char *);
extern char *winName (TuiGenWinInfoPtr);
-extern char *displayableWinContentOf (TuiGenWinInfoPtr, TuiWinElementPtr);
-extern char *displayableWinContentAt (TuiGenWinInfoPtr, int);
-extern int winElementHeight (TuiGenWinInfoPtr, TuiWinElementPtr);
extern TuiLayoutType currentLayout (void);
extern void setCurrentLayoutTo (TuiLayoutType);
extern int termHeight (void);
extern void setTermHeightTo (int);
extern int termWidth (void);
extern void setTermWidthTo (int);
-extern int historyLimit (void);
-extern void setHistoryLimit (int);
extern void setGenWinOrigin (TuiGenWinInfoPtr, int, int);
extern TuiGenWinInfoPtr locatorWinInfoPtr (void);
extern TuiGenWinInfoPtr sourceExecInfoWinPtr (void);
extern TuiGenWinInfoPtr disassemExecInfoWinPtr (void);
-extern char *nullStr (void);
-extern char *blankStr (void);
-extern char *locationStr (void);
-extern char *breakStr (void);
-extern char *breakLocationStr (void);
extern TuiListPtr sourceWindows (void);
extern void clearSourceWindows (void);
extern void clearSourceWindowsDetail (void);