2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui-command.c: Change variable and function names to lower case. * tui/tui-data.c, tui/tui-disasm.c: Ditto. * tui/tui-hooks.c, tui/tui-io.c, tui/tui-layout.c: Ditto. * tui/tui-regs.c, tui/tui-source.c, tui/tui-stack.c: Ditto. * tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto. * tui/tui-winsource.c, tui/tui.c: Ditto.
This commit is contained in:
parent
6d26006ec8
commit
6ba8e26f70
@ -1,3 +1,13 @@
|
||||
2004-02-07 Andrew Cagney <cagney@redhat.com>
|
||||
|
||||
* tui/tui-command.c: Change variable and function names to lower
|
||||
case.
|
||||
* tui/tui-data.c, tui/tui-disasm.c: Ditto.
|
||||
* tui/tui-hooks.c, tui/tui-io.c, tui/tui-layout.c: Ditto.
|
||||
* tui/tui-regs.c, tui/tui-source.c, tui/tui-stack.c: Ditto.
|
||||
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
|
||||
* tui/tui-winsource.c, tui/tui.c: Ditto.
|
||||
|
||||
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* buildsym.c (free_pending_blocks, finish_block)
|
||||
|
@ -64,7 +64,7 @@ tui_dispatch_ctrl_char (unsigned int ch)
|
||||
return ch;
|
||||
else
|
||||
{
|
||||
unsigned int c = 0, chCopy = ch;
|
||||
unsigned int c = 0, ch_copy = ch;
|
||||
register int i;
|
||||
char *term;
|
||||
|
||||
@ -77,31 +77,32 @@ tui_dispatch_ctrl_char (unsigned int ch)
|
||||
term[i] = toupper (term[i]);
|
||||
if ((strcmp (term, "XTERM") == 0) && key_is_start_sequence (ch))
|
||||
{
|
||||
unsigned int pageCh = 0, tmpChar;
|
||||
unsigned int page_ch = 0;
|
||||
unsigned int tmp_char;
|
||||
|
||||
tmpChar = 0;
|
||||
while (!key_is_end_sequence (tmpChar))
|
||||
tmp_char = 0;
|
||||
while (!key_is_end_sequence (tmp_char))
|
||||
{
|
||||
tmpChar = (int) wgetch (w);
|
||||
if (tmpChar == ERR)
|
||||
tmp_char = (int) wgetch (w);
|
||||
if (tmp_char == ERR)
|
||||
{
|
||||
return ch;
|
||||
}
|
||||
if (!tmpChar)
|
||||
if (!tmp_char)
|
||||
break;
|
||||
if (tmpChar == 53)
|
||||
pageCh = KEY_PPAGE;
|
||||
else if (tmpChar == 54)
|
||||
pageCh = KEY_NPAGE;
|
||||
if (tmp_char == 53)
|
||||
page_ch = KEY_PPAGE;
|
||||
else if (tmp_char == 54)
|
||||
page_ch = KEY_NPAGE;
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
chCopy = pageCh;
|
||||
ch_copy = page_ch;
|
||||
}
|
||||
|
||||
switch (chCopy)
|
||||
switch (ch_copy)
|
||||
{
|
||||
case KEY_NPAGE:
|
||||
tui_scroll_forward (win_info, 0);
|
||||
@ -127,7 +128,7 @@ tui_dispatch_ctrl_char (unsigned int ch)
|
||||
tui_refresh_all_win ();
|
||||
break;
|
||||
default:
|
||||
c = chCopy;
|
||||
c = ch_copy;
|
||||
break;
|
||||
}
|
||||
return c;
|
||||
|
@ -46,27 +46,27 @@ struct tui_win_info *(tui_win_list[MAX_MAJOR_WINDOWS]);
|
||||
/***************************
|
||||
** Private data
|
||||
****************************/
|
||||
static enum tui_layout_type _currentLayout = UNDEFINED_LAYOUT;
|
||||
static int _termHeight, _termWidth;
|
||||
static enum tui_layout_type current_layout = UNDEFINED_LAYOUT;
|
||||
static int term_height, term_width;
|
||||
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 = {(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 =
|
||||
{SRC_WIN, /* displayMode */
|
||||
FALSE, /* split */
|
||||
TUI_UNDEFINED_REGS, /* regsDisplayType */
|
||||
TUI_SFLOAT_REGS}; /* floatRegsDisplayType */
|
||||
static int _winResized = FALSE;
|
||||
static struct tui_gen_win_info exec_info[2];
|
||||
static struct tui_win_info * src_win_list[2];
|
||||
static struct tui_list source_windows = {(void **) src_win_list, 0};
|
||||
static int default_tab_len = DEFAULT_TAB_LEN;
|
||||
static struct tui_win_info * win_with_focus = (struct tui_win_info *) NULL;
|
||||
static struct tui_layout_def layout_def =
|
||||
{SRC_WIN, /* DISPLAY_MODE */
|
||||
FALSE, /* SPLIT */
|
||||
TUI_UNDEFINED_REGS, /* REGS_DISPLAY_TYPE */
|
||||
TUI_SFLOAT_REGS}; /* FLOAT_REGS_DISPLAY_TYPE */
|
||||
static int win_resized = FALSE;
|
||||
|
||||
|
||||
/*********************************
|
||||
** Static function forward decls
|
||||
**********************************/
|
||||
static void freeContent (tui_win_content, int, enum tui_win_type);
|
||||
static void freeContentElements (tui_win_content, int, enum tui_win_type);
|
||||
static void free_content (tui_win_content, int, enum tui_win_type);
|
||||
static void free_content_elements (tui_win_content, int, enum tui_win_type);
|
||||
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ tui_set_win_highlight (struct tui_win_info *win_info, int highlight)
|
||||
int
|
||||
tui_win_resized (void)
|
||||
{
|
||||
return _winResized;
|
||||
return win_resized;
|
||||
}
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ tui_win_resized (void)
|
||||
void
|
||||
tui_set_win_resized_to (int resized)
|
||||
{
|
||||
_winResized = resized;
|
||||
win_resized = resized;
|
||||
}
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ tui_set_win_resized_to (int resized)
|
||||
struct tui_layout_def *
|
||||
tui_layout_def (void)
|
||||
{
|
||||
return &_layoutDef;
|
||||
return &layout_def;
|
||||
}
|
||||
|
||||
|
||||
@ -132,7 +132,7 @@ tui_layout_def (void)
|
||||
struct tui_win_info *
|
||||
tui_win_with_focus (void)
|
||||
{
|
||||
return _winWithFocus;
|
||||
return win_with_focus;
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ tui_win_with_focus (void)
|
||||
void
|
||||
tui_set_win_with_focus (struct tui_win_info * win_info)
|
||||
{
|
||||
_winWithFocus = win_info;
|
||||
win_with_focus = win_info;
|
||||
}
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@ tui_set_win_with_focus (struct tui_win_info * win_info)
|
||||
int
|
||||
tui_default_tab_len (void)
|
||||
{
|
||||
return _defaultTabLen;
|
||||
return default_tab_len;
|
||||
}
|
||||
|
||||
|
||||
@ -156,20 +156,17 @@ tui_default_tab_len (void)
|
||||
void
|
||||
tui_set_default_tab_len (int len)
|
||||
{
|
||||
_defaultTabLen = len;
|
||||
default_tab_len = len;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** currentSourceWin()
|
||||
** Accessor for the current source window. Usually there is only
|
||||
** one source window (either source or disassembly), but both can
|
||||
** be displayed at the same time.
|
||||
*/
|
||||
/* Accessor for the current source window. Usually there is only one
|
||||
source window (either source or disassembly), but both can be
|
||||
displayed at the same time. */
|
||||
struct tui_list *
|
||||
tui_source_windows (void)
|
||||
{
|
||||
return &_sourceWindows;
|
||||
return &source_windows;
|
||||
}
|
||||
|
||||
|
||||
@ -179,9 +176,9 @@ tui_source_windows (void)
|
||||
void
|
||||
tui_clear_source_windows (void)
|
||||
{
|
||||
_sourceWindows.list[0] = NULL;
|
||||
_sourceWindows.list[1] = NULL;
|
||||
_sourceWindows.count = 0;
|
||||
source_windows.list[0] = NULL;
|
||||
source_windows.list[1] = NULL;
|
||||
source_windows.count = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -202,8 +199,8 @@ tui_clear_source_windows_detail (void)
|
||||
void
|
||||
tui_add_to_source_windows (struct tui_win_info * win_info)
|
||||
{
|
||||
if (_sourceWindows.count < 2)
|
||||
_sourceWindows.list[_sourceWindows.count++] = (void *) win_info;
|
||||
if (source_windows.count < 2)
|
||||
source_windows.list[source_windows.count++] = (void *) win_info;
|
||||
}
|
||||
|
||||
|
||||
@ -240,31 +237,23 @@ tui_clear_win_detail (struct tui_win_info * win_info)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
} /* clearWinDetail */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** sourceExecInfoPtr().
|
||||
** Accessor for the source execution info ptr.
|
||||
*/
|
||||
/* Accessor for the source execution info ptr. */
|
||||
struct tui_gen_win_info *
|
||||
tui_source_exec_info_win_ptr (void)
|
||||
{
|
||||
return &_execInfo[0];
|
||||
} /* sourceExecInfoWinPtr */
|
||||
return &exec_info[0];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** disassemExecInfoPtr().
|
||||
** Accessor for the disassem execution info ptr.
|
||||
*/
|
||||
/* Accessor for the disassem execution info ptr. */
|
||||
struct tui_gen_win_info *
|
||||
tui_disassem_exec_info_win_ptr (void)
|
||||
{
|
||||
return &_execInfo[1];
|
||||
} /* disassemExecInfoWinPtr */
|
||||
return &exec_info[1];
|
||||
}
|
||||
|
||||
|
||||
/* Accessor for the locator win info. Answers a pointer to the static
|
||||
@ -276,11 +265,11 @@ tui_locator_win_info_ptr (void)
|
||||
}
|
||||
|
||||
|
||||
/* Accessor for the termHeight. */
|
||||
/* Accessor for the term_height. */
|
||||
int
|
||||
tui_term_height (void)
|
||||
{
|
||||
return _termHeight;
|
||||
return term_height;
|
||||
}
|
||||
|
||||
|
||||
@ -288,23 +277,23 @@ tui_term_height (void)
|
||||
void
|
||||
tui_set_term_height_to (int h)
|
||||
{
|
||||
_termHeight = h;
|
||||
term_height = h;
|
||||
}
|
||||
|
||||
|
||||
/* Accessor for the termWidth. */
|
||||
/* Accessor for the term_width. */
|
||||
int
|
||||
tui_term_width (void)
|
||||
{
|
||||
return _termWidth;
|
||||
return term_width;
|
||||
}
|
||||
|
||||
|
||||
/* Mutator for the termWidth. */
|
||||
/* Mutator for the term_width. */
|
||||
void
|
||||
tui_set_term_width_to (int w)
|
||||
{
|
||||
_termWidth = w;
|
||||
term_width = w;
|
||||
}
|
||||
|
||||
|
||||
@ -312,30 +301,25 @@ tui_set_term_width_to (int w)
|
||||
enum tui_layout_type
|
||||
tui_current_layout (void)
|
||||
{
|
||||
return _currentLayout;
|
||||
return current_layout;
|
||||
}
|
||||
|
||||
|
||||
/* Mutator for the current layout. */
|
||||
void
|
||||
tui_set_current_layout_to (enum tui_layout_type newLayout)
|
||||
tui_set_current_layout_to (enum tui_layout_type new_layout)
|
||||
{
|
||||
_currentLayout = newLayout;
|
||||
current_layout = new_layout;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** setGenWinOrigin().
|
||||
** Set the origin of the window
|
||||
*/
|
||||
/* Set the origin of the window. */
|
||||
void
|
||||
setGenWinOrigin (struct tui_gen_win_info * win_info, int x, int y)
|
||||
set_gen_win_origin (struct tui_gen_win_info * win_info, int x, int y)
|
||||
{
|
||||
win_info->origin.x = x;
|
||||
win_info->origin.y = y;
|
||||
|
||||
return;
|
||||
} /* setGenWinOrigin */
|
||||
}
|
||||
|
||||
|
||||
/*****************************
|
||||
@ -346,19 +330,19 @@ setGenWinOrigin (struct tui_gen_win_info * win_info, int x, int y)
|
||||
/* Answer the next window in the list, cycling back to the top if
|
||||
necessary. */
|
||||
struct tui_win_info *
|
||||
tui_next_win (struct tui_win_info * curWin)
|
||||
tui_next_win (struct tui_win_info * cur_win)
|
||||
{
|
||||
enum tui_win_type type = curWin->generic.type;
|
||||
struct tui_win_info * nextWin = (struct tui_win_info *) NULL;
|
||||
enum tui_win_type type = cur_win->generic.type;
|
||||
struct tui_win_info * next_win = (struct tui_win_info *) NULL;
|
||||
|
||||
if (curWin->generic.type == CMD_WIN)
|
||||
if (cur_win->generic.type == CMD_WIN)
|
||||
type = SRC_WIN;
|
||||
else
|
||||
type = curWin->generic.type + 1;
|
||||
while (type != curWin->generic.type && (nextWin == NULL))
|
||||
type = cur_win->generic.type + 1;
|
||||
while (type != cur_win->generic.type && (next_win == NULL))
|
||||
{
|
||||
if (tui_win_list[type] && tui_win_list[type]->generic.is_visible)
|
||||
nextWin = tui_win_list[type];
|
||||
next_win = tui_win_list[type];
|
||||
else
|
||||
{
|
||||
if (type == CMD_WIN)
|
||||
@ -368,23 +352,23 @@ tui_next_win (struct tui_win_info * curWin)
|
||||
}
|
||||
}
|
||||
|
||||
return nextWin;
|
||||
} /* tuiNextWin */
|
||||
return next_win;
|
||||
}
|
||||
|
||||
|
||||
/* Answer the prev window in the list, cycling back to the bottom if
|
||||
necessary. */
|
||||
struct tui_win_info *
|
||||
tui_prev_win (struct tui_win_info * curWin)
|
||||
tui_prev_win (struct tui_win_info * cur_win)
|
||||
{
|
||||
enum tui_win_type type = curWin->generic.type;
|
||||
enum tui_win_type type = cur_win->generic.type;
|
||||
struct tui_win_info * prev = (struct tui_win_info *) NULL;
|
||||
|
||||
if (curWin->generic.type == SRC_WIN)
|
||||
if (cur_win->generic.type == SRC_WIN)
|
||||
type = CMD_WIN;
|
||||
else
|
||||
type = curWin->generic.type - 1;
|
||||
while (type != curWin->generic.type && (prev == NULL))
|
||||
type = cur_win->generic.type - 1;
|
||||
while (type != cur_win->generic.type && (prev == NULL))
|
||||
{
|
||||
if (tui_win_list[type]->generic.is_visible)
|
||||
prev = tui_win_list[type];
|
||||
@ -415,9 +399,9 @@ tui_partial_win_by_name (char *name)
|
||||
{
|
||||
if (tui_win_list[i] != 0)
|
||||
{
|
||||
char *curName = tui_win_name (&tui_win_list[i]->generic);
|
||||
if (strlen (name) <= strlen (curName) &&
|
||||
strncmp (name, curName, strlen (name)) == 0)
|
||||
char *cur_name = tui_win_name (&tui_win_list[i]->generic);
|
||||
if (strlen (name) <= strlen (cur_name) &&
|
||||
strncmp (name, cur_name, strlen (name)) == 0)
|
||||
win_info = tui_win_list[i];
|
||||
}
|
||||
i++;
|
||||
@ -425,13 +409,10 @@ tui_partial_win_by_name (char *name)
|
||||
}
|
||||
|
||||
return win_info;
|
||||
} /* partialWinByName */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** winName().
|
||||
** Answer the name of the window
|
||||
*/
|
||||
/* Answer the name of the window. */
|
||||
char *
|
||||
tui_win_name (struct tui_gen_win_info * win_info)
|
||||
{
|
||||
@ -457,7 +438,7 @@ tui_win_name (struct tui_gen_win_info * win_info)
|
||||
}
|
||||
|
||||
return name;
|
||||
} /* winName */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@ -479,12 +460,9 @@ tui_alloc_generic_win_info (void)
|
||||
tui_init_generic_part (win);
|
||||
|
||||
return win;
|
||||
} /* allocGenericWinInfo */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** initGenericPart().
|
||||
*/
|
||||
void
|
||||
tui_init_generic_part (struct tui_gen_win_info * win)
|
||||
{
|
||||
@ -504,10 +482,10 @@ tui_init_generic_part (struct tui_gen_win_info * win)
|
||||
|
||||
|
||||
/*
|
||||
** initContentElement().
|
||||
** init_content_element().
|
||||
*/
|
||||
void
|
||||
initContentElement (struct tui_win_element * element, enum tui_win_type type)
|
||||
init_content_element (struct tui_win_element * element, enum tui_win_type type)
|
||||
{
|
||||
element->highlight = FALSE;
|
||||
switch (type)
|
||||
@ -550,14 +528,10 @@ initContentElement (struct tui_win_element * element, enum tui_win_type type)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return;
|
||||
} /* initContentElement */
|
||||
}
|
||||
|
||||
/*
|
||||
** initWinInfo().
|
||||
*/
|
||||
void
|
||||
initWinInfo (struct tui_win_info * win_info)
|
||||
init_win_info (struct tui_win_info * win_info)
|
||||
{
|
||||
tui_init_generic_part (&win_info->generic);
|
||||
win_info->can_highlight =
|
||||
@ -590,9 +564,7 @@ initWinInfo (struct tui_win_info * win_info)
|
||||
win_info->detail.opaque = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
} /* initWinInfo */
|
||||
}
|
||||
|
||||
|
||||
struct tui_win_info *
|
||||
@ -604,26 +576,23 @@ tui_alloc_win_info (enum tui_win_type type)
|
||||
if ((win_info != NULL))
|
||||
{
|
||||
win_info->generic.type = type;
|
||||
initWinInfo (win_info);
|
||||
init_win_info (win_info);
|
||||
}
|
||||
|
||||
return win_info;
|
||||
} /* allocWinInfo */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** allocContent().
|
||||
** Allocates the content and elements in a block.
|
||||
*/
|
||||
/* Allocates the content and elements in a block. */
|
||||
tui_win_content
|
||||
tui_alloc_content (int numElements, enum tui_win_type type)
|
||||
tui_alloc_content (int num_elements, enum tui_win_type type)
|
||||
{
|
||||
tui_win_content content = (tui_win_content) NULL;
|
||||
char *elementBlockPtr = (char *) NULL;
|
||||
char *element_block_ptr = (char *) NULL;
|
||||
int i;
|
||||
|
||||
if ((content = (tui_win_content)
|
||||
xmalloc (sizeof (struct tui_win_element *) * numElements)) != (tui_win_content) NULL)
|
||||
xmalloc (sizeof (struct tui_win_element *) * num_elements)) != (tui_win_content) NULL)
|
||||
{ /*
|
||||
** All windows, except the data window, can allocate the elements
|
||||
** in a chunk. The data window cannot because items can be
|
||||
@ -631,14 +600,14 @@ tui_alloc_content (int numElements, enum tui_win_type type)
|
||||
*/
|
||||
if (type != DATA_WIN)
|
||||
{
|
||||
if ((elementBlockPtr = (char *)
|
||||
xmalloc (sizeof (struct tui_win_element) * numElements)) != (char *) NULL)
|
||||
if ((element_block_ptr = (char *)
|
||||
xmalloc (sizeof (struct tui_win_element) * num_elements)) != (char *) NULL)
|
||||
{
|
||||
for (i = 0; i < numElements; i++)
|
||||
for (i = 0; i < num_elements; i++)
|
||||
{
|
||||
content[i] = (struct tui_win_element *) elementBlockPtr;
|
||||
initContentElement (content[i], type);
|
||||
elementBlockPtr += sizeof (struct tui_win_element);
|
||||
content[i] = (struct tui_win_element *) element_block_ptr;
|
||||
init_content_element (content[i], type);
|
||||
element_block_ptr += sizeof (struct tui_win_element);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -650,36 +619,36 @@ tui_alloc_content (int numElements, enum tui_win_type type)
|
||||
}
|
||||
|
||||
return content;
|
||||
} /* allocContent */
|
||||
}
|
||||
|
||||
|
||||
/* Adds the input number of elements to the windows's content. If no
|
||||
content has been allocated yet, allocContent() is called to do
|
||||
content has been allocated yet, alloc_content() is called to do
|
||||
this. The index of the first element added is returned, unless
|
||||
there is a memory allocation error, in which case, (-1) is
|
||||
returned. */
|
||||
int
|
||||
tui_add_content_elements (struct tui_gen_win_info * win_info, int numElements)
|
||||
tui_add_content_elements (struct tui_gen_win_info * win_info, int num_elements)
|
||||
{
|
||||
struct tui_win_element * elementPtr;
|
||||
int i, indexStart;
|
||||
struct tui_win_element * element_ptr;
|
||||
int i, index_start;
|
||||
|
||||
if (win_info->content == NULL)
|
||||
{
|
||||
win_info->content = (void **) tui_alloc_content (numElements, win_info->type);
|
||||
indexStart = 0;
|
||||
win_info->content = (void **) tui_alloc_content (num_elements, win_info->type);
|
||||
index_start = 0;
|
||||
}
|
||||
else
|
||||
indexStart = win_info->content_size;
|
||||
index_start = win_info->content_size;
|
||||
if (win_info->content != NULL)
|
||||
{
|
||||
for (i = indexStart; (i < numElements + indexStart); i++)
|
||||
for (i = index_start; (i < num_elements + index_start); i++)
|
||||
{
|
||||
if ((elementPtr = (struct tui_win_element *)
|
||||
if ((element_ptr = (struct tui_win_element *)
|
||||
xmalloc (sizeof (struct tui_win_element))) != (struct tui_win_element *) NULL)
|
||||
{
|
||||
win_info->content[i] = (void *) elementPtr;
|
||||
initContentElement (elementPtr, win_info->type);
|
||||
win_info->content[i] = (void *) element_ptr;
|
||||
init_content_element (element_ptr, win_info->type);
|
||||
win_info->content_size++;
|
||||
}
|
||||
else /* things must be really hosed now! We ran out of memory!? */
|
||||
@ -687,39 +656,39 @@ tui_add_content_elements (struct tui_gen_win_info * win_info, int numElements)
|
||||
}
|
||||
}
|
||||
|
||||
return indexStart;
|
||||
} /* addContentElements */
|
||||
return index_start;
|
||||
}
|
||||
|
||||
|
||||
/* Delete all curses windows associated with win_info, leaving everything
|
||||
else intact. */
|
||||
void
|
||||
tuiDelWindow (struct tui_win_info * win_info)
|
||||
tui_del_window (struct tui_win_info * win_info)
|
||||
{
|
||||
struct tui_gen_win_info * genericWin;
|
||||
struct tui_gen_win_info * generic_win;
|
||||
|
||||
switch (win_info->generic.type)
|
||||
{
|
||||
case SRC_WIN:
|
||||
case DISASSEM_WIN:
|
||||
genericWin = tui_locator_win_info_ptr ();
|
||||
if (genericWin != (struct tui_gen_win_info *) NULL)
|
||||
generic_win = tui_locator_win_info_ptr ();
|
||||
if (generic_win != (struct tui_gen_win_info *) NULL)
|
||||
{
|
||||
tui_delete_win (genericWin->handle);
|
||||
genericWin->handle = (WINDOW *) NULL;
|
||||
genericWin->is_visible = FALSE;
|
||||
tui_delete_win (generic_win->handle);
|
||||
generic_win->handle = (WINDOW *) NULL;
|
||||
generic_win->is_visible = FALSE;
|
||||
}
|
||||
if (win_info->detail.source_info.filename)
|
||||
{
|
||||
xfree (win_info->detail.source_info.filename);
|
||||
win_info->detail.source_info.filename = 0;
|
||||
}
|
||||
genericWin = win_info->detail.source_info.execution_info;
|
||||
if (genericWin != (struct tui_gen_win_info *) NULL)
|
||||
generic_win = win_info->detail.source_info.execution_info;
|
||||
if (generic_win != (struct tui_gen_win_info *) NULL)
|
||||
{
|
||||
tui_delete_win (genericWin->handle);
|
||||
genericWin->handle = (WINDOW *) NULL;
|
||||
genericWin->is_visible = FALSE;
|
||||
tui_delete_win (generic_win->handle);
|
||||
generic_win->handle = (WINDOW *) NULL;
|
||||
generic_win->is_visible = FALSE;
|
||||
}
|
||||
break;
|
||||
case DATA_WIN:
|
||||
@ -746,30 +715,30 @@ tuiDelWindow (struct tui_win_info * win_info)
|
||||
void
|
||||
tui_free_window (struct tui_win_info * win_info)
|
||||
{
|
||||
struct tui_gen_win_info * genericWin;
|
||||
struct tui_gen_win_info * generic_win;
|
||||
|
||||
switch (win_info->generic.type)
|
||||
{
|
||||
case SRC_WIN:
|
||||
case DISASSEM_WIN:
|
||||
genericWin = tui_locator_win_info_ptr ();
|
||||
if (genericWin != (struct tui_gen_win_info *) NULL)
|
||||
generic_win = tui_locator_win_info_ptr ();
|
||||
if (generic_win != (struct tui_gen_win_info *) NULL)
|
||||
{
|
||||
tui_delete_win (genericWin->handle);
|
||||
genericWin->handle = (WINDOW *) NULL;
|
||||
tui_delete_win (generic_win->handle);
|
||||
generic_win->handle = (WINDOW *) NULL;
|
||||
}
|
||||
tui_free_win_content (genericWin);
|
||||
tui_free_win_content (generic_win);
|
||||
if (win_info->detail.source_info.filename)
|
||||
{
|
||||
xfree (win_info->detail.source_info.filename);
|
||||
win_info->detail.source_info.filename = 0;
|
||||
}
|
||||
genericWin = win_info->detail.source_info.execution_info;
|
||||
if (genericWin != (struct tui_gen_win_info *) NULL)
|
||||
generic_win = win_info->detail.source_info.execution_info;
|
||||
if (generic_win != (struct tui_gen_win_info *) NULL)
|
||||
{
|
||||
tui_delete_win (genericWin->handle);
|
||||
genericWin->handle = (WINDOW *) NULL;
|
||||
tui_free_win_content (genericWin);
|
||||
tui_delete_win (generic_win->handle);
|
||||
generic_win->handle = (WINDOW *) NULL;
|
||||
tui_free_win_content (generic_win);
|
||||
}
|
||||
break;
|
||||
case DATA_WIN:
|
||||
@ -831,19 +800,17 @@ tui_free_win_content (struct tui_gen_win_info * win_info)
|
||||
{
|
||||
if (win_info->content != NULL)
|
||||
{
|
||||
freeContent ((tui_win_content) win_info->content,
|
||||
free_content ((tui_win_content) win_info->content,
|
||||
win_info->content_size,
|
||||
win_info->type);
|
||||
win_info->content = NULL;
|
||||
}
|
||||
win_info->content_size = 0;
|
||||
|
||||
return;
|
||||
} /* freeWinContent */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tui_del_data_windows (tui_win_content content, int contentSize)
|
||||
tui_del_data_windows (tui_win_content content, int content_size)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -851,22 +818,22 @@ tui_del_data_windows (tui_win_content content, int contentSize)
|
||||
** Remember that data window content elements are of type struct tui_gen_win_info *,
|
||||
** each of which whose single element is a data element.
|
||||
*/
|
||||
for (i = 0; i < contentSize; i++)
|
||||
for (i = 0; i < content_size; i++)
|
||||
{
|
||||
struct tui_gen_win_info * genericWin = &content[i]->which_element.data_window;
|
||||
struct tui_gen_win_info * generic_win = &content[i]->which_element.data_window;
|
||||
|
||||
if (genericWin != (struct tui_gen_win_info *) NULL)
|
||||
if (generic_win != (struct tui_gen_win_info *) NULL)
|
||||
{
|
||||
tui_delete_win (genericWin->handle);
|
||||
genericWin->handle = (WINDOW *) NULL;
|
||||
genericWin->is_visible = FALSE;
|
||||
tui_delete_win (generic_win->handle);
|
||||
generic_win->handle = (WINDOW *) NULL;
|
||||
generic_win->is_visible = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tui_free_data_content (tui_win_content content, int contentSize)
|
||||
tui_free_data_content (tui_win_content content, int content_size)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -874,23 +841,21 @@ tui_free_data_content (tui_win_content content, int contentSize)
|
||||
** Remember that data window content elements are of type struct tui_gen_win_info *,
|
||||
** each of which whose single element is a data element.
|
||||
*/
|
||||
for (i = 0; i < contentSize; i++)
|
||||
for (i = 0; i < content_size; i++)
|
||||
{
|
||||
struct tui_gen_win_info * genericWin = &content[i]->which_element.data_window;
|
||||
struct tui_gen_win_info * generic_win = &content[i]->which_element.data_window;
|
||||
|
||||
if (genericWin != (struct tui_gen_win_info *) NULL)
|
||||
if (generic_win != (struct tui_gen_win_info *) NULL)
|
||||
{
|
||||
tui_delete_win (genericWin->handle);
|
||||
genericWin->handle = (WINDOW *) NULL;
|
||||
tui_free_win_content (genericWin);
|
||||
tui_delete_win (generic_win->handle);
|
||||
generic_win->handle = (WINDOW *) NULL;
|
||||
tui_free_win_content (generic_win);
|
||||
}
|
||||
}
|
||||
freeContent (content,
|
||||
contentSize,
|
||||
free_content (content,
|
||||
content_size,
|
||||
DATA_WIN);
|
||||
|
||||
return;
|
||||
} /* freeDataContent */
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
@ -898,27 +863,22 @@ tui_free_data_content (tui_win_content content, int contentSize)
|
||||
**********************************/
|
||||
|
||||
|
||||
/*
|
||||
** freeContent().
|
||||
*/
|
||||
static void
|
||||
freeContent (tui_win_content content, int contentSize, enum tui_win_type winType)
|
||||
free_content (tui_win_content content, int content_size, enum tui_win_type win_type)
|
||||
{
|
||||
if (content != (tui_win_content) NULL)
|
||||
{
|
||||
freeContentElements (content, contentSize, winType);
|
||||
free_content_elements (content, content_size, win_type);
|
||||
xfree (content);
|
||||
}
|
||||
|
||||
return;
|
||||
} /* freeContent */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** freeContentElements().
|
||||
** free_content_elements().
|
||||
*/
|
||||
static void
|
||||
freeContentElements (tui_win_content content, int contentSize, enum tui_win_type type)
|
||||
free_content_elements (tui_win_content content, int content_size, enum tui_win_type type)
|
||||
{
|
||||
if (content != (tui_win_content) NULL)
|
||||
{
|
||||
@ -931,7 +891,7 @@ freeContentElements (tui_win_content content, int contentSize, enum tui_win_type
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < contentSize; i++)
|
||||
for (i = 0; i < content_size; i++)
|
||||
{
|
||||
struct tui_win_element * element;
|
||||
|
||||
@ -965,6 +925,4 @@ freeContentElements (tui_win_content content, int contentSize, enum tui_win_type
|
||||
if (type != DATA_WIN && type != DATA_ITEM_WIN)
|
||||
xfree (content[0]); /* free the element block */
|
||||
}
|
||||
|
||||
return;
|
||||
} /* freeContentElements */
|
||||
}
|
||||
|
@ -95,24 +95,24 @@ tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
|
||||
static CORE_ADDR
|
||||
tui_find_disassembly_address (CORE_ADDR pc, int from)
|
||||
{
|
||||
register CORE_ADDR newLow;
|
||||
int maxLines;
|
||||
register CORE_ADDR new_low;
|
||||
int max_lines;
|
||||
int i;
|
||||
struct tui_asm_line* lines;
|
||||
|
||||
maxLines = (from > 0) ? from : - from;
|
||||
if (maxLines <= 1)
|
||||
max_lines = (from > 0) ? from : - from;
|
||||
if (max_lines <= 1)
|
||||
return pc;
|
||||
|
||||
lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
|
||||
* maxLines);
|
||||
memset (lines, 0, sizeof (struct tui_asm_line) * maxLines);
|
||||
* max_lines);
|
||||
memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
|
||||
|
||||
newLow = pc;
|
||||
new_low = pc;
|
||||
if (from > 0)
|
||||
{
|
||||
tui_disassemble (lines, pc, maxLines);
|
||||
newLow = lines[maxLines - 1].addr;
|
||||
tui_disassemble (lines, pc, max_lines);
|
||||
new_low = lines[max_lines - 1].addr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -123,17 +123,17 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
|
||||
/* Find backward an address which is a symbol
|
||||
and for which disassembling from that address will fill
|
||||
completely the window. */
|
||||
pos = maxLines - 1;
|
||||
pos = max_lines - 1;
|
||||
do {
|
||||
newLow -= 1 * maxLines;
|
||||
msymbol = lookup_minimal_symbol_by_pc_section (newLow, 0);
|
||||
new_low -= 1 * max_lines;
|
||||
msymbol = lookup_minimal_symbol_by_pc_section (new_low, 0);
|
||||
|
||||
if (msymbol)
|
||||
newLow = SYMBOL_VALUE_ADDRESS (msymbol);
|
||||
new_low = SYMBOL_VALUE_ADDRESS (msymbol);
|
||||
else
|
||||
newLow += 1 * maxLines;
|
||||
new_low += 1 * max_lines;
|
||||
|
||||
tui_disassemble (lines, newLow, maxLines);
|
||||
tui_disassemble (lines, new_low, max_lines);
|
||||
last_addr = lines[pos].addr;
|
||||
} while (last_addr > pc && msymbol);
|
||||
|
||||
@ -148,7 +148,7 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
|
||||
CORE_ADDR next_addr;
|
||||
|
||||
pos++;
|
||||
if (pos >= maxLines)
|
||||
if (pos >= max_lines)
|
||||
pos = 0;
|
||||
|
||||
next_addr = tui_disassemble (&lines[pos], last_addr, 1);
|
||||
@ -159,16 +159,16 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
|
||||
last_addr = next_addr;
|
||||
} while (last_addr <= pc);
|
||||
pos++;
|
||||
if (pos >= maxLines)
|
||||
if (pos >= max_lines)
|
||||
pos = 0;
|
||||
newLow = lines[pos].addr;
|
||||
new_low = lines[pos].addr;
|
||||
}
|
||||
for (i = 0; i < maxLines; i++)
|
||||
for (i = 0; i < max_lines; i++)
|
||||
{
|
||||
xfree (lines[i].addr_string);
|
||||
xfree (lines[i].insn);
|
||||
}
|
||||
return newLow;
|
||||
return new_low;
|
||||
}
|
||||
|
||||
/* Function to set the disassembly window's content. */
|
||||
@ -178,7 +178,7 @@ tui_set_disassem_content (CORE_ADDR pc)
|
||||
enum tui_status ret = TUI_FAILURE;
|
||||
register int i;
|
||||
int offset = TUI_DISASM_WIN->detail.source_info.horizontal_offset;
|
||||
register int lineWidth, maxLines;
|
||||
register int line_width, max_lines;
|
||||
CORE_ADDR cur_pc;
|
||||
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
|
||||
int tab_len = tui_default_tab_len ();
|
||||
@ -198,21 +198,21 @@ tui_set_disassem_content (CORE_ADDR pc)
|
||||
cur_pc = (CORE_ADDR)
|
||||
(((struct tui_win_element *) locator->content[0])->which_element.locator.addr);
|
||||
|
||||
maxLines = TUI_DISASM_WIN->generic.height - 2; /* account for hilite */
|
||||
max_lines = TUI_DISASM_WIN->generic.height - 2; /* account for hilite */
|
||||
|
||||
/* Get temporary table that will hold all strings (addr & insn). */
|
||||
lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
|
||||
* maxLines);
|
||||
memset (lines, 0, sizeof (struct tui_asm_line) * maxLines);
|
||||
* max_lines);
|
||||
memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
|
||||
|
||||
lineWidth = TUI_DISASM_WIN->generic.width - 1;
|
||||
line_width = TUI_DISASM_WIN->generic.width - 1;
|
||||
|
||||
tui_disassemble (lines, pc, maxLines);
|
||||
tui_disassemble (lines, pc, max_lines);
|
||||
|
||||
/* See what is the maximum length of an address and of a line. */
|
||||
addr_size = 0;
|
||||
max_size = 0;
|
||||
for (i = 0; i < maxLines; i++)
|
||||
for (i = 0; i < max_lines; i++)
|
||||
{
|
||||
size_t len = strlen (lines[i].addr_string);
|
||||
if (len > addr_size)
|
||||
@ -229,22 +229,22 @@ tui_set_disassem_content (CORE_ADDR pc)
|
||||
insn_pos = (1 + (addr_size / tab_len)) * tab_len;
|
||||
|
||||
/* Now construct each line */
|
||||
for (i = 0; i < maxLines; i++)
|
||||
for (i = 0; i < max_lines; i++)
|
||||
{
|
||||
struct tui_win_element * element;
|
||||
struct tui_source_element* src;
|
||||
int curLen;
|
||||
int cur_len;
|
||||
|
||||
element = (struct tui_win_element *) TUI_DISASM_WIN->generic.content[i];
|
||||
src = &element->which_element.source;
|
||||
strcpy (line, lines[i].addr_string);
|
||||
curLen = strlen (line);
|
||||
cur_len = strlen (line);
|
||||
|
||||
/* Add spaces to make the instructions start on the same column */
|
||||
while (curLen < insn_pos)
|
||||
while (cur_len < insn_pos)
|
||||
{
|
||||
strcat (line, " ");
|
||||
curLen++;
|
||||
cur_len++;
|
||||
}
|
||||
|
||||
strcat (line, lines[i].insn);
|
||||
@ -272,20 +272,20 @@ tui_set_disassem_content (CORE_ADDR pc)
|
||||
|
||||
/* Function to display the disassembly window with disassembled code. */
|
||||
void
|
||||
tui_show_disassem (CORE_ADDR startAddr)
|
||||
tui_show_disassem (CORE_ADDR start_addr)
|
||||
{
|
||||
struct symtab *s = find_pc_symtab (startAddr);
|
||||
struct tui_win_info * winWithFocus = tui_win_with_focus ();
|
||||
struct symtab *s = find_pc_symtab (start_addr);
|
||||
struct tui_win_info * win_with_focus = tui_win_with_focus ();
|
||||
union tui_line_or_address val;
|
||||
|
||||
val.addr = startAddr;
|
||||
val.addr = start_addr;
|
||||
tui_add_win_to_layout (DISASSEM_WIN);
|
||||
tui_update_source_window (TUI_DISASM_WIN, s, val, FALSE);
|
||||
/*
|
||||
** if the focus was in the src win, put it in the asm win, if the
|
||||
** source view isn't split
|
||||
*/
|
||||
if (tui_current_layout () != SRC_DISASSEM_COMMAND && winWithFocus == TUI_SRC_WIN)
|
||||
if (tui_current_layout () != SRC_DISASSEM_COMMAND && win_with_focus == TUI_SRC_WIN)
|
||||
tui_set_win_focus_to (TUI_DISASM_WIN);
|
||||
|
||||
return;
|
||||
@ -294,11 +294,11 @@ tui_show_disassem (CORE_ADDR startAddr)
|
||||
|
||||
/* Function to display the disassembly window. */
|
||||
void
|
||||
tui_show_disassem_and_update_source (CORE_ADDR startAddr)
|
||||
tui_show_disassem_and_update_source (CORE_ADDR start_addr)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
tui_show_disassem (startAddr);
|
||||
tui_show_disassem (start_addr);
|
||||
if (tui_current_layout () == SRC_DISASSEM_COMMAND)
|
||||
{
|
||||
union tui_line_or_address val;
|
||||
@ -307,7 +307,7 @@ tui_show_disassem_and_update_source (CORE_ADDR startAddr)
|
||||
** Update what is in the source window if it is displayed too,
|
||||
** note that it follows what is in the disassembly window and visa-versa
|
||||
*/
|
||||
sal = find_pc_line (startAddr, 0);
|
||||
sal = find_pc_line (start_addr, 0);
|
||||
val.line_no = sal.line;
|
||||
tui_update_source_window (TUI_SRC_WIN, sal.symtab, val, TRUE);
|
||||
if (sal.symtab)
|
||||
@ -374,8 +374,8 @@ tui_get_low_disassembly_address (CORE_ADDR low, CORE_ADDR pc)
|
||||
|
||||
/* Scroll the disassembly forward or backward vertically. */
|
||||
void
|
||||
tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection,
|
||||
int numToScroll)
|
||||
tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction,
|
||||
int num_to_scroll)
|
||||
{
|
||||
if (TUI_DISASM_WIN->generic.content != NULL)
|
||||
{
|
||||
@ -383,7 +383,7 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection,
|
||||
tui_win_content content;
|
||||
struct symtab *s;
|
||||
union tui_line_or_address val;
|
||||
int maxLines, dir;
|
||||
int max_lines, dir;
|
||||
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
|
||||
|
||||
content = (tui_win_content) TUI_DISASM_WIN->generic.content;
|
||||
@ -393,9 +393,9 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection,
|
||||
s = cursal.symtab;
|
||||
|
||||
/* account for hilite */
|
||||
maxLines = TUI_DISASM_WIN->generic.height - 2;
|
||||
max_lines = TUI_DISASM_WIN->generic.height - 2;
|
||||
pc = content[0]->which_element.source.line_or_addr.addr;
|
||||
dir = (scrollDirection == FORWARD_SCROLL) ? maxLines : - maxLines;
|
||||
dir = (scroll_direction == FORWARD_SCROLL) ? max_lines : - max_lines;
|
||||
|
||||
val.addr = tui_find_disassembly_address (pc, dir);
|
||||
tui_update_source_window_as_is (TUI_DISASM_WIN, s, val, FALSE);
|
||||
|
@ -141,7 +141,7 @@ tui_registers_changed_hook (void)
|
||||
{
|
||||
tui_refreshing_registers = 1;
|
||||
#if 0
|
||||
tuiCheckDataValues (fi);
|
||||
tui_check_data_values (fi);
|
||||
#endif
|
||||
tui_refreshing_registers = 0;
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ static int tui_readline_pipe[2];
|
||||
This may be the main gdb prompt or a secondary prompt. */
|
||||
static char *tui_rl_saved_prompt;
|
||||
|
||||
static unsigned int _tuiHandleResizeDuringIO (unsigned int);
|
||||
static unsigned int tui_handle_resize_during_io (unsigned int);
|
||||
|
||||
static void
|
||||
tui_putc (char c)
|
||||
@ -659,7 +659,7 @@ tui_getc (FILE *fp)
|
||||
#endif
|
||||
|
||||
ch = wgetch (w);
|
||||
ch = _tuiHandleResizeDuringIO (ch);
|
||||
ch = tui_handle_resize_during_io (ch);
|
||||
|
||||
/* The \n must be echoed because it will not be printed by readline. */
|
||||
if (ch == '\n')
|
||||
@ -694,10 +694,6 @@ tui_getc (FILE *fp)
|
||||
|
||||
if (ch == '\n' || ch == '\r' || ch == '\f')
|
||||
TUI_CMD_WIN->detail.command_info.curch = 0;
|
||||
#if 0
|
||||
else
|
||||
tuiIncrCommandCharCountBy (1);
|
||||
#endif
|
||||
if (ch == KEY_BACKSPACE)
|
||||
return '\b';
|
||||
|
||||
@ -708,7 +704,7 @@ tui_getc (FILE *fp)
|
||||
/* Cleanup when a resize has occured.
|
||||
Returns the character that must be processed. */
|
||||
static unsigned int
|
||||
_tuiHandleResizeDuringIO (unsigned int originalCh)
|
||||
tui_handle_resize_during_io (unsigned int original_ch)
|
||||
{
|
||||
if (tui_win_resized ())
|
||||
{
|
||||
@ -718,5 +714,5 @@ _tuiHandleResizeDuringIO (unsigned int originalCh)
|
||||
return '\n';
|
||||
}
|
||||
else
|
||||
return originalCh;
|
||||
return original_ch;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -53,12 +53,12 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
|
||||
if (s != (struct symtab *) NULL && s->filename != (char *) NULL)
|
||||
{
|
||||
register FILE *stream;
|
||||
register int i, desc, c, lineWidth, nlines;
|
||||
register char *srcLine = 0;
|
||||
register int i, desc, c, line_width, nlines;
|
||||
register char *src_line = 0;
|
||||
|
||||
if ((ret = tui_alloc_source_buffer (TUI_SRC_WIN)) == TUI_SUCCESS)
|
||||
{
|
||||
lineWidth = TUI_SRC_WIN->generic.width - 1;
|
||||
line_width = TUI_SRC_WIN->generic.width - 1;
|
||||
/* Take hilite (window border) into account, when calculating
|
||||
the number of lines */
|
||||
nlines = (line_no + (TUI_SRC_WIN->generic.height - 2)) - line_no;
|
||||
@ -92,7 +92,7 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
|
||||
}
|
||||
else
|
||||
{
|
||||
register int offset, curLineNo, curLine, curLen, threshold;
|
||||
register int offset, cur_line_no, cur_line, cur_len, threshold;
|
||||
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
|
||||
struct tui_source_info * src = &TUI_SRC_WIN->detail.source_info;
|
||||
|
||||
@ -107,52 +107,52 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
|
||||
/* Determine the threshold for the length of the line
|
||||
and the offset to start the display. */
|
||||
offset = src->horizontal_offset;
|
||||
threshold = (lineWidth - 1) + offset;
|
||||
threshold = (line_width - 1) + offset;
|
||||
stream = fdopen (desc, FOPEN_RT);
|
||||
clearerr (stream);
|
||||
curLine = 0;
|
||||
curLineNo = src->start_line_or_addr.line_no = line_no;
|
||||
cur_line = 0;
|
||||
cur_line_no = src->start_line_or_addr.line_no = line_no;
|
||||
if (offset > 0)
|
||||
srcLine = (char *) xmalloc (
|
||||
src_line = (char *) xmalloc (
|
||||
(threshold + 1) * sizeof (char));
|
||||
while (curLine < nlines)
|
||||
while (cur_line < nlines)
|
||||
{
|
||||
struct tui_win_element * element = (struct tui_win_element *)
|
||||
TUI_SRC_WIN->generic.content[curLine];
|
||||
TUI_SRC_WIN->generic.content[cur_line];
|
||||
|
||||
/* get the first character in the line */
|
||||
c = fgetc (stream);
|
||||
|
||||
if (offset == 0)
|
||||
srcLine = ((struct tui_win_element *)
|
||||
src_line = ((struct tui_win_element *)
|
||||
TUI_SRC_WIN->generic.content[
|
||||
curLine])->which_element.source.line;
|
||||
cur_line])->which_element.source.line;
|
||||
/* Init the line with the line number */
|
||||
sprintf (srcLine, "%-6d", curLineNo);
|
||||
curLen = strlen (srcLine);
|
||||
i = curLen -
|
||||
((curLen / tui_default_tab_len ()) * tui_default_tab_len ());
|
||||
sprintf (src_line, "%-6d", cur_line_no);
|
||||
cur_len = strlen (src_line);
|
||||
i = cur_len -
|
||||
((cur_len / tui_default_tab_len ()) * tui_default_tab_len ());
|
||||
while (i < tui_default_tab_len ())
|
||||
{
|
||||
srcLine[curLen] = ' ';
|
||||
src_line[cur_len] = ' ';
|
||||
i++;
|
||||
curLen++;
|
||||
cur_len++;
|
||||
}
|
||||
srcLine[curLen] = (char) 0;
|
||||
src_line[cur_len] = (char) 0;
|
||||
|
||||
/* Set whether element is the execution point and
|
||||
whether there is a break point on it. */
|
||||
element->which_element.source.line_or_addr.line_no =
|
||||
curLineNo;
|
||||
cur_line_no;
|
||||
element->which_element.source.is_exec_point =
|
||||
(strcmp (((struct tui_win_element *)
|
||||
locator->content[0])->which_element.locator.file_name,
|
||||
s->filename) == 0
|
||||
&& curLineNo == ((struct tui_win_element *)
|
||||
&& cur_line_no == ((struct tui_win_element *)
|
||||
locator->content[0])->which_element.locator.line_no);
|
||||
if (c != EOF)
|
||||
{
|
||||
i = strlen (srcLine) - 1;
|
||||
i = strlen (src_line) - 1;
|
||||
do
|
||||
{
|
||||
if ((c != '\n') &&
|
||||
@ -160,13 +160,13 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
|
||||
{
|
||||
if (c < 040 && c != '\t')
|
||||
{
|
||||
srcLine[i++] = '^';
|
||||
srcLine[i] = c + 0100;
|
||||
src_line[i++] = '^';
|
||||
src_line[i] = c + 0100;
|
||||
}
|
||||
else if (c == 0177)
|
||||
{
|
||||
srcLine[i++] = '^';
|
||||
srcLine[i] = '?';
|
||||
src_line[i++] = '^';
|
||||
src_line[i] = '?';
|
||||
}
|
||||
else
|
||||
{ /* Store the charcter in the line
|
||||
@ -176,20 +176,20 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
|
||||
buffer. */
|
||||
if (c == '\t')
|
||||
{
|
||||
int j, maxTabLen = tui_default_tab_len ();
|
||||
int j, max_tab_len = tui_default_tab_len ();
|
||||
|
||||
for (j = i - (
|
||||
(i / maxTabLen) * maxTabLen);
|
||||
((j < maxTabLen) &&
|
||||
(i / max_tab_len) * max_tab_len);
|
||||
((j < max_tab_len) &&
|
||||
i < threshold);
|
||||
i++, j++)
|
||||
srcLine[i] = ' ';
|
||||
src_line[i] = ' ';
|
||||
i--;
|
||||
}
|
||||
else
|
||||
srcLine[i] = c;
|
||||
src_line[i] = c;
|
||||
}
|
||||
srcLine[i + 1] = 0;
|
||||
src_line[i + 1] = 0;
|
||||
}
|
||||
else
|
||||
{ /* If we have not reached EOL, then eat
|
||||
@ -202,19 +202,19 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
|
||||
i < threshold && (c = fgetc (stream)));
|
||||
}
|
||||
/* Now copy the line taking the offset into account */
|
||||
if (strlen (srcLine) > offset)
|
||||
if (strlen (src_line) > offset)
|
||||
strcpy (((struct tui_win_element *) TUI_SRC_WIN->generic.content[
|
||||
curLine])->which_element.source.line,
|
||||
&srcLine[offset]);
|
||||
cur_line])->which_element.source.line,
|
||||
&src_line[offset]);
|
||||
else
|
||||
((struct tui_win_element *)
|
||||
TUI_SRC_WIN->generic.content[
|
||||
curLine])->which_element.source.line[0] = (char) 0;
|
||||
curLine++;
|
||||
curLineNo++;
|
||||
cur_line])->which_element.source.line[0] = (char) 0;
|
||||
cur_line++;
|
||||
cur_line_no++;
|
||||
}
|
||||
if (offset > 0)
|
||||
xfree (srcLine);
|
||||
xfree (src_line);
|
||||
fclose (stream);
|
||||
TUI_SRC_WIN->generic.content_size = nlines;
|
||||
ret = TUI_SUCCESS;
|
||||
@ -229,29 +229,29 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
|
||||
/* elz: this function sets the contents of the source window to empty
|
||||
except for a line in the middle with a warning message about the
|
||||
source not being available. This function is called by
|
||||
tuiEraseSourceContents, which in turn is invoked when the source
|
||||
files cannot be accessed. */
|
||||
tui_erase_source_contents(), which in turn is invoked when the
|
||||
source files cannot be accessed. */
|
||||
|
||||
void
|
||||
tui_set_source_content_nil (struct tui_win_info * winInfo, char *warning_string)
|
||||
tui_set_source_content_nil (struct tui_win_info * win_info, char *warning_string)
|
||||
{
|
||||
int lineWidth;
|
||||
int nLines;
|
||||
int line_width;
|
||||
int n_lines;
|
||||
int curr_line = 0;
|
||||
|
||||
lineWidth = winInfo->generic.width - 1;
|
||||
nLines = winInfo->generic.height - 2;
|
||||
line_width = win_info->generic.width - 1;
|
||||
n_lines = win_info->generic.height - 2;
|
||||
|
||||
/* set to empty each line in the window, except for the one
|
||||
which contains the message */
|
||||
while (curr_line < winInfo->generic.content_size)
|
||||
while (curr_line < win_info->generic.content_size)
|
||||
{
|
||||
/* set the information related to each displayed line
|
||||
to null: i.e. the line number is 0, there is no bp,
|
||||
it is not where the program is stopped */
|
||||
|
||||
struct tui_win_element * element =
|
||||
(struct tui_win_element *) winInfo->generic.content[curr_line];
|
||||
(struct tui_win_element *) win_info->generic.content[curr_line];
|
||||
element->which_element.source.line_or_addr.line_no = 0;
|
||||
element->which_element.source.is_exec_point = FALSE;
|
||||
element->which_element.source.has_break = FALSE;
|
||||
@ -259,35 +259,35 @@ tui_set_source_content_nil (struct tui_win_info * winInfo, char *warning_string)
|
||||
/* set the contents of the line to blank */
|
||||
element->which_element.source.line[0] = (char) 0;
|
||||
|
||||
/* if the current line is in the middle of the screen, then we want to
|
||||
display the 'no source available' message in it.
|
||||
Note: the 'weird' arithmetic with the line width and height comes from
|
||||
the function tuiEraseSourceContent. We need to keep the screen and the
|
||||
window's actual contents in synch */
|
||||
/* if the current line is in the middle of the screen, then we
|
||||
want to display the 'no source available' message in it.
|
||||
Note: the 'weird' arithmetic with the line width and height
|
||||
comes from the function tui_erase_source_content(). We need
|
||||
to keep the screen and the window's actual contents in synch. */
|
||||
|
||||
if (curr_line == (nLines / 2 + 1))
|
||||
if (curr_line == (n_lines / 2 + 1))
|
||||
{
|
||||
int i;
|
||||
int xpos;
|
||||
int warning_length = strlen (warning_string);
|
||||
char *srcLine;
|
||||
char *src_line;
|
||||
|
||||
srcLine = element->which_element.source.line;
|
||||
src_line = element->which_element.source.line;
|
||||
|
||||
if (warning_length >= ((lineWidth - 1) / 2))
|
||||
if (warning_length >= ((line_width - 1) / 2))
|
||||
xpos = 1;
|
||||
else
|
||||
xpos = (lineWidth - 1) / 2 - warning_length;
|
||||
xpos = (line_width - 1) / 2 - warning_length;
|
||||
|
||||
for (i = 0; i < xpos; i++)
|
||||
srcLine[i] = ' ';
|
||||
src_line[i] = ' ';
|
||||
|
||||
sprintf (srcLine + i, "%s", warning_string);
|
||||
sprintf (src_line + i, "%s", warning_string);
|
||||
|
||||
for (i = xpos + warning_length; i < lineWidth; i++)
|
||||
srcLine[i] = ' ';
|
||||
for (i = xpos + warning_length; i < line_width; i++)
|
||||
src_line[i] = ' ';
|
||||
|
||||
srcLine[i] = '\n';
|
||||
src_line[i] = '\n';
|
||||
|
||||
} /* end if */
|
||||
|
||||
@ -320,8 +320,8 @@ tui_source_is_displayed (char *fname)
|
||||
|
||||
/* Scroll the source forward or backward vertically. */
|
||||
void
|
||||
tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection,
|
||||
int numToScroll)
|
||||
tui_vertical_source_scroll (enum tui_scroll_direction scroll_direction,
|
||||
int num_to_scroll)
|
||||
{
|
||||
if (TUI_SRC_WIN->generic.content != NULL)
|
||||
{
|
||||
@ -335,19 +335,19 @@ tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection,
|
||||
else
|
||||
s = cursal.symtab;
|
||||
|
||||
if (scrollDirection == FORWARD_SCROLL)
|
||||
if (scroll_direction == FORWARD_SCROLL)
|
||||
{
|
||||
l.line_no = content[0]->which_element.source.line_or_addr.line_no +
|
||||
numToScroll;
|
||||
num_to_scroll;
|
||||
if (l.line_no > s->nlines)
|
||||
/*line = s->nlines - winInfo->generic.content_size + 1; */
|
||||
/*line = s->nlines - win_info->generic.content_size + 1; */
|
||||
/*elz: fix for dts 23398 */
|
||||
l.line_no = content[0]->which_element.source.line_or_addr.line_no;
|
||||
}
|
||||
else
|
||||
{
|
||||
l.line_no = content[0]->which_element.source.line_or_addr.line_no -
|
||||
numToScroll;
|
||||
num_to_scroll;
|
||||
if (l.line_no <= 0)
|
||||
l.line_no = 1;
|
||||
}
|
||||
|
@ -244,7 +244,6 @@ tui_get_function_from_frame (struct frame_info *fi)
|
||||
return name;
|
||||
}
|
||||
|
||||
/* tuiShowLocatorContent(). */
|
||||
void
|
||||
tui_show_locator_content (void)
|
||||
{
|
||||
@ -334,12 +333,12 @@ tui_show_frame_info (struct frame_info *fi)
|
||||
register int start_line, i;
|
||||
CORE_ADDR low;
|
||||
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
|
||||
int sourceAlreadyDisplayed;
|
||||
int source_already_displayed;
|
||||
struct symtab_and_line sal;
|
||||
|
||||
find_frame_sal (fi, &sal);
|
||||
|
||||
sourceAlreadyDisplayed = sal.symtab != 0
|
||||
source_already_displayed = sal.symtab != 0
|
||||
&& tui_source_is_displayed (sal.symtab->filename);
|
||||
tui_set_locator_info (sal.symtab == 0 ? "??" : sal.symtab->filename,
|
||||
tui_get_function_from_frame (fi),
|
||||
@ -373,7 +372,7 @@ tui_show_frame_info (struct frame_info *fi)
|
||||
{
|
||||
union tui_line_or_address l;
|
||||
l.line_no = start_line;
|
||||
if (!(sourceAlreadyDisplayed
|
||||
if (!(source_already_displayed
|
||||
&& tui_line_is_displayed (item->locator.line_no, win_info, TRUE)))
|
||||
tui_update_source_window (win_info, sal.symtab, l, TRUE);
|
||||
else
|
||||
@ -413,9 +412,10 @@ tui_show_frame_info (struct frame_info *fi)
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to initialize gdb commands, for tui window stack manipulation. */
|
||||
/* Function to initialize gdb commands, for tui window stack
|
||||
manipulation. */
|
||||
void
|
||||
_initialize_tuiStack (void)
|
||||
_initialize_tui_stack (void)
|
||||
{
|
||||
add_com ("update", class_tui, tui_update_command,
|
||||
"Update the source window and locator to display the current "
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -48,77 +48,66 @@
|
||||
******************************************/
|
||||
|
||||
|
||||
/*
|
||||
** tuiFirstDataItemDisplayed()
|
||||
** Answer the index first element displayed.
|
||||
** If none are displayed, then return (-1).
|
||||
*/
|
||||
/* Answer the index first element displayed. If none are displayed,
|
||||
then return (-1). */
|
||||
int
|
||||
tuiFirstDataItemDisplayed (void)
|
||||
tui_first_data_item_displayed (void)
|
||||
{
|
||||
int elementNo = (-1);
|
||||
int element_no = (-1);
|
||||
int i;
|
||||
|
||||
for (i = 0; (i < TUI_DATA_WIN->generic.content_size && elementNo < 0); i++)
|
||||
for (i = 0; (i < TUI_DATA_WIN->generic.content_size && element_no < 0); i++)
|
||||
{
|
||||
struct tui_gen_win_info * dataItemWin;
|
||||
struct tui_gen_win_info * data_item_win;
|
||||
|
||||
dataItemWin = &((tui_win_content)
|
||||
data_item_win = &((tui_win_content)
|
||||
TUI_DATA_WIN->generic.content)[i]->which_element.data_window;
|
||||
if (dataItemWin->handle != (WINDOW *) NULL && dataItemWin->is_visible)
|
||||
elementNo = i;
|
||||
if (data_item_win->handle != (WINDOW *) NULL && data_item_win->is_visible)
|
||||
element_no = i;
|
||||
}
|
||||
|
||||
return elementNo;
|
||||
} /* tuiFirstDataItemDisplayed */
|
||||
return element_no;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** tuiFirstDataElementNoInLine()
|
||||
** Answer the index of the first element in lineNo. If lineNo is
|
||||
** past the data area (-1) is returned.
|
||||
*/
|
||||
/* Answer the index of the first element in line_no. If line_no is
|
||||
past the data area (-1) is returned. */
|
||||
int
|
||||
tuiFirstDataElementNoInLine (int lineNo)
|
||||
tui_first_data_element_no_in_line (int line_no)
|
||||
{
|
||||
int firstElementNo = (-1);
|
||||
int first_element_no = (-1);
|
||||
|
||||
/*
|
||||
** First see if there is a register on lineNo, and if so, set the
|
||||
** First see if there is a register on line_no, and if so, set the
|
||||
** first element number
|
||||
*/
|
||||
if ((firstElementNo = tui_first_reg_element_no_inline (lineNo)) == -1)
|
||||
if ((first_element_no = tui_first_reg_element_no_inline (line_no)) == -1)
|
||||
{ /*
|
||||
** Looking at the general data, the 1st element on lineNo
|
||||
** Looking at the general data, the 1st element on line_no
|
||||
*/
|
||||
}
|
||||
|
||||
return firstElementNo;
|
||||
} /* tuiFirstDataElementNoInLine */
|
||||
return first_element_no;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** tuiDeleteDataContentWindows()
|
||||
** Function to delete all the item windows in the data window.
|
||||
** This is usually done when the data window is scrolled.
|
||||
*/
|
||||
/* Function to delete all the item windows in the data window. This
|
||||
is usually done when the data window is scrolled. */
|
||||
void
|
||||
tuiDeleteDataContentWindows (void)
|
||||
tui_delete_data_content_windows (void)
|
||||
{
|
||||
int i;
|
||||
struct tui_gen_win_info * dataItemWinPtr;
|
||||
struct tui_gen_win_info * data_item_win_ptr;
|
||||
|
||||
for (i = 0; (i < TUI_DATA_WIN->generic.content_size); i++)
|
||||
{
|
||||
dataItemWinPtr = &((tui_win_content)
|
||||
data_item_win_ptr = &((tui_win_content)
|
||||
TUI_DATA_WIN->generic.content)[i]->which_element.data_window;
|
||||
tui_delete_win (dataItemWinPtr->handle);
|
||||
dataItemWinPtr->handle = (WINDOW *) NULL;
|
||||
dataItemWinPtr->is_visible = FALSE;
|
||||
tui_delete_win (data_item_win_ptr->handle);
|
||||
data_item_win_ptr->handle = (WINDOW *) NULL;
|
||||
data_item_win_ptr->is_visible = FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
} /* tuiDeleteDataContentWindows */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@ -128,16 +117,16 @@ tui_erase_data_content (char *prompt)
|
||||
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
|
||||
if (prompt != (char *) NULL)
|
||||
{
|
||||
int halfWidth = (TUI_DATA_WIN->generic.width - 2) / 2;
|
||||
int xPos;
|
||||
int half_width = (TUI_DATA_WIN->generic.width - 2) / 2;
|
||||
int x_pos;
|
||||
|
||||
if (strlen (prompt) >= halfWidth)
|
||||
xPos = 1;
|
||||
if (strlen (prompt) >= half_width)
|
||||
x_pos = 1;
|
||||
else
|
||||
xPos = halfWidth - strlen (prompt);
|
||||
x_pos = half_width - strlen (prompt);
|
||||
mvwaddstr (TUI_DATA_WIN->generic.handle,
|
||||
(TUI_DATA_WIN->generic.height / 2),
|
||||
xPos,
|
||||
x_pos,
|
||||
prompt);
|
||||
}
|
||||
wrefresh (TUI_DATA_WIN->generic.handle);
|
||||
@ -154,7 +143,7 @@ tui_display_all_data (void)
|
||||
else
|
||||
{
|
||||
tui_erase_data_content ((char *) NULL);
|
||||
tuiDeleteDataContentWindows ();
|
||||
tui_delete_data_content_windows ();
|
||||
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
|
||||
tui_display_registers_from (0);
|
||||
/*
|
||||
@ -169,80 +158,70 @@ tui_display_all_data (void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** tuiDisplayDataFromLine()
|
||||
** Function to display the data starting at line, lineNo, in the
|
||||
** data window.
|
||||
*/
|
||||
/* Function to display the data starting at line, line_no, in the data
|
||||
window. */
|
||||
void
|
||||
tuiDisplayDataFromLine (int lineNo)
|
||||
tui_display_data_from_line (int line_no)
|
||||
{
|
||||
int _lineNo = lineNo;
|
||||
int _line_no = line_no;
|
||||
|
||||
if (lineNo < 0)
|
||||
_lineNo = 0;
|
||||
if (line_no < 0)
|
||||
_line_no = 0;
|
||||
|
||||
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
|
||||
|
||||
/* there is no general data, force regs to display (if there are any) */
|
||||
if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0)
|
||||
tui_display_registers_from_line (_lineNo, TRUE);
|
||||
tui_display_registers_from_line (_line_no, TRUE);
|
||||
else
|
||||
{
|
||||
int elementNo, startLineNo;
|
||||
int regsLastLine = tui_last_regs_line_no ();
|
||||
int element_no, start_line_no;
|
||||
int regs_last_line = tui_last_regs_line_no ();
|
||||
|
||||
|
||||
/* display regs if we can */
|
||||
if (tui_display_registers_from_line (_lineNo, FALSE) < 0)
|
||||
if (tui_display_registers_from_line (_line_no, FALSE) < 0)
|
||||
{ /*
|
||||
** _lineNo is past the regs display, so calc where the
|
||||
** _line_no is past the regs display, so calc where the
|
||||
** start data element is
|
||||
*/
|
||||
if (regsLastLine < _lineNo)
|
||||
if (regs_last_line < _line_no)
|
||||
{ /* figure out how many lines each element is to obtain
|
||||
the start elementNo */
|
||||
the start element_no */
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /*
|
||||
** calculate the starting element of the data display, given
|
||||
** regsLastLine and how many lines each element is, up to
|
||||
** _lineNo
|
||||
** regs_last_line and how many lines each element is, up to
|
||||
** _line_no
|
||||
*/
|
||||
}
|
||||
/* Now display the data , starting at elementNo */
|
||||
/* Now display the data , starting at element_no */
|
||||
}
|
||||
|
||||
return;
|
||||
} /* tuiDisplayDataFromLine */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** tuiDisplayDataFrom()
|
||||
** Display data starting at element elementNo
|
||||
*/
|
||||
/* Display data starting at element element_no. */
|
||||
void
|
||||
tuiDisplayDataFrom (int elementNo, int reuseWindows)
|
||||
tui_display_data_from (int element_no, int reuse_windows)
|
||||
{
|
||||
int firstLine = (-1);
|
||||
int first_line = (-1);
|
||||
|
||||
if (elementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
||||
firstLine = tui_line_from_reg_element_no (elementNo);
|
||||
if (element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
||||
first_line = tui_line_from_reg_element_no (element_no);
|
||||
else
|
||||
{ /* calculate the firstLine from the element number */
|
||||
{ /* calculate the first_line from the element number */
|
||||
}
|
||||
|
||||
if (firstLine >= 0)
|
||||
if (first_line >= 0)
|
||||
{
|
||||
tui_erase_data_content ((char *) NULL);
|
||||
if (!reuseWindows)
|
||||
tuiDeleteDataContentWindows ();
|
||||
tuiDisplayDataFromLine (firstLine);
|
||||
if (!reuse_windows)
|
||||
tui_delete_data_content_windows ();
|
||||
tui_display_data_from_line (first_line);
|
||||
}
|
||||
|
||||
return;
|
||||
} /* tuiDisplayDataFrom */
|
||||
}
|
||||
|
||||
|
||||
/* Function to redisplay the contents of the data window. */
|
||||
@ -252,10 +231,10 @@ tui_refresh_data_win (void)
|
||||
tui_erase_data_content ((char *) NULL);
|
||||
if (TUI_DATA_WIN->generic.content_size > 0)
|
||||
{
|
||||
int firstElement = tuiFirstDataItemDisplayed ();
|
||||
int first_element = tui_first_data_item_displayed ();
|
||||
|
||||
if (firstElement >= 0) /* re-use existing windows */
|
||||
tuiDisplayDataFrom (firstElement, TRUE);
|
||||
if (first_element >= 0) /* re-use existing windows */
|
||||
tui_display_data_from (first_element, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -274,18 +253,18 @@ tui_check_data_values (struct frame_info *frame)
|
||||
for (i = 0; TUI_DATA_WIN->detail.data_display_info.data_content_count; i++)
|
||||
{
|
||||
#ifdef LATER
|
||||
TuiDataElementPtr dataElementPtr;
|
||||
struct tui_gen_win_info * dataItemWinPtr;
|
||||
Opaque newValue;
|
||||
tui_data_element_ptr data_element_ptr;
|
||||
struct tui_gen_win_info * data_item_win_ptr;
|
||||
Opaque new_value;
|
||||
|
||||
dataItemPtr = &TUI_DATA_WIN->detail.data_display_info.
|
||||
data_item_ptr = &TUI_DATA_WIN->detail.data_display_info.
|
||||
data_content[i]->which_element.data_window;
|
||||
dataElementPtr = &((tui_win_content)
|
||||
dataItemWinPtr->content)[0]->which_element.data;
|
||||
data_element_ptr = &((tui_win_content)
|
||||
data_item_win_ptr->content)[0]->which_element.data;
|
||||
if value
|
||||
has changed (dataElementPtr, frame, &newValue)
|
||||
has changed (data_element_ptr, frame, &new_value)
|
||||
{
|
||||
dataElementPtr->value = newValue;
|
||||
data_element_ptr->value = new_value;
|
||||
update the display with the new value, hiliting it.
|
||||
}
|
||||
#endif
|
||||
@ -296,35 +275,33 @@ tui_check_data_values (struct frame_info *frame)
|
||||
|
||||
/* Scroll the data window vertically forward or backward. */
|
||||
void
|
||||
tui_vertical_data_scroll (enum tui_scroll_direction scrollDirection, int numToScroll)
|
||||
tui_vertical_data_scroll (enum tui_scroll_direction scroll_direction, int num_to_scroll)
|
||||
{
|
||||
int firstElementNo;
|
||||
int firstLine = (-1);
|
||||
int first_element_no;
|
||||
int first_line = (-1);
|
||||
|
||||
firstElementNo = tuiFirstDataItemDisplayed ();
|
||||
if (firstElementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
||||
firstLine = tui_line_from_reg_element_no (firstElementNo);
|
||||
first_element_no = tui_first_data_item_displayed ();
|
||||
if (first_element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
|
||||
first_line = tui_line_from_reg_element_no (first_element_no);
|
||||
else
|
||||
{ /* calculate the first line from the element number which is in
|
||||
** the general data content
|
||||
*/
|
||||
}
|
||||
|
||||
if (firstLine >= 0)
|
||||
if (first_line >= 0)
|
||||
{
|
||||
int lastElementNo, lastLine;
|
||||
int last_element_no, last_line;
|
||||
|
||||
if (scrollDirection == FORWARD_SCROLL)
|
||||
firstLine += numToScroll;
|
||||
if (scroll_direction == FORWARD_SCROLL)
|
||||
first_line += num_to_scroll;
|
||||
else
|
||||
firstLine -= numToScroll;
|
||||
first_line -= num_to_scroll;
|
||||
tui_erase_data_content ((char *) NULL);
|
||||
tuiDeleteDataContentWindows ();
|
||||
tuiDisplayDataFromLine (firstLine);
|
||||
tui_delete_data_content_windows ();
|
||||
tui_display_data_from_line (first_line);
|
||||
}
|
||||
|
||||
return;
|
||||
} /* tuiVerticalDataScroll */
|
||||
}
|
||||
|
||||
|
||||
/*****************************************
|
||||
|
@ -50,13 +50,13 @@ tui_refresh_win (struct tui_gen_win_info * win_info)
|
||||
|
||||
for (i = 0; (i < win_info->content_size); i++)
|
||||
{
|
||||
struct tui_gen_win_info * dataItemWinPtr;
|
||||
struct tui_gen_win_info * data_item_win_ptr;
|
||||
|
||||
dataItemWinPtr = &((tui_win_content)
|
||||
data_item_win_ptr = &((tui_win_content)
|
||||
win_info->content)[i]->which_element.data_window;
|
||||
if (dataItemWinPtr != NULL
|
||||
&& dataItemWinPtr->handle != (WINDOW *) NULL)
|
||||
wrefresh (dataItemWinPtr->handle);
|
||||
if (data_item_win_ptr != NULL
|
||||
&& data_item_win_ptr->handle != (WINDOW *) NULL)
|
||||
wrefresh (data_item_win_ptr->handle);
|
||||
}
|
||||
}
|
||||
else if (win_info->type == CMD_WIN)
|
||||
@ -86,7 +86,7 @@ tui_delete_win (WINDOW * window)
|
||||
|
||||
/* Draw a border arround the window. */
|
||||
void
|
||||
boxWin (struct tui_gen_win_info * win_info, int highlightFlag)
|
||||
box_win (struct tui_gen_win_info * win_info, int highlight_flag)
|
||||
{
|
||||
if (win_info && win_info->handle)
|
||||
{
|
||||
@ -94,7 +94,7 @@ boxWin (struct tui_gen_win_info * win_info, int highlightFlag)
|
||||
int attrs;
|
||||
|
||||
win = win_info->handle;
|
||||
if (highlightFlag == HILITE)
|
||||
if (highlight_flag == HILITE)
|
||||
attrs = tui_active_border_attrs;
|
||||
else
|
||||
attrs = tui_border_attrs;
|
||||
@ -116,7 +116,7 @@ tui_unhighlight_win (struct tui_win_info * win_info)
|
||||
{
|
||||
if (win_info != NULL && win_info->generic.handle != (WINDOW *) NULL)
|
||||
{
|
||||
boxWin ((struct tui_gen_win_info *) win_info, NO_HILITE);
|
||||
box_win ((struct tui_gen_win_info *) win_info, NO_HILITE);
|
||||
wrefresh (win_info->generic.handle);
|
||||
tui_set_win_highlight (win_info, 0);
|
||||
}
|
||||
@ -130,7 +130,7 @@ tui_highlight_win (struct tui_win_info * win_info)
|
||||
&& win_info->can_highlight
|
||||
&& win_info->generic.handle != (WINDOW *) NULL)
|
||||
{
|
||||
boxWin ((struct tui_gen_win_info *) win_info, HILITE);
|
||||
box_win ((struct tui_gen_win_info *) win_info, HILITE);
|
||||
wrefresh (win_info->generic.handle);
|
||||
tui_set_win_highlight (win_info, 1);
|
||||
}
|
||||
@ -152,7 +152,7 @@ tui_check_and_display_highlight_if_needed (struct tui_win_info * win_info)
|
||||
|
||||
|
||||
void
|
||||
tui_make_window (struct tui_gen_win_info * win_info, int boxIt)
|
||||
tui_make_window (struct tui_gen_win_info * win_info, int box_it)
|
||||
{
|
||||
WINDOW *handle;
|
||||
|
||||
@ -163,8 +163,8 @@ tui_make_window (struct tui_gen_win_info * win_info, int boxIt)
|
||||
win_info->handle = handle;
|
||||
if (handle != (WINDOW *) NULL)
|
||||
{
|
||||
if (boxIt == BOX_WINDOW)
|
||||
boxWin (win_info, NO_HILITE);
|
||||
if (box_it == BOX_WINDOW)
|
||||
box_win (win_info, NO_HILITE);
|
||||
win_info->is_visible = TRUE;
|
||||
scrollok (handle, TRUE);
|
||||
}
|
||||
@ -274,9 +274,7 @@ tui_refresh_all (struct tui_win_info * * list)
|
||||
touchwin (locator->handle);
|
||||
tui_refresh_win (locator);
|
||||
}
|
||||
|
||||
return;
|
||||
} /* refreshAll */
|
||||
}
|
||||
|
||||
|
||||
/*********************************
|
||||
|
@ -76,10 +76,10 @@ tui_display_main (void)
|
||||
initializes the horizontal scroll to 0. */
|
||||
void
|
||||
tui_update_source_window (struct tui_win_info * win_info, struct symtab *s,
|
||||
union tui_line_or_address lineOrAddr, int noerror)
|
||||
union tui_line_or_address line_or_addr, int noerror)
|
||||
{
|
||||
win_info->detail.source_info.horizontal_offset = 0;
|
||||
tui_update_source_window_as_is (win_info, s, lineOrAddr, noerror);
|
||||
tui_update_source_window_as_is (win_info, s, line_or_addr, noerror);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -89,14 +89,14 @@ tui_update_source_window (struct tui_win_info * win_info, struct symtab *s,
|
||||
shows the source as specified by the horizontal offset. */
|
||||
void
|
||||
tui_update_source_window_as_is (struct tui_win_info * win_info, struct symtab *s,
|
||||
union tui_line_or_address lineOrAddr, int noerror)
|
||||
union tui_line_or_address line_or_addr, int noerror)
|
||||
{
|
||||
enum tui_status ret;
|
||||
|
||||
if (win_info->generic.type == SRC_WIN)
|
||||
ret = tui_set_source_content (s, lineOrAddr.line_no, noerror);
|
||||
ret = tui_set_source_content (s, line_or_addr.line_no, noerror);
|
||||
else
|
||||
ret = tui_set_disassem_content (lineOrAddr.addr);
|
||||
ret = tui_set_disassem_content (line_or_addr.addr);
|
||||
|
||||
if (ret == TUI_FAILURE)
|
||||
{
|
||||
@ -112,7 +112,7 @@ tui_update_source_window_as_is (struct tui_win_info * win_info, struct symtab *s
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal.line = lineOrAddr.line_no +
|
||||
sal.line = line_or_addr.line_no +
|
||||
(win_info->generic.content_size - 2);
|
||||
sal.symtab = s;
|
||||
set_current_source_symtab_and_line (&sal);
|
||||
@ -169,9 +169,7 @@ tui_update_source_windows_with_addr (CORE_ADDR addr)
|
||||
tui_clear_exec_info_content (win_info);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
} /* tuiUpdateSourceWindowsWithAddr */
|
||||
}
|
||||
|
||||
/* Function to ensure that the source and/or disassemly windows
|
||||
reflect the input address. */
|
||||
@ -203,14 +201,14 @@ tui_update_source_windows_with_line (struct symtab *s, int line)
|
||||
}
|
||||
|
||||
void
|
||||
tui_clear_source_content (struct tui_win_info * win_info, int displayPrompt)
|
||||
tui_clear_source_content (struct tui_win_info * win_info, int display_prompt)
|
||||
{
|
||||
if (win_info != NULL)
|
||||
{
|
||||
register int i;
|
||||
|
||||
win_info->generic.content_in_use = FALSE;
|
||||
tui_erase_source_content (win_info, displayPrompt);
|
||||
tui_erase_source_content (win_info, display_prompt);
|
||||
for (i = 0; i < win_info->generic.content_size; i++)
|
||||
{
|
||||
struct tui_win_element * element =
|
||||
@ -219,49 +217,46 @@ tui_clear_source_content (struct tui_win_info * win_info, int displayPrompt)
|
||||
element->which_element.source.is_exec_point = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
} /* tuiClearSourceContent */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tui_erase_source_content (struct tui_win_info * win_info, int displayPrompt)
|
||||
tui_erase_source_content (struct tui_win_info * win_info, int display_prompt)
|
||||
{
|
||||
int xPos;
|
||||
int halfWidth = (win_info->generic.width - 2) / 2;
|
||||
int x_pos;
|
||||
int half_width = (win_info->generic.width - 2) / 2;
|
||||
|
||||
if (win_info->generic.handle != (WINDOW *) NULL)
|
||||
{
|
||||
werase (win_info->generic.handle);
|
||||
tui_check_and_display_highlight_if_needed (win_info);
|
||||
if (displayPrompt == EMPTY_SOURCE_PROMPT)
|
||||
if (display_prompt == EMPTY_SOURCE_PROMPT)
|
||||
{
|
||||
char *noSrcStr;
|
||||
char *no_src_str;
|
||||
|
||||
if (win_info->generic.type == SRC_WIN)
|
||||
noSrcStr = NO_SRC_STRING;
|
||||
no_src_str = NO_SRC_STRING;
|
||||
else
|
||||
noSrcStr = NO_DISASSEM_STRING;
|
||||
if (strlen (noSrcStr) >= halfWidth)
|
||||
xPos = 1;
|
||||
no_src_str = NO_DISASSEM_STRING;
|
||||
if (strlen (no_src_str) >= half_width)
|
||||
x_pos = 1;
|
||||
else
|
||||
xPos = halfWidth - strlen (noSrcStr);
|
||||
x_pos = half_width - strlen (no_src_str);
|
||||
mvwaddstr (win_info->generic.handle,
|
||||
(win_info->generic.height / 2),
|
||||
xPos,
|
||||
noSrcStr);
|
||||
x_pos,
|
||||
no_src_str);
|
||||
|
||||
/* elz: added this function call to set the real contents of
|
||||
the window to what is on the screen, so that later calls
|
||||
to refresh, do display
|
||||
the correct stuff, and not the old image */
|
||||
|
||||
tui_set_source_content_nil (win_info, noSrcStr);
|
||||
tui_set_source_content_nil (win_info, no_src_str);
|
||||
}
|
||||
tui_refresh_win (&win_info->generic);
|
||||
}
|
||||
return;
|
||||
} /* tuiEraseSourceContent */
|
||||
}
|
||||
|
||||
|
||||
/* Redraw the complete line of a source or disassembly window. */
|
||||
@ -312,7 +307,7 @@ tui_show_source_content (struct tui_win_info * win_info)
|
||||
void
|
||||
tui_horizontal_source_scroll (struct tui_win_info * win_info,
|
||||
enum tui_scroll_direction direction,
|
||||
int numToScroll)
|
||||
int num_to_scroll)
|
||||
{
|
||||
if (win_info->generic.content != NULL)
|
||||
{
|
||||
@ -326,11 +321,11 @@ tui_horizontal_source_scroll (struct tui_win_info * win_info,
|
||||
s = cursal.symtab;
|
||||
|
||||
if (direction == LEFT_SCROLL)
|
||||
offset = win_info->detail.source_info.horizontal_offset + numToScroll;
|
||||
offset = win_info->detail.source_info.horizontal_offset + num_to_scroll;
|
||||
else
|
||||
{
|
||||
if ((offset =
|
||||
win_info->detail.source_info.horizontal_offset - numToScroll) < 0)
|
||||
win_info->detail.source_info.horizontal_offset - num_to_scroll) < 0)
|
||||
offset = 0;
|
||||
}
|
||||
win_info->detail.source_info.horizontal_offset = offset;
|
||||
@ -341,7 +336,7 @@ tui_horizontal_source_scroll (struct tui_win_info * win_info,
|
||||
}
|
||||
|
||||
return;
|
||||
} /* tuiHorizontalSourceScroll */
|
||||
}
|
||||
|
||||
|
||||
/* Set or clear the has_break flag in the line whose line is line_no. */
|
||||
@ -355,16 +350,16 @@ tui_set_is_exec_point_at (union tui_line_or_address l, struct tui_win_info * win
|
||||
i = 0;
|
||||
while (i < win_info->generic.content_size)
|
||||
{
|
||||
int newState;
|
||||
int new_state;
|
||||
|
||||
if (content[i]->which_element.source.line_or_addr.addr == l.addr)
|
||||
newState = TRUE;
|
||||
new_state = TRUE;
|
||||
else
|
||||
newState = FALSE;
|
||||
if (newState != content[i]->which_element.source.is_exec_point)
|
||||
new_state = FALSE;
|
||||
if (new_state != content[i]->which_element.source.is_exec_point)
|
||||
{
|
||||
changed++;
|
||||
content[i]->which_element.source.is_exec_point = newState;
|
||||
content[i]->which_element.source.is_exec_point = new_state;
|
||||
tui_show_source_line (win_info, i + 1);
|
||||
}
|
||||
i++;
|
||||
@ -453,26 +448,23 @@ tui_update_breakpoint_info (struct tui_win_info * win, int current_only)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** tuiSetExecInfoContent().
|
||||
** Function to initialize the content of the execution info window,
|
||||
** based upon the input window which is either the source or
|
||||
** disassembly window.
|
||||
*/
|
||||
/* Function to initialize the content of the execution info window,
|
||||
based upon the input window which is either the source or
|
||||
disassembly window. */
|
||||
enum tui_status
|
||||
tuiSetExecInfoContent (struct tui_win_info * win_info)
|
||||
tui_set_exec_info_content (struct tui_win_info * win_info)
|
||||
{
|
||||
enum tui_status ret = TUI_SUCCESS;
|
||||
|
||||
if (win_info->detail.source_info.execution_info != (struct tui_gen_win_info *) NULL)
|
||||
{
|
||||
struct tui_gen_win_info * execInfoPtr = win_info->detail.source_info.execution_info;
|
||||
struct tui_gen_win_info * exec_info_ptr = win_info->detail.source_info.execution_info;
|
||||
|
||||
if (execInfoPtr->content == NULL)
|
||||
execInfoPtr->content =
|
||||
if (exec_info_ptr->content == NULL)
|
||||
exec_info_ptr->content =
|
||||
(void **) tui_alloc_content (win_info->generic.height,
|
||||
execInfoPtr->type);
|
||||
if (execInfoPtr->content != NULL)
|
||||
exec_info_ptr->type);
|
||||
if (exec_info_ptr->content != NULL)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -480,11 +472,11 @@ tuiSetExecInfoContent (struct tui_win_info * win_info)
|
||||
for (i = 0; i < win_info->generic.content_size; i++)
|
||||
{
|
||||
struct tui_win_element * element;
|
||||
struct tui_win_element * srcElement;
|
||||
struct tui_win_element * src_element;
|
||||
int mode;
|
||||
|
||||
element = (struct tui_win_element *) execInfoPtr->content[i];
|
||||
srcElement = (struct tui_win_element *) win_info->generic.content[i];
|
||||
element = (struct tui_win_element *) exec_info_ptr->content[i];
|
||||
src_element = (struct tui_win_element *) win_info->generic.content[i];
|
||||
|
||||
memset(element->which_element.simple_string, ' ',
|
||||
sizeof(element->which_element.simple_string));
|
||||
@ -492,7 +484,7 @@ tuiSetExecInfoContent (struct tui_win_info * win_info)
|
||||
|
||||
/* Now update the exec info content based upon the state
|
||||
of each line as indicated by the source content. */
|
||||
mode = srcElement->which_element.source.has_break;
|
||||
mode = src_element->which_element.source.has_break;
|
||||
if (mode & TUI_BP_HIT)
|
||||
element->which_element.simple_string[TUI_BP_HIT_POS] =
|
||||
(mode & TUI_BP_HARDWARE) ? 'H' : 'B';
|
||||
@ -505,10 +497,10 @@ tuiSetExecInfoContent (struct tui_win_info * win_info)
|
||||
else if (mode & TUI_BP_DISABLED)
|
||||
element->which_element.simple_string[TUI_BP_BREAK_POS] = '-';
|
||||
|
||||
if (srcElement->which_element.source.is_exec_point)
|
||||
if (src_element->which_element.source.is_exec_point)
|
||||
element->which_element.simple_string[TUI_EXEC_POS] = '>';
|
||||
}
|
||||
execInfoPtr->content_size = win_info->generic.content_size;
|
||||
exec_info_ptr->content_size = win_info->generic.content_size;
|
||||
}
|
||||
else
|
||||
ret = TUI_FAILURE;
|
||||
@ -518,39 +510,32 @@ tuiSetExecInfoContent (struct tui_win_info * win_info)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** tuiShowExecInfoContent().
|
||||
*/
|
||||
void
|
||||
tuiShowExecInfoContent (struct tui_win_info * win_info)
|
||||
tui_show_exec_info_content (struct tui_win_info * win_info)
|
||||
{
|
||||
struct tui_gen_win_info * execInfo = win_info->detail.source_info.execution_info;
|
||||
int curLine;
|
||||
struct tui_gen_win_info * exec_info = win_info->detail.source_info.execution_info;
|
||||
int cur_line;
|
||||
|
||||
werase (execInfo->handle);
|
||||
tui_refresh_win (execInfo);
|
||||
for (curLine = 1; (curLine <= execInfo->content_size); curLine++)
|
||||
mvwaddstr (execInfo->handle,
|
||||
curLine,
|
||||
werase (exec_info->handle);
|
||||
tui_refresh_win (exec_info);
|
||||
for (cur_line = 1; (cur_line <= exec_info->content_size); cur_line++)
|
||||
mvwaddstr (exec_info->handle,
|
||||
cur_line,
|
||||
0,
|
||||
((struct tui_win_element *)
|
||||
execInfo->content[curLine - 1])->which_element.simple_string);
|
||||
tui_refresh_win (execInfo);
|
||||
execInfo->content_in_use = TRUE;
|
||||
|
||||
return;
|
||||
exec_info->content[cur_line - 1])->which_element.simple_string);
|
||||
tui_refresh_win (exec_info);
|
||||
exec_info->content_in_use = TRUE;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tui_erase_exec_info_content (struct tui_win_info * win_info)
|
||||
{
|
||||
struct tui_gen_win_info * execInfo = win_info->detail.source_info.execution_info;
|
||||
struct tui_gen_win_info * exec_info = win_info->detail.source_info.execution_info;
|
||||
|
||||
werase (execInfo->handle);
|
||||
tui_refresh_win (execInfo);
|
||||
|
||||
return;
|
||||
werase (exec_info->handle);
|
||||
tui_refresh_win (exec_info);
|
||||
}
|
||||
|
||||
void
|
||||
@ -566,19 +551,19 @@ tui_clear_exec_info_content (struct tui_win_info * win_info)
|
||||
void
|
||||
tui_update_exec_info (struct tui_win_info * win_info)
|
||||
{
|
||||
tuiSetExecInfoContent (win_info);
|
||||
tuiShowExecInfoContent (win_info);
|
||||
} /* tuiUpdateExecInfo */
|
||||
tui_set_exec_info_content (win_info);
|
||||
tui_show_exec_info_content (win_info);
|
||||
}
|
||||
|
||||
enum tui_status
|
||||
tui_alloc_source_buffer (struct tui_win_info *win_info)
|
||||
{
|
||||
register char *srcLineBuf;
|
||||
register int i, lineWidth, maxLines;
|
||||
register char *src_line_buf;
|
||||
register int i, line_width, max_lines;
|
||||
enum tui_status ret = TUI_FAILURE;
|
||||
|
||||
maxLines = win_info->generic.height; /* less the highlight box */
|
||||
lineWidth = win_info->generic.width - 1;
|
||||
max_lines = win_info->generic.height; /* less the highlight box */
|
||||
line_width = win_info->generic.width - 1;
|
||||
/*
|
||||
** Allocate the buffer for the source lines. Do this only once since they
|
||||
** will be re-used for all source displays. The only other time this will
|
||||
@ -586,8 +571,8 @@ tui_alloc_source_buffer (struct tui_win_info *win_info)
|
||||
*/
|
||||
if (win_info->generic.content == NULL)
|
||||
{
|
||||
srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char));
|
||||
if (srcLineBuf == (char *) NULL)
|
||||
src_line_buf = (char *) xmalloc ((max_lines * line_width) * sizeof (char));
|
||||
if (src_line_buf == (char *) NULL)
|
||||
fputs_unfiltered (
|
||||
"Unable to Allocate Memory for Source or Disassembly Display.\n",
|
||||
gdb_stderr);
|
||||
@ -595,51 +580,51 @@ tui_alloc_source_buffer (struct tui_win_info *win_info)
|
||||
{
|
||||
/* allocate the content list */
|
||||
if ((win_info->generic.content =
|
||||
(void **) tui_alloc_content (maxLines, SRC_WIN)) == NULL)
|
||||
(void **) tui_alloc_content (max_lines, SRC_WIN)) == NULL)
|
||||
{
|
||||
xfree (srcLineBuf);
|
||||
srcLineBuf = (char *) NULL;
|
||||
xfree (src_line_buf);
|
||||
src_line_buf = (char *) NULL;
|
||||
fputs_unfiltered (
|
||||
"Unable to Allocate Memory for Source or Disassembly Display.\n",
|
||||
gdb_stderr);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < maxLines; i++)
|
||||
for (i = 0; i < max_lines; i++)
|
||||
((struct tui_win_element *)
|
||||
win_info->generic.content[i])->which_element.source.line =
|
||||
srcLineBuf + (lineWidth * i);
|
||||
src_line_buf + (line_width * i);
|
||||
ret = TUI_SUCCESS;
|
||||
}
|
||||
else
|
||||
ret = TUI_SUCCESS;
|
||||
|
||||
return ret;
|
||||
} /* tuiAllocSourceBuffer */
|
||||
}
|
||||
|
||||
|
||||
/* Answer whether the a particular line number or address is displayed
|
||||
in the current source window. */
|
||||
int
|
||||
tui_line_is_displayed (int line, struct tui_win_info * win_info,
|
||||
int checkThreshold)
|
||||
int check_threshold)
|
||||
{
|
||||
int isDisplayed = FALSE;
|
||||
int is_displayed = FALSE;
|
||||
int i, threshold;
|
||||
|
||||
if (checkThreshold)
|
||||
if (check_threshold)
|
||||
threshold = SCROLL_THRESHOLD;
|
||||
else
|
||||
threshold = 0;
|
||||
i = 0;
|
||||
while (i < win_info->generic.content_size - threshold && !isDisplayed)
|
||||
while (i < win_info->generic.content_size - threshold && !is_displayed)
|
||||
{
|
||||
isDisplayed = (((struct tui_win_element *)
|
||||
is_displayed = (((struct tui_win_element *)
|
||||
win_info->generic.content[i])->which_element.source.line_or_addr.line_no
|
||||
== (int) line);
|
||||
i++;
|
||||
}
|
||||
|
||||
return isDisplayed;
|
||||
return is_displayed;
|
||||
}
|
||||
|
||||
|
||||
@ -647,25 +632,25 @@ tui_line_is_displayed (int line, struct tui_win_info * win_info,
|
||||
in the current source window. */
|
||||
int
|
||||
tui_addr_is_displayed (CORE_ADDR addr, struct tui_win_info * win_info,
|
||||
int checkThreshold)
|
||||
int check_threshold)
|
||||
{
|
||||
int isDisplayed = FALSE;
|
||||
int is_displayed = FALSE;
|
||||
int i, threshold;
|
||||
|
||||
if (checkThreshold)
|
||||
if (check_threshold)
|
||||
threshold = SCROLL_THRESHOLD;
|
||||
else
|
||||
threshold = 0;
|
||||
i = 0;
|
||||
while (i < win_info->generic.content_size - threshold && !isDisplayed)
|
||||
while (i < win_info->generic.content_size - threshold && !is_displayed)
|
||||
{
|
||||
isDisplayed = (((struct tui_win_element *)
|
||||
is_displayed = (((struct tui_win_element *)
|
||||
win_info->generic.content[i])->which_element.source.line_or_addr.addr
|
||||
== addr);
|
||||
i++;
|
||||
}
|
||||
|
||||
return isDisplayed;
|
||||
return is_displayed;
|
||||
}
|
||||
|
||||
|
||||
|
@ -215,18 +215,18 @@ tui_rl_delete_other_windows (int notused1, int notused2)
|
||||
static int
|
||||
tui_rl_other_window (int count, int key)
|
||||
{
|
||||
struct tui_win_info * winInfo;
|
||||
struct tui_win_info * win_info;
|
||||
|
||||
if (!tui_active)
|
||||
tui_rl_switch_mode (0/*notused*/, 0/*notused*/);
|
||||
|
||||
winInfo = tui_next_win (tui_win_with_focus ());
|
||||
if (winInfo)
|
||||
win_info = tui_next_win (tui_win_with_focus ());
|
||||
if (win_info)
|
||||
{
|
||||
tui_set_win_focus_to (winInfo);
|
||||
tui_set_win_focus_to (win_info);
|
||||
if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible)
|
||||
tui_refresh_data_win ();
|
||||
keypad (TUI_CMD_WIN->generic.handle, (winInfo != TUI_CMD_WIN));
|
||||
keypad (TUI_CMD_WIN->generic.handle, (win_info != TUI_CMD_WIN));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -457,14 +457,14 @@ tui_disable (void)
|
||||
}
|
||||
|
||||
void
|
||||
strcat_to_buf (char *buf, int buflen, const char *itemToAdd)
|
||||
strcat_to_buf (char *buf, int buflen, const char *item_to_add)
|
||||
{
|
||||
if (itemToAdd != (char *) NULL && buf != (char *) NULL)
|
||||
if (item_to_add != (char *) NULL && buf != (char *) NULL)
|
||||
{
|
||||
if ((strlen (buf) + strlen (itemToAdd)) <= buflen)
|
||||
strcat (buf, itemToAdd);
|
||||
if ((strlen (buf) + strlen (item_to_add)) <= buflen)
|
||||
strcat (buf, item_to_add);
|
||||
else
|
||||
strncat (buf, itemToAdd, (buflen - strlen (buf)));
|
||||
strncat (buf, item_to_add, (buflen - strlen (buf)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -478,7 +478,7 @@ strcat_to_buf (char *buf, int buflen, const char *itemToAdd)
|
||||
#define CHK(val, dft) (val<=0 ? dft : val)
|
||||
|
||||
static void
|
||||
_tuiReset (void)
|
||||
tui_reset (void)
|
||||
{
|
||||
struct termio mode;
|
||||
|
||||
@ -544,7 +544,7 @@ _tuiReset (void)
|
||||
#endif /* USG */
|
||||
|
||||
return;
|
||||
} /* _tuiReset */
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user