OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.3/] [gdb/] [tui/] [tuiData.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
/* TUI data manipulation routines.
2
   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3
   Contributed by Hewlett-Packard Company.
4
 
5
   This file is part of GDB.
6
 
7
   This program is free software; you can redistribute it and/or modify
8
   it under the terms of the GNU General Public License as published by
9
   the Free Software Foundation; either version 2 of the License, or
10
   (at your option) any later version.
11
 
12
   This program is distributed in the hope that it will be useful,
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
   GNU General Public License for more details.
16
 
17
   You should have received a copy of the GNU General Public License
18
   along with this program; if not, write to the Free Software
19
   Foundation, Inc., 59 Temple Place - Suite 330,
20
   Boston, MA 02111-1307, USA.  */
21
 
22
#ifndef TUI_DATA_H
23
#define TUI_DATA_H
24
 
25
#if defined (HAVE_NCURSES_H)
26
#include <ncurses.h>
27
#elif defined (HAVE_CURSES_H)
28
#include <curses.h>
29
#endif
30
 
31
/* Generic window information */
32
     typedef struct _TuiGenWinInfo
33
       {
34
         WINDOW *handle;        /* window handle */
35
         TuiWinType type;       /* type of window */
36
         int width;             /* window width */
37
         int height;            /* window height */
38
         TuiPoint origin;       /* origin of window */
39
         OpaquePtr content;     /* content of window */
40
         int contentSize;       /* Size of content (# of elements) */
41
         int contentInUse;      /* Can it be used, or is it already used? */
42
         int viewportHeight;    /* viewport height */
43
         int lastVisibleLine;   /* index of last visible line */
44
         int isVisible;         /* whether the window is visible or not */
45
         char* title;          /* Window title to display.  */
46
       }
47
TuiGenWinInfo, *TuiGenWinInfoPtr;
48
 
49
/* Constant definitions */
50
#define DEFAULT_TAB_LEN                8
51
#define NO_SRC_STRING                  "[ No Source Available ]"
52
#define NO_DISASSEM_STRING             "[ No Assembly Available ]"
53
#define NO_REGS_STRING                 "[ Register Values Unavailable ]"
54
#define NO_DATA_STRING                 "[ No Data Values Displayed ]"
55
#define MAX_CONTENT_COUNT              100
56
#define SRC_NAME                       "SRC"
57
#define CMD_NAME                       "CMD"
58
#define DATA_NAME                      "REGS"
59
#define DISASSEM_NAME                  "ASM"
60
#define TUI_NULL_STR                   ""
61
#define DEFAULT_HISTORY_COUNT          25
62
#define BOX_WINDOW                     TRUE
63
#define DONT_BOX_WINDOW                FALSE
64
#define HILITE                         TRUE
65
#define NO_HILITE                      FALSE
66
#define WITH_LOCATOR                   TRUE
67
#define NO_LOCATOR                     FALSE
68
#define EMPTY_SOURCE_PROMPT            TRUE
69
#define NO_EMPTY_SOURCE_PROMPT         FALSE
70
#define UNDEFINED_ITEM                 -1
71
#define MIN_WIN_HEIGHT                 3
72
#define MIN_CMD_WIN_HEIGHT             3
73
 
74
/* Strings to display in the TUI status line.  */
75
#define PROC_PREFIX                    "In: "
76
#define LINE_PREFIX                    "Line: "
77
#define PC_PREFIX                      "PC: "
78
#define SINGLE_KEY                     "(SingleKey)"
79
 
80
/* Minimum/Maximum length of some fields displayed in the TUI status line.  */
81
#define MIN_LINE_WIDTH     4 /* Use at least 4 digits for line numbers.  */
82
#define MIN_PROC_WIDTH    12
83
#define MAX_TARGET_WIDTH  10
84
#define MAX_PID_WIDTH     14
85
 
86
#define TUI_FLOAT_REGS_NAME                  "$FREGS"
87
#define TUI_FLOAT_REGS_NAME_LOWER            "$fregs"
88
#define TUI_GENERAL_REGS_NAME                "$GREGS"
89
#define TUI_GENERAL_REGS_NAME_LOWER          "$gregs"
90
#define TUI_SPECIAL_REGS_NAME                "$SREGS"
91
#define TUI_SPECIAL_REGS_NAME_LOWER          "$sregs"
92
#define TUI_GENERAL_SPECIAL_REGS_NAME        "$REGS"
93
#define TUI_GENERAL_SPECIAL_REGS_NAME_LOWER  "$regs"
94
 
95
/* Scroll direction enum */
96
typedef enum
97
  {
98
    FORWARD_SCROLL,
99
    BACKWARD_SCROLL,
100
    LEFT_SCROLL,
101
    RIGHT_SCROLL
102
  }
103
TuiScrollDirection, *TuiScrollDirectionPtr;
104
 
105
 
106
/* General list struct */
107
typedef struct _TuiList
108
  {
109
    OpaqueList list;
110
    int count;
111
  }
112
TuiList, *TuiListPtr;
113
 
114
 
115
/* The kinds of layouts available */
116
typedef enum
117
  {
118
    SRC_COMMAND,
119
    DISASSEM_COMMAND,
120
    SRC_DISASSEM_COMMAND,
121
    SRC_DATA_COMMAND,
122
    DISASSEM_DATA_COMMAND,
123
    UNDEFINED_LAYOUT
124
  }
125
TuiLayoutType, *TuiLayoutTypePtr;
126
 
127
/* Basic data types that can be displayed in the data window. */
128
typedef enum _TuiDataType
129
  {
130
    TUI_REGISTER,
131
    TUI_SCALAR,
132
    TUI_COMPLEX,
133
    TUI_STRUCT
134
  }
135
TuiDataType, TuiDataTypePtr;
136
 
137
/* Types of register displays */
138
typedef enum _TuiRegisterDisplayType
139
  {
140
    TUI_UNDEFINED_REGS,
141
    TUI_GENERAL_REGS,
142
    TUI_SFLOAT_REGS,
143
    TUI_DFLOAT_REGS,
144
    TUI_SPECIAL_REGS,
145
    TUI_GENERAL_AND_SPECIAL_REGS
146
  }
147
TuiRegisterDisplayType, *TuiRegisterDisplayTypePtr;
148
 
149
/* Structure describing source line or line address */
150
typedef union _TuiLineOrAddress
151
  {
152
    int lineNo;
153
    CORE_ADDR addr;
154
  }
155
TuiLineOrAddress, *TuiLineOrAddressPtr;
156
 
157
/* Current Layout definition */
158
typedef struct _TuiLayoutDef
159
  {
160
    TuiWinType displayMode;
161
    int split;
162
    TuiRegisterDisplayType regsDisplayType;
163
    TuiRegisterDisplayType floatRegsDisplayType;
164
  }
165
TuiLayoutDef, *TuiLayoutDefPtr;
166
 
167
/* Elements in the Source/Disassembly Window */
168
typedef struct _TuiSourceElement
169
  {
170
    char *line;
171
    TuiLineOrAddress lineOrAddr;
172
    int isExecPoint;
173
    int hasBreak;
174
  }
175
TuiSourceElement, *TuiSourceElementPtr;
176
 
177
 
178
/* Elements in the data display window content */
179
typedef struct _TuiDataElement
180
  {
181
    const char *name;
182
    int itemNo;                 /* the register number, or data display number */
183
    TuiDataType type;
184
    Opaque value;
185
    int highlight;
186
  }
187
TuiDataElement, *TuiDataElementPtr;
188
 
189
 
190
/* Elements in the command window content */
191
typedef struct _TuiCommandElement
192
  {
193
    char *line;
194
  }
195
TuiCommandElement, *TuiCommandElementPtr;
196
 
197
 
198
#define MAX_LOCATOR_ELEMENT_LEN        100
199
 
200
/* Elements in the locator window content */
201
typedef struct _TuiLocatorElement
202
  {
203
    char fileName[MAX_LOCATOR_ELEMENT_LEN];
204
    char procName[MAX_LOCATOR_ELEMENT_LEN];
205
    int lineNo;
206
    CORE_ADDR addr;
207
  }
208
TuiLocatorElement, *TuiLocatorElementPtr;
209
 
210
/* Flags to tell what kind of breakpoint is at current line.  */
211
#define TUI_BP_ENABLED      0x01
212
#define TUI_BP_DISABLED     0x02
213
#define TUI_BP_HIT          0x04
214
#define TUI_BP_CONDITIONAL  0x08
215
#define TUI_BP_HARDWARE     0x10
216
 
217
/* Position of breakpoint markers in the exec info string.  */
218
#define TUI_BP_HIT_POS      0
219
#define TUI_BP_BREAK_POS    1
220
#define TUI_EXEC_POS        2
221
#define TUI_EXECINFO_SIZE   4
222
 
223
typedef char TuiExecInfoContent[TUI_EXECINFO_SIZE];
224
 
225
/* An content element in a window */
226
typedef union
227
  {
228
    TuiSourceElement source;    /* the source elements */
229
    TuiGenWinInfo dataWindow;   /* data display elements */
230
    TuiDataElement data;        /* elements of dataWindow */
231
    TuiCommandElement command;  /* command elements */
232
    TuiLocatorElement locator;  /* locator elements */
233
    TuiExecInfoContent simpleString;    /* simple char based elements */
234
  }
235
TuiWhichElement, *TuiWhichElementPtr;
236
 
237
typedef struct _TuiWinElement
238
  {
239
    int highlight;
240
    TuiWhichElement whichElement;
241
  }
242
TuiWinElement, *TuiWinElementPtr;
243
 
244
 
245
/* This describes the content of the window. */
246
typedef TuiWinElementPtr *TuiWinContent;
247
 
248
 
249
/* This struct defines the specific information about a data display window */
250
typedef struct _TuiDataInfo
251
  {
252
    TuiWinContent dataContent;  /* start of data display content */
253
    int dataContentCount;
254
    TuiWinContent regsContent;  /* start of regs display content */
255
    int regsContentCount;
256
    TuiRegisterDisplayType regsDisplayType;
257
    int regsColumnCount;
258
    int displayRegs;            /* Should regs be displayed at all? */
259
  }
260
TuiDataInfo, *TuiDataInfoPtr;
261
 
262
 
263
typedef struct _TuiSourceInfo
264
  {
265
    int hasLocator;             /* Does locator belongs to this window? */
266
    TuiGenWinInfoPtr executionInfo;     /* execution information window */
267
    int horizontalOffset;       /* used for horizontal scroll */
268
    TuiLineOrAddress startLineOrAddr;
269
    char* filename;
270
  }
271
TuiSourceInfo, *TuiSourceInfoPtr;
272
 
273
 
274
typedef struct _TuiCommandInfo
275
  {
276
    int curLine;                /* The current line position */
277
    int curch;                  /* The current cursor position */
278
    int start_line;
279
  }
280
TuiCommandInfo, *TuiCommandInfoPtr;
281
 
282
 
283
/* This defines information about each logical window */
284
typedef struct _TuiWinInfo
285
  {
286
    TuiGenWinInfo generic;      /* general window information */
287
    union
288
      {
289
        TuiSourceInfo sourceInfo;
290
        TuiDataInfo dataDisplayInfo;
291
        TuiCommandInfo commandInfo;
292
        Opaque opaque;
293
      }
294
    detail;
295
    int canHighlight;           /* Can this window ever be highlighted? */
296
    int isHighlighted;          /* Is this window highlighted? */
297
  }
298
TuiWinInfo, *TuiWinInfoPtr;
299
 
300
/* MACROS (prefixed with m_) */
301
 
302
/* Testing macros */
303
#define        m_genWinPtrIsNull(winInfo) \
304
                ((winInfo) == (TuiGenWinInfoPtr)NULL)
305
#define        m_genWinPtrNotNull(winInfo) \
306
                ((winInfo) != (TuiGenWinInfoPtr)NULL)
307
#define        m_winPtrIsNull(winInfo) \
308
                ((winInfo) == (TuiWinInfoPtr)NULL)
309
#define        m_winPtrNotNull(winInfo) \
310
                ((winInfo) != (TuiWinInfoPtr)NULL)
311
 
312
#define        m_winIsSourceType(type) \
313
                (type == SRC_WIN || type == DISASSEM_WIN)
314
#define        m_winIsAuxillary(winType) \
315
                (winType > MAX_MAJOR_WINDOWS)
316
#define        m_hasLocator(winInfo) \
317
                ( ((winInfo) != (TuiWinInfoPtr)NULL) ? \
318
                    (winInfo->detail.sourceInfo.hasLocator) : \
319
                    FALSE )
320
 
321
#define     m_setWinHighlightOn(winInfo) \
322
                if ((winInfo) != (TuiWinInfoPtr)NULL) \
323
                              (winInfo)->isHighlighted = TRUE
324
#define     m_setWinHighlightOff(winInfo) \
325
                if ((winInfo) != (TuiWinInfoPtr)NULL) \
326
                              (winInfo)->isHighlighted = FALSE
327
 
328
 
329
/* Global Data */
330
extern TuiWinInfoPtr winList[MAX_MAJOR_WINDOWS];
331
extern int tui_version;
332
 
333
/* Macros */
334
#define srcWin            winList[SRC_WIN]
335
#define disassemWin       winList[DISASSEM_WIN]
336
#define dataWin           winList[DATA_WIN]
337
#define cmdWin            winList[CMD_WIN]
338
 
339
/* Data Manipulation Functions */
340
extern void initializeStaticData (void);
341
extern TuiGenWinInfoPtr allocGenericWinInfo (void);
342
extern TuiWinInfoPtr allocWinInfo (TuiWinType);
343
extern void initGenericPart (TuiGenWinInfoPtr);
344
extern void initWinInfo (TuiWinInfoPtr);
345
extern TuiWinContent allocContent (int, TuiWinType);
346
extern int addContentElements (TuiGenWinInfoPtr, int);
347
extern void initContentElement (TuiWinElementPtr, TuiWinType);
348
extern void freeWindow (TuiWinInfoPtr);
349
extern void freeWinContent (TuiGenWinInfoPtr);
350
extern void freeDataContent (TuiWinContent, int);
351
extern void freeAllSourceWinsContent (void);
352
extern void tuiDelWindow (TuiWinInfoPtr);
353
extern void tuiDelDataWindows (TuiWinContent, int);
354
extern TuiWinInfoPtr partialWinByName (char *);
355
extern char *winName (TuiGenWinInfoPtr);
356
extern TuiLayoutType currentLayout (void);
357
extern void setCurrentLayoutTo (TuiLayoutType);
358
extern int termHeight (void);
359
extern void setTermHeightTo (int);
360
extern int termWidth (void);
361
extern void setTermWidthTo (int);
362
extern void setGenWinOrigin (TuiGenWinInfoPtr, int, int);
363
extern TuiGenWinInfoPtr locatorWinInfoPtr (void);
364
extern TuiGenWinInfoPtr sourceExecInfoWinPtr (void);
365
extern TuiGenWinInfoPtr disassemExecInfoWinPtr (void);
366
extern TuiListPtr sourceWindows (void);
367
extern void clearSourceWindows (void);
368
extern void clearSourceWindowsDetail (void);
369
extern void clearWinDetail (TuiWinInfoPtr winInfo);
370
extern void tuiAddToSourceWindows (TuiWinInfoPtr);
371
extern int tuiDefaultTabLen (void);
372
extern void tuiSetDefaultTabLen (int);
373
extern TuiWinInfoPtr tuiWinWithFocus (void);
374
extern void tuiSetWinWithFocus (TuiWinInfoPtr);
375
extern TuiLayoutDefPtr tuiLayoutDef (void);
376
extern int tuiWinResized (void);
377
extern void tuiSetWinResizedTo (int);
378
 
379
extern TuiWinInfoPtr tuiNextWin (TuiWinInfoPtr);
380
extern TuiWinInfoPtr tuiPrevWin (TuiWinInfoPtr);
381
 
382
extern void addToSourceWindows (TuiWinInfoPtr winInfo);
383
 
384
#endif /* TUI_DATA_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.