diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-02-07 20:57:02 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-02-07 20:57:02 +0000 |
commit | 6d012f143df40b0870ee1f64940080c1591801a3 (patch) | |
tree | 03c02968dd85d7b77298a7c13c9b9878d01ae89e /gdb | |
parent | 1c80067325ac5c90f84154900ac057780b7869af (diff) | |
download | gdb-6d012f143df40b0870ee1f64940080c1591801a3.zip gdb-6d012f143df40b0870ee1f64940080c1591801a3.tar.gz gdb-6d012f143df40b0870ee1f64940080c1591801a3.tar.bz2 |
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, 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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 31 | ||||
-rw-r--r-- | gdb/tui/tui-command.c | 18 | ||||
-rw-r--r-- | gdb/tui/tui-data.c | 350 | ||||
-rw-r--r-- | gdb/tui/tui-data.h | 123 | ||||
-rw-r--r-- | gdb/tui/tui-disasm.c | 48 | ||||
-rw-r--r-- | gdb/tui/tui-io.c | 52 | ||||
-rw-r--r-- | gdb/tui/tui-layout.c | 294 | ||||
-rw-r--r-- | gdb/tui/tui-regs.c | 219 | ||||
-rw-r--r-- | gdb/tui/tui-regs.h | 2 | ||||
-rw-r--r-- | gdb/tui/tui-source.c | 92 | ||||
-rw-r--r-- | gdb/tui/tui-stack.c | 84 | ||||
-rw-r--r-- | gdb/tui/tui-win.c | 316 | ||||
-rw-r--r-- | gdb/tui/tui-windata.c | 52 | ||||
-rw-r--r-- | gdb/tui/tui-wingeneral.c | 105 | ||||
-rw-r--r-- | gdb/tui/tui-wingeneral.h | 7 | ||||
-rw-r--r-- | gdb/tui/tui-winsource.c | 258 | ||||
-rw-r--r-- | gdb/tui/tui.c | 34 | ||||
-rw-r--r-- | gdb/tui/tui.h | 20 |
18 files changed, 1063 insertions, 1042 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index edf959a..7336923 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,34 @@ +2004-02-07 Andrew Cagney <cagney@redhat.com> + + * tui/tui.h: Do not include <stdarg.h>, <string.h>, and + "ansidecl.h". Do not undef "reg" and "chtype". Fix case of + fields and variables. + * tui/tui-wingeneral.h (m_beVisible): Delete macro. + (m_beInvisible): Delete macro. + * tui/tui-data.h: Fix case case fields and variables. + (m_genWinPtrIsNull): Delete macro. + (tui_win_list): Rename winList. + (TUI_SRC_WIN): Rename srcWin. + (TUI_DISASM_WIN): Rename disassemWin. + (TUI_DATA_WIN): Rename dataWin. + (TUI_CMD_WIN): Rename cmdWin. + (m_genWinPtrNotNull): Delete macro. + (m_winPtrIsNull): Delete macro. + (m_winPtrNotNull): Delete macro. + (tui_win_is_source_type): Replace m_winIsSourceType + (tui_win_is_auxillary): Replace m_winIsAuzillary. + (tui_win_has_locator): Replace m_hasLocator. + (tui_set_win_highlight): Replace m_setWinHighlightOn and + m_setWinHighlightOff. + * tui/tui-data.c: Update references. + (tui_win_is_source_type, tui_set_win_highlight): New functions. + (tui_win_has_locator, tui_win_is_auxillary): New functions. + * tui/tui-command.c, tui/tui-disasm.c: Update references. + * tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto. + * tui/tui-regs.h, 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 Mark Kettenis <kettenis@gnu.org> * sparc-tdep.h (sparc_fetch_wcookie): New prototype. diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c index 820126e..2a51fc8 100644 --- a/gdb/tui/tui-command.c +++ b/gdb/tui/tui-command.c @@ -52,15 +52,15 @@ unsigned int tui_dispatch_ctrl_char (unsigned int ch) { - struct tui_win_info * winInfo = tui_win_with_focus (); - WINDOW *w = cmdWin->generic.handle; + struct tui_win_info *win_info = tui_win_with_focus (); + WINDOW *w = TUI_CMD_WIN->generic.handle; /* ** If the command window has the logical focus, or no-one does ** assume it is the command window; in this case, pass the ** character on through and do nothing here. */ - if (winInfo == (struct tui_win_info *) NULL || winInfo == cmdWin) + if (win_info == NULL || win_info == TUI_CMD_WIN) return ch; else { @@ -104,24 +104,24 @@ tui_dispatch_ctrl_char (unsigned int ch) switch (chCopy) { case KEY_NPAGE: - tui_scroll_forward (winInfo, 0); + tui_scroll_forward (win_info, 0); break; case KEY_PPAGE: - tui_scroll_backward (winInfo, 0); + tui_scroll_backward (win_info, 0); break; case KEY_DOWN: case KEY_SF: - tui_scroll_forward (winInfo, 1); + tui_scroll_forward (win_info, 1); break; case KEY_UP: case KEY_SR: - tui_scroll_backward (winInfo, 1); + tui_scroll_backward (win_info, 1); break; case KEY_RIGHT: - tui_scroll_left (winInfo, 1); + tui_scroll_left (win_info, 1); break; case KEY_LEFT: - tui_scroll_right (winInfo, 1); + tui_scroll_right (win_info, 1); break; case '\f': tui_refresh_all_win (); diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 752f4ce..7b901d3 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -1,7 +1,7 @@ /* TUI data manipulation routines. - Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, - Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -28,6 +28,8 @@ #include "tui/tui-data.h" #include "tui/tui-wingeneral.h" +#include "gdb_string.h" + #ifdef HAVE_NCURSES_H #include <ncurses.h> #else @@ -39,7 +41,7 @@ /**************************** ** GLOBAL DECLARATIONS ****************************/ -struct tui_win_info *(winList[MAX_MAJOR_WINDOWS]); +struct tui_win_info *(tui_win_list[MAX_MAJOR_WINDOWS]); /*************************** ** Private data @@ -72,6 +74,32 @@ static void freeContentElements (tui_win_content, int, enum tui_win_type); ** PUBLIC FUNCTIONS **********************************/ +int +tui_win_is_source_type (enum tui_win_type win_type) +{ + return (win_type == SRC_WIN || win_type == DISASSEM_WIN); +} + +int +tui_win_is_auxillary (enum tui_win_type win_type) +{ + return (win_type > MAX_MAJOR_WINDOWS); +} + +int +tui_win_has_locator (struct tui_win_info *win_info) +{ + return (win_info != NULL \ + && win_info->detail.source_info.has_locator); +} + +void +tui_set_win_highlight (struct tui_win_info *win_info, int highlight) +{ + if (win_info != NULL) + win_info->is_highlighted = highlight; +} + /****************************************** ** ACCESSORS & MUTATORS FOR PRIVATE DATA ******************************************/ @@ -110,9 +138,9 @@ tui_win_with_focus (void) /* Set the window that has the logical focus. */ void -tui_set_win_with_focus (struct tui_win_info * winInfo) +tui_set_win_with_focus (struct tui_win_info * win_info) { - _winWithFocus = winInfo; + _winWithFocus = win_info; } @@ -172,41 +200,41 @@ tui_clear_source_windows_detail (void) one source window (either source or disassembly), but both can be displayed at the same time. */ void -tui_add_to_source_windows (struct tui_win_info * winInfo) +tui_add_to_source_windows (struct tui_win_info * win_info) { if (_sourceWindows.count < 2) - _sourceWindows.list[_sourceWindows.count++] = (void *) winInfo; + _sourceWindows.list[_sourceWindows.count++] = (void *) win_info; } /* Clear the pertinant detail in the windows. */ void -tui_clear_win_detail (struct tui_win_info * winInfo) +tui_clear_win_detail (struct tui_win_info * win_info) { - if (m_winPtrNotNull (winInfo)) + if (win_info != NULL) { - switch (winInfo->generic.type) + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - winInfo->detail.sourceInfo.startLineOrAddr.addr = 0; - winInfo->detail.sourceInfo.horizontalOffset = 0; + win_info->detail.source_info.start_line_or_addr.addr = 0; + win_info->detail.source_info.horizontal_offset = 0; break; case CMD_WIN: - winInfo->detail.commandInfo.curLine = - winInfo->detail.commandInfo.curch = 0; + win_info->detail.command_info.cur_line = + win_info->detail.command_info.curch = 0; break; case DATA_WIN: - winInfo->detail.dataDisplayInfo.dataContent = + win_info->detail.data_display_info.data_content = (tui_win_content) NULL; - winInfo->detail.dataDisplayInfo.dataContentCount = 0; - winInfo->detail.dataDisplayInfo.regsContent = + win_info->detail.data_display_info.data_content_count = 0; + win_info->detail.data_display_info.regs_content = (tui_win_content) NULL; - winInfo->detail.dataDisplayInfo.regsContentCount = 0; - winInfo->detail.dataDisplayInfo.regsDisplayType = + win_info->detail.data_display_info.regs_content_count = 0; + win_info->detail.data_display_info.regs_display_type = TUI_UNDEFINED_REGS; - winInfo->detail.dataDisplayInfo.regsColumnCount = 1; - winInfo->detail.dataDisplayInfo.displayRegs = FALSE; + win_info->detail.data_display_info.regs_column_count = 1; + win_info->detail.data_display_info.display_regs = FALSE; break; default: break; @@ -301,10 +329,10 @@ tui_set_current_layout_to (enum tui_layout_type newLayout) ** Set the origin of the window */ void -setGenWinOrigin (struct tui_gen_win_info * winInfo, int x, int y) +setGenWinOrigin (struct tui_gen_win_info * win_info, int x, int y) { - winInfo->origin.x = x; - winInfo->origin.y = y; + win_info->origin.x = x; + win_info->origin.y = y; return; } /* setGenWinOrigin */ @@ -327,10 +355,10 @@ tui_next_win (struct tui_win_info * curWin) type = SRC_WIN; else type = curWin->generic.type + 1; - while (type != curWin->generic.type && m_winPtrIsNull (nextWin)) + while (type != curWin->generic.type && (nextWin == NULL)) { - if (winList[type] && winList[type]->generic.isVisible) - nextWin = winList[type]; + if (tui_win_list[type] && tui_win_list[type]->generic.is_visible) + nextWin = tui_win_list[type]; else { if (type == CMD_WIN) @@ -356,10 +384,10 @@ tui_prev_win (struct tui_win_info * curWin) type = CMD_WIN; else type = curWin->generic.type - 1; - while (type != curWin->generic.type && m_winPtrIsNull (prev)) + while (type != curWin->generic.type && (prev == NULL)) { - if (winList[type]->generic.isVisible) - prev = winList[type]; + if (tui_win_list[type]->generic.is_visible) + prev = tui_win_list[type]; else { if (type == SRC_WIN) @@ -377,26 +405,26 @@ tui_prev_win (struct tui_win_info * curWin) struct tui_win_info * tui_partial_win_by_name (char *name) { - struct tui_win_info * winInfo = (struct tui_win_info *) NULL; + struct tui_win_info * win_info = (struct tui_win_info *) NULL; if (name != (char *) NULL) { int i = 0; - while (i < MAX_MAJOR_WINDOWS && m_winPtrIsNull (winInfo)) + while (i < MAX_MAJOR_WINDOWS && win_info == NULL) { - if (winList[i] != 0) + if (tui_win_list[i] != 0) { - char *curName = tui_win_name (&winList[i]->generic); + char *curName = tui_win_name (&tui_win_list[i]->generic); if (strlen (name) <= strlen (curName) && strncmp (name, curName, strlen (name)) == 0) - winInfo = winList[i]; + win_info = tui_win_list[i]; } i++; } } - return winInfo; + return win_info; } /* partialWinByName */ @@ -405,11 +433,11 @@ tui_partial_win_by_name (char *name) ** Answer the name of the window */ char * -tui_win_name (struct tui_gen_win_info * winInfo) +tui_win_name (struct tui_gen_win_info * win_info) { char *name = (char *) NULL; - switch (winInfo->type) + switch (win_info->type) { case SRC_WIN: name = SRC_NAME; @@ -464,13 +492,13 @@ tui_init_generic_part (struct tui_gen_win_info * win) win->height = win->origin.x = win->origin.y = - win->viewportHeight = - win->contentSize = - win->lastVisibleLine = 0; + win->viewport_height = + win->content_size = + win->last_visible_line = 0; win->handle = (WINDOW *) NULL; win->content = NULL; - win->contentInUse = - win->isVisible = FALSE; + win->content_in_use = + win->is_visible = FALSE; win->title = 0; } @@ -486,38 +514,38 @@ initContentElement (struct tui_win_element * element, enum tui_win_type type) { case SRC_WIN: case DISASSEM_WIN: - element->whichElement.source.line = (char *) NULL; - element->whichElement.source.lineOrAddr.lineNo = 0; - element->whichElement.source.isExecPoint = FALSE; - element->whichElement.source.hasBreak = FALSE; + element->which_element.source.line = (char *) NULL; + 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; break; case DATA_WIN: - tui_init_generic_part (&element->whichElement.dataWindow); - element->whichElement.dataWindow.type = DATA_ITEM_WIN; - ((struct tui_gen_win_info *) & element->whichElement.dataWindow)->content = + tui_init_generic_part (&element->which_element.data_window); + element->which_element.data_window.type = DATA_ITEM_WIN; + ((struct tui_gen_win_info *) & element->which_element.data_window)->content = (void **) tui_alloc_content (1, DATA_ITEM_WIN); ((struct tui_gen_win_info *) - & element->whichElement.dataWindow)->contentSize = 1; + & element->which_element.data_window)->content_size = 1; break; case CMD_WIN: - element->whichElement.command.line = (char *) NULL; + element->which_element.command.line = (char *) NULL; break; case DATA_ITEM_WIN: - element->whichElement.data.name = (char *) NULL; - element->whichElement.data.type = TUI_REGISTER; - element->whichElement.data.itemNo = UNDEFINED_ITEM; - element->whichElement.data.value = NULL; - element->whichElement.data.highlight = FALSE; + element->which_element.data.name = (char *) NULL; + element->which_element.data.type = TUI_REGISTER; + element->which_element.data.item_no = UNDEFINED_ITEM; + element->which_element.data.value = NULL; + element->which_element.data.highlight = FALSE; break; case LOCATOR_WIN: - element->whichElement.locator.fileName[0] = - element->whichElement.locator.procName[0] = (char) 0; - element->whichElement.locator.lineNo = 0; - element->whichElement.locator.addr = 0; + element->which_element.locator.file_name[0] = + element->which_element.locator.proc_name[0] = (char) 0; + element->which_element.locator.line_no = 0; + element->which_element.locator.addr = 0; break; case EXEC_INFO_WIN: - memset(element->whichElement.simpleString, ' ', - sizeof(element->whichElement.simpleString)); + memset(element->which_element.simple_string, ' ', + sizeof(element->which_element.simple_string)); break; default: break; @@ -529,37 +557,37 @@ initContentElement (struct tui_win_element * element, enum tui_win_type type) ** initWinInfo(). */ void -initWinInfo (struct tui_win_info * winInfo) +initWinInfo (struct tui_win_info * win_info) { - tui_init_generic_part (&winInfo->generic); - winInfo->canHighlight = - winInfo->isHighlighted = FALSE; - switch (winInfo->generic.type) + tui_init_generic_part (&win_info->generic); + win_info->can_highlight = + win_info->is_highlighted = FALSE; + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - winInfo->detail.sourceInfo.executionInfo = (struct tui_gen_win_info *) NULL; - winInfo->detail.sourceInfo.hasLocator = FALSE; - winInfo->detail.sourceInfo.horizontalOffset = 0; - winInfo->detail.sourceInfo.startLineOrAddr.addr = 0; - winInfo->detail.sourceInfo.filename = 0; + win_info->detail.source_info.execution_info = (struct tui_gen_win_info *) NULL; + win_info->detail.source_info.has_locator = FALSE; + win_info->detail.source_info.horizontal_offset = 0; + win_info->detail.source_info.start_line_or_addr.addr = 0; + win_info->detail.source_info.filename = 0; break; case DATA_WIN: - winInfo->detail.dataDisplayInfo.dataContent = (tui_win_content) NULL; - winInfo->detail.dataDisplayInfo.dataContentCount = 0; - winInfo->detail.dataDisplayInfo.regsContent = (tui_win_content) NULL; - winInfo->detail.dataDisplayInfo.regsContentCount = 0; - winInfo->detail.dataDisplayInfo.regsDisplayType = + win_info->detail.data_display_info.data_content = (tui_win_content) NULL; + win_info->detail.data_display_info.data_content_count = 0; + win_info->detail.data_display_info.regs_content = (tui_win_content) NULL; + win_info->detail.data_display_info.regs_content_count = 0; + win_info->detail.data_display_info.regs_display_type = TUI_UNDEFINED_REGS; - winInfo->detail.dataDisplayInfo.regsColumnCount = 1; - winInfo->detail.dataDisplayInfo.displayRegs = FALSE; + win_info->detail.data_display_info.regs_column_count = 1; + win_info->detail.data_display_info.display_regs = FALSE; break; case CMD_WIN: - winInfo->detail.commandInfo.curLine = 0; - winInfo->detail.commandInfo.curch = 0; + win_info->detail.command_info.cur_line = 0; + win_info->detail.command_info.curch = 0; break; default: - winInfo->detail.opaque = NULL; + win_info->detail.opaque = NULL; break; } @@ -570,16 +598,16 @@ initWinInfo (struct tui_win_info * winInfo) struct tui_win_info * tui_alloc_win_info (enum tui_win_type type) { - struct tui_win_info * winInfo = (struct tui_win_info *) NULL; + struct tui_win_info * win_info = (struct tui_win_info *) NULL; - winInfo = (struct tui_win_info *) xmalloc (sizeof (struct tui_win_info)); - if (m_winPtrNotNull (winInfo)) + win_info = (struct tui_win_info *) xmalloc (sizeof (struct tui_win_info)); + if ((win_info != NULL)) { - winInfo->generic.type = type; - initWinInfo (winInfo); + win_info->generic.type = type; + initWinInfo (win_info); } - return winInfo; + return win_info; } /* allocWinInfo */ @@ -631,28 +659,28 @@ tui_alloc_content (int numElements, enum tui_win_type type) there is a memory allocation error, in which case, (-1) is returned. */ int -tui_add_content_elements (struct tui_gen_win_info * winInfo, int numElements) +tui_add_content_elements (struct tui_gen_win_info * win_info, int numElements) { struct tui_win_element * elementPtr; int i, indexStart; - if (winInfo->content == NULL) + if (win_info->content == NULL) { - winInfo->content = (void **) tui_alloc_content (numElements, winInfo->type); + win_info->content = (void **) tui_alloc_content (numElements, win_info->type); indexStart = 0; } else - indexStart = winInfo->contentSize; - if (winInfo->content != NULL) + indexStart = win_info->content_size; + if (win_info->content != NULL) { for (i = indexStart; (i < numElements + indexStart); i++) { if ((elementPtr = (struct tui_win_element *) xmalloc (sizeof (struct tui_win_element))) != (struct tui_win_element *) NULL) { - winInfo->content[i] = (void *) elementPtr; - initContentElement (elementPtr, winInfo->type); - winInfo->contentSize++; + win_info->content[i] = (void *) elementPtr; + initContentElement (elementPtr, win_info->type); + win_info->content_size++; } else /* things must be really hosed now! We ran out of memory!? */ return (-1); @@ -663,14 +691,14 @@ tui_add_content_elements (struct tui_gen_win_info * winInfo, int numElements) } /* addContentElements */ -/* Delete all curses windows associated with winInfo, leaving everything +/* Delete all curses windows associated with win_info, leaving everything else intact. */ void -tuiDelWindow (struct tui_win_info * winInfo) +tuiDelWindow (struct tui_win_info * win_info) { struct tui_gen_win_info * genericWin; - switch (winInfo->generic.type) + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: @@ -679,48 +707,48 @@ tuiDelWindow (struct tui_win_info * winInfo) { tui_delete_win (genericWin->handle); genericWin->handle = (WINDOW *) NULL; - genericWin->isVisible = FALSE; + genericWin->is_visible = FALSE; } - if (winInfo->detail.sourceInfo.filename) + if (win_info->detail.source_info.filename) { - xfree (winInfo->detail.sourceInfo.filename); - winInfo->detail.sourceInfo.filename = 0; + xfree (win_info->detail.source_info.filename); + win_info->detail.source_info.filename = 0; } - genericWin = winInfo->detail.sourceInfo.executionInfo; + genericWin = win_info->detail.source_info.execution_info; if (genericWin != (struct tui_gen_win_info *) NULL) { tui_delete_win (genericWin->handle); genericWin->handle = (WINDOW *) NULL; - genericWin->isVisible = FALSE; + genericWin->is_visible = FALSE; } break; case DATA_WIN: - if (winInfo->generic.content != NULL) + if (win_info->generic.content != NULL) { - tui_del_data_windows (winInfo->detail.dataDisplayInfo.regsContent, - winInfo->detail.dataDisplayInfo.regsContentCount); - tui_del_data_windows (winInfo->detail.dataDisplayInfo.dataContent, - winInfo->detail.dataDisplayInfo.dataContentCount); + tui_del_data_windows (win_info->detail.data_display_info.regs_content, + win_info->detail.data_display_info.regs_content_count); + tui_del_data_windows (win_info->detail.data_display_info.data_content, + win_info->detail.data_display_info.data_content_count); } break; default: break; } - if (winInfo->generic.handle != (WINDOW *) NULL) + if (win_info->generic.handle != (WINDOW *) NULL) { - tui_delete_win (winInfo->generic.handle); - winInfo->generic.handle = (WINDOW *) NULL; - winInfo->generic.isVisible = FALSE; + tui_delete_win (win_info->generic.handle); + win_info->generic.handle = (WINDOW *) NULL; + win_info->generic.is_visible = FALSE; } } void -tui_free_window (struct tui_win_info * winInfo) +tui_free_window (struct tui_win_info * win_info) { struct tui_gen_win_info * genericWin; - switch (winInfo->generic.type) + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: @@ -731,12 +759,12 @@ tui_free_window (struct tui_win_info * winInfo) genericWin->handle = (WINDOW *) NULL; } tui_free_win_content (genericWin); - if (winInfo->detail.sourceInfo.filename) + if (win_info->detail.source_info.filename) { - xfree (winInfo->detail.sourceInfo.filename); - winInfo->detail.sourceInfo.filename = 0; + xfree (win_info->detail.source_info.filename); + win_info->detail.source_info.filename = 0; } - genericWin = winInfo->detail.sourceInfo.executionInfo; + genericWin = win_info->detail.source_info.execution_info; if (genericWin != (struct tui_gen_win_info *) NULL) { tui_delete_win (genericWin->handle); @@ -745,38 +773,38 @@ tui_free_window (struct tui_win_info * winInfo) } break; case DATA_WIN: - if (winInfo->generic.content != NULL) + if (win_info->generic.content != NULL) { - tui_free_data_content (winInfo->detail.dataDisplayInfo.regsContent, - winInfo->detail.dataDisplayInfo.regsContentCount); - winInfo->detail.dataDisplayInfo.regsContent = + tui_free_data_content (win_info->detail.data_display_info.regs_content, + win_info->detail.data_display_info.regs_content_count); + win_info->detail.data_display_info.regs_content = (tui_win_content) NULL; - winInfo->detail.dataDisplayInfo.regsContentCount = 0; - tui_free_data_content (winInfo->detail.dataDisplayInfo.dataContent, - winInfo->detail.dataDisplayInfo.dataContentCount); - winInfo->detail.dataDisplayInfo.dataContent = + win_info->detail.data_display_info.regs_content_count = 0; + tui_free_data_content (win_info->detail.data_display_info.data_content, + win_info->detail.data_display_info.data_content_count); + win_info->detail.data_display_info.data_content = (tui_win_content) NULL; - winInfo->detail.dataDisplayInfo.dataContentCount = 0; - winInfo->detail.dataDisplayInfo.regsDisplayType = + win_info->detail.data_display_info.data_content_count = 0; + win_info->detail.data_display_info.regs_display_type = TUI_UNDEFINED_REGS; - winInfo->detail.dataDisplayInfo.regsColumnCount = 1; - winInfo->detail.dataDisplayInfo.displayRegs = FALSE; - winInfo->generic.content = NULL; - winInfo->generic.contentSize = 0; + win_info->detail.data_display_info.regs_column_count = 1; + win_info->detail.data_display_info.display_regs = FALSE; + win_info->generic.content = NULL; + win_info->generic.content_size = 0; } break; default: break; } - if (winInfo->generic.handle != (WINDOW *) NULL) + if (win_info->generic.handle != (WINDOW *) NULL) { - tui_delete_win (winInfo->generic.handle); - winInfo->generic.handle = (WINDOW *) NULL; - tui_free_win_content (&winInfo->generic); + tui_delete_win (win_info->generic.handle); + win_info->generic.handle = (WINDOW *) NULL; + tui_free_win_content (&win_info->generic); } - if (winInfo->generic.title) - xfree (winInfo->generic.title); - xfree (winInfo); + if (win_info->generic.title) + xfree (win_info->generic.title); + xfree (win_info); } @@ -787,28 +815,28 @@ tui_free_all_source_wins_content (void) for (i = 0; i < (tui_source_windows ())->count; i++) { - struct tui_win_info * winInfo = (struct tui_win_info *) (tui_source_windows ())->list[i]; + struct tui_win_info * win_info = (struct tui_win_info *) (tui_source_windows ())->list[i]; - if (m_winPtrNotNull (winInfo)) + if (win_info != NULL) { - tui_free_win_content (&(winInfo->generic)); - tui_free_win_content (winInfo->detail.sourceInfo.executionInfo); + tui_free_win_content (&(win_info->generic)); + tui_free_win_content (win_info->detail.source_info.execution_info); } } } void -tui_free_win_content (struct tui_gen_win_info * winInfo) +tui_free_win_content (struct tui_gen_win_info * win_info) { - if (winInfo->content != NULL) + if (win_info->content != NULL) { - freeContent ((tui_win_content) winInfo->content, - winInfo->contentSize, - winInfo->type); - winInfo->content = NULL; + freeContent ((tui_win_content) win_info->content, + win_info->content_size, + win_info->type); + win_info->content = NULL; } - winInfo->contentSize = 0; + win_info->content_size = 0; return; } /* freeWinContent */ @@ -825,13 +853,13 @@ tui_del_data_windows (tui_win_content content, int contentSize) */ for (i = 0; i < contentSize; i++) { - struct tui_gen_win_info * genericWin = &content[i]->whichElement.dataWindow; + struct tui_gen_win_info * genericWin = &content[i]->which_element.data_window; if (genericWin != (struct tui_gen_win_info *) NULL) { tui_delete_win (genericWin->handle); genericWin->handle = (WINDOW *) NULL; - genericWin->isVisible = FALSE; + genericWin->is_visible = FALSE; } } } @@ -848,7 +876,7 @@ tui_free_data_content (tui_win_content content, int contentSize) */ for (i = 0; i < contentSize; i++) { - struct tui_gen_win_info * genericWin = &content[i]->whichElement.dataWindow; + struct tui_gen_win_info * genericWin = &content[i]->which_element.data_window; if (genericWin != (struct tui_gen_win_info *) NULL) { @@ -899,7 +927,7 @@ freeContentElements (tui_win_content content, int contentSize, enum tui_win_type if (type == SRC_WIN || type == DISASSEM_WIN) { /* free whole source block */ - xfree (content[0]->whichElement.source.line); + xfree (content[0]->which_element.source.line); } else { @@ -920,13 +948,13 @@ freeContentElements (tui_win_content content, int contentSize, enum tui_win_type ** Note that data elements are not allocated ** in a single block, but individually, as needed. */ - if (element->whichElement.data.type != TUI_REGISTER) - xfree ((void *)element->whichElement.data.name); - xfree (element->whichElement.data.value); + if (element->which_element.data.type != TUI_REGISTER) + xfree ((void *)element->which_element.data.name); + xfree (element->which_element.data.value); xfree (element); break; case CMD_WIN: - xfree (element->whichElement.command.line); + xfree (element->which_element.command.line); break; default: break; diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 82c03ad..8628172 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -40,12 +40,12 @@ struct tui_gen_win_info int height; /* window height */ struct tui_point origin; /* origin of window */ void **content; /* content of window */ - int contentSize; /* Size of content (# of elements) */ - int contentInUse; /* Can it be used, or is it already used? */ - int viewportHeight; /* viewport height */ - int lastVisibleLine; /* index of last visible line */ - int isVisible; /* whether the window is visible or not */ - char* title; /* Window title to display. */ + int content_size; /* Size of content (# of elements) */ + int content_in_use; /* Can it be used, or is it already used? */ + int viewport_height; /* viewport height */ + int last_visible_line; /* index of last visible line */ + int is_visible; /* whether the window is visible or not */ + char *title; /* Window title to display. */ }; /* Constant definitions */ @@ -146,26 +146,26 @@ enum tui_register_display_type /* Structure describing source line or line address */ union tui_line_or_address { - int lineNo; + int line_no; CORE_ADDR addr; }; /* Current Layout definition */ struct tui_layout_def { - enum tui_win_type displayMode; + enum tui_win_type display_mode; int split; - enum tui_register_display_type regsDisplayType; - enum tui_register_display_type floatRegsDisplayType; + enum tui_register_display_type regs_display_type; + enum tui_register_display_type float_regs_display_type; }; /* Elements in the Source/Disassembly Window */ struct tui_source_element { char *line; - union tui_line_or_address lineOrAddr; - int isExecPoint; - int hasBreak; + union tui_line_or_address line_or_addr; + int is_exec_point; + int has_break; }; @@ -173,7 +173,7 @@ struct tui_source_element struct tui_data_element { const char *name; - int itemNo; /* the register number, or data display number */ + int item_no; /* the register number, or data display number */ enum tui_data_type type; void *value; int highlight; @@ -192,9 +192,9 @@ struct tui_command_element /* Elements in the locator window content */ struct tui_locator_element { - char fileName[MAX_LOCATOR_ELEMENT_LEN]; - char procName[MAX_LOCATOR_ELEMENT_LEN]; - int lineNo; + char file_name[MAX_LOCATOR_ELEMENT_LEN]; + char proc_name[MAX_LOCATOR_ELEMENT_LEN]; + int line_no; CORE_ADDR addr; }; @@ -217,17 +217,17 @@ typedef char tui_exec_info_content[TUI_EXECINFO_SIZE]; union tui_which_element { struct tui_source_element source; /* the source elements */ - struct tui_gen_win_info dataWindow; /* data display elements */ - struct tui_data_element data; /* elements of dataWindow */ + struct tui_gen_win_info data_window; /* data display elements */ + struct tui_data_element data; /* elements of data_window */ struct tui_command_element command; /* command elements */ struct tui_locator_element locator; /* locator elements */ - tui_exec_info_content simpleString; /* simple char based elements */ + tui_exec_info_content simple_string; /* simple char based elements */ }; struct tui_win_element { int highlight; - union tui_which_element whichElement; + union tui_which_element which_element; }; @@ -238,30 +238,30 @@ typedef struct tui_win_element **tui_win_content; /* This struct defines the specific information about a data display window */ struct tui_data_info { - tui_win_content dataContent; /* start of data display content */ - int dataContentCount; - tui_win_content regsContent; /* start of regs display content */ - int regsContentCount; - enum tui_register_display_type regsDisplayType; - int regsColumnCount; - int displayRegs; /* Should regs be displayed at all? */ + tui_win_content data_content; /* start of data display content */ + int data_content_count; + tui_win_content regs_content; /* start of regs display content */ + int regs_content_count; + enum tui_register_display_type regs_display_type; + int regs_column_count; + int display_regs; /* Should regs be displayed at all? */ }; struct tui_source_info { - int hasLocator; /* Does locator belongs to this window? */ + int has_locator; /* Does locator belongs to this window? */ /* Execution information window. */ - struct tui_gen_win_info *executionInfo; - int horizontalOffset; /* used for horizontal scroll */ - union tui_line_or_address startLineOrAddr; + struct tui_gen_win_info *execution_info; + int horizontal_offset; /* used for horizontal scroll */ + union tui_line_or_address start_line_or_addr; char* filename; }; struct tui_command_info { - int curLine; /* The current line position */ + int cur_line; /* The current line position */ int curch; /* The current cursor position */ int start_line; }; @@ -273,53 +273,30 @@ struct tui_win_info struct tui_gen_win_info generic; /* general window information */ union { - struct tui_source_info sourceInfo; - struct tui_data_info dataDisplayInfo; - struct tui_command_info commandInfo; + struct tui_source_info source_info; + struct tui_data_info data_display_info; + struct tui_command_info command_info; void *opaque; } detail; - int canHighlight; /* Can this window ever be highlighted? */ - int isHighlighted; /* Is this window highlighted? */ + int can_highlight; /* Can this window ever be highlighted? */ + int is_highlighted; /* Is this window highlighted? */ }; -/* MACROS (prefixed with m_) */ - -/* Testing macros */ -#define m_genWinPtrIsNull(winInfo) \ - ((winInfo) == (struct tui_gen_win_info *)NULL) -#define m_genWinPtrNotNull(winInfo) \ - ((winInfo) != (struct tui_gen_win_info *)NULL) -#define m_winPtrIsNull(winInfo) \ - ((winInfo) == (struct tui_win_info *)NULL) -#define m_winPtrNotNull(winInfo) \ - ((winInfo) != (struct tui_win_info *)NULL) - -#define m_winIsSourceType(type) \ - (type == SRC_WIN || type == DISASSEM_WIN) -#define m_winIsAuxillary(winType) \ - (winType > MAX_MAJOR_WINDOWS) -#define m_hasLocator(winInfo) \ - ( ((winInfo) != (struct tui_win_info *)NULL) ? \ - (winInfo->detail.sourceInfo.hasLocator) : \ - FALSE ) - -#define m_setWinHighlightOn(winInfo) \ - if ((winInfo) != (struct tui_win_info *)NULL) \ - (winInfo)->isHighlighted = TRUE -#define m_setWinHighlightOff(winInfo) \ - if ((winInfo) != (struct tui_win_info *)NULL) \ - (winInfo)->isHighlighted = FALSE +extern int tui_win_is_source_type (enum tui_win_type win_type); +extern int tui_win_is_auxillary (enum tui_win_type win_type); +extern int tui_win_has_locator (struct tui_win_info *win_info); +extern void tui_set_win_highlight (struct tui_win_info *win_info, + int highlight); /* Global Data */ -extern struct tui_win_info *(winList[MAX_MAJOR_WINDOWS]); +extern struct tui_win_info *(tui_win_list[MAX_MAJOR_WINDOWS]); -/* Macros */ -#define srcWin winList[SRC_WIN] -#define disassemWin winList[DISASSEM_WIN] -#define dataWin winList[DATA_WIN] -#define cmdWin winList[CMD_WIN] +#define TUI_SRC_WIN tui_win_list[SRC_WIN] +#define TUI_DISASM_WIN tui_win_list[DISASSEM_WIN] +#define TUI_DATA_WIN tui_win_list[DATA_WIN] +#define TUI_CMD_WIN tui_win_list[CMD_WIN] /* Data Manipulation Functions */ extern void tui_initialize_static_data (void); @@ -351,7 +328,7 @@ extern struct tui_gen_win_info *tui_disassem_exec_info_win_ptr (void); extern struct tui_list * tui_source_windows (void); extern void tui_clear_source_windows (void); extern void tui_clear_source_windows_detail (void); -extern void tui_clear_win_detail (struct tui_win_info * winInfo); +extern void tui_clear_win_detail (struct tui_win_info * win_info); extern void tui_add_to_source_windows (struct tui_win_info *); extern int tui_default_tab_len (void); extern void tui_set_default_tab_len (int); @@ -364,6 +341,6 @@ extern void tui_set_win_resized_to (int); extern struct tui_win_info *tui_next_win (struct tui_win_info *); extern struct tui_win_info *tui_prev_win (struct tui_win_info *); -extern void tui_add_to_source_windows (struct tui_win_info * winInfo); +extern void tui_add_to_source_windows (struct tui_win_info * win_info); #endif /* TUI_DATA_H */ diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 1143ba2..81c849a 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -29,7 +29,7 @@ #include "value.h" #include "source.h" #include "disasm.h" - +#include "gdb_string.h" #include "tui/tui.h" #include "tui/tui-data.h" #include "tui/tui-win.h" @@ -177,7 +177,7 @@ tui_set_disassem_content (CORE_ADDR pc) { enum tui_status ret = TUI_FAILURE; register int i; - register int offset = disassemWin->detail.sourceInfo.horizontalOffset; + int offset = TUI_DISASM_WIN->detail.source_info.horizontal_offset; register int lineWidth, maxLines; CORE_ADDR cur_pc; struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); @@ -190,22 +190,22 @@ tui_set_disassem_content (CORE_ADDR pc) if (pc == 0) return TUI_FAILURE; - ret = tui_alloc_source_buffer (disassemWin); + ret = tui_alloc_source_buffer (TUI_DISASM_WIN); if (ret != TUI_SUCCESS) return ret; - disassemWin->detail.sourceInfo.startLineOrAddr.addr = pc; + TUI_DISASM_WIN->detail.source_info.start_line_or_addr.addr = pc; cur_pc = (CORE_ADDR) - (((struct tui_win_element *) locator->content[0])->whichElement.locator.addr); + (((struct tui_win_element *) locator->content[0])->which_element.locator.addr); - maxLines = disassemWin->generic.height - 2; /* account for hilite */ + maxLines = 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); - lineWidth = disassemWin->generic.width - 1; + lineWidth = TUI_DISASM_WIN->generic.width - 1; tui_disassemble (lines, pc, maxLines); @@ -235,8 +235,8 @@ tui_set_disassem_content (CORE_ADDR pc) struct tui_source_element* src; int curLen; - element = (struct tui_win_element *) disassemWin->generic.content[i]; - src = &element->whichElement.source; + 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); @@ -255,17 +255,17 @@ tui_set_disassem_content (CORE_ADDR pc) else src->line[0] = '\0'; - src->lineOrAddr.addr = lines[i].addr; - src->isExecPoint = lines[i].addr == cur_pc; + src->line_or_addr.addr = lines[i].addr; + src->is_exec_point = lines[i].addr == cur_pc; /* See whether there is a breakpoint installed. */ - src->hasBreak = (!src->isExecPoint + src->has_break = (!src->is_exec_point && breakpoint_here_p (pc) != no_breakpoint_here); xfree (lines[i].addr_string); xfree (lines[i].insn); } - disassemWin->generic.contentSize = i; + TUI_DISASM_WIN->generic.content_size = i; return TUI_SUCCESS; } @@ -280,13 +280,13 @@ tui_show_disassem (CORE_ADDR startAddr) val.addr = startAddr; tui_add_win_to_layout (DISASSEM_WIN); - tui_update_source_window (disassemWin, s, val, FALSE); + 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 == srcWin) - tui_set_win_focus_to (disassemWin); + if (tui_current_layout () != SRC_DISASSEM_COMMAND && winWithFocus == TUI_SRC_WIN) + tui_set_win_focus_to (TUI_DISASM_WIN); return; } @@ -308,8 +308,8 @@ tui_show_disassem_and_update_source (CORE_ADDR startAddr) ** note that it follows what is in the disassembly window and visa-versa */ sal = find_pc_line (startAddr, 0); - val.lineNo = sal.line; - tui_update_source_window (srcWin, sal.symtab, val, TRUE); + val.line_no = sal.line; + tui_update_source_window (TUI_SRC_WIN, sal.symtab, val, TRUE); if (sal.symtab) { set_current_source_symtab_and_line (&sal); @@ -330,7 +330,7 @@ tui_get_begin_asm_address (void) CORE_ADDR addr; locator = tui_locator_win_info_ptr (); - element = &((struct tui_win_element *) locator->content[0])->whichElement.locator; + element = &((struct tui_win_element *) locator->content[0])->which_element.locator; if (element->addr == 0) { @@ -377,7 +377,7 @@ void tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection, int numToScroll) { - if (disassemWin->generic.content != NULL) + if (TUI_DISASM_WIN->generic.content != NULL) { CORE_ADDR pc; tui_win_content content; @@ -386,18 +386,18 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection, int maxLines, dir; struct symtab_and_line cursal = get_current_source_symtab_and_line (); - content = (tui_win_content) disassemWin->generic.content; + content = (tui_win_content) TUI_DISASM_WIN->generic.content; if (cursal.symtab == (struct symtab *) NULL) s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); else s = cursal.symtab; /* account for hilite */ - maxLines = disassemWin->generic.height - 2; - pc = content[0]->whichElement.source.lineOrAddr.addr; + maxLines = TUI_DISASM_WIN->generic.height - 2; + pc = content[0]->which_element.source.line_or_addr.addr; dir = (scrollDirection == FORWARD_SCROLL) ? maxLines : - maxLines; val.addr = tui_find_disassembly_address (pc, dir); - tui_update_source_window_as_is (disassemWin, s, val, FALSE); + tui_update_source_window_as_is (TUI_DISASM_WIN, s, val, FALSE); } } diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 1a7d096..bc52ce7 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -167,7 +167,7 @@ tui_puts (const char *string) char c; WINDOW *w; - w = cmdWin->generic.handle; + w = TUI_CMD_WIN->generic.handle; while ((c = *string++) != 0) { /* Catch annotation and discard them. We need two \032 and @@ -184,9 +184,9 @@ tui_puts (const char *string) else if (c == '\n') tui_skip_line = -1; } - getyx (w, cmdWin->detail.commandInfo.curLine, - cmdWin->detail.commandInfo.curch); - cmdWin->detail.commandInfo.start_line = cmdWin->detail.commandInfo.curLine; + getyx (w, TUI_CMD_WIN->detail.command_info.cur_line, + TUI_CMD_WIN->detail.command_info.curch); + TUI_CMD_WIN->detail.command_info.start_line = TUI_CMD_WIN->detail.command_info.cur_line; /* We could defer the following. */ wrefresh (w); @@ -211,18 +211,18 @@ tui_redisplay_readline (void) /* Detect when we temporarily left SingleKey and now the readline edit buffer is empty, automatically restore the SingleKey mode. */ - if (tui_current_key_mode == tui_one_command_mode && rl_end == 0) - tui_set_key_mode (tui_single_key_mode); + if (tui_current_key_mode == TUI_ONE_COMMAND_MODE && rl_end == 0) + tui_set_key_mode (TUI_SINGLE_KEY_MODE); - if (tui_current_key_mode == tui_single_key_mode) + if (tui_current_key_mode == TUI_SINGLE_KEY_MODE) prompt = ""; else prompt = tui_rl_saved_prompt; c_pos = -1; c_line = -1; - w = cmdWin->generic.handle; - start_line = cmdWin->detail.commandInfo.start_line; + w = TUI_CMD_WIN->generic.handle; + start_line = TUI_CMD_WIN->detail.command_info.start_line; wmove (w, start_line, 0); prev_col = 0; height = 1; @@ -255,8 +255,8 @@ tui_redisplay_readline (void) } if (c == '\n') { - getyx (w, cmdWin->detail.commandInfo.start_line, - cmdWin->detail.commandInfo.curch); + getyx (w, TUI_CMD_WIN->detail.command_info.start_line, + TUI_CMD_WIN->detail.command_info.curch); } getyx (w, line, col); if (col < prev_col) @@ -264,15 +264,15 @@ tui_redisplay_readline (void) prev_col = col; } wclrtobot (w); - getyx (w, cmdWin->detail.commandInfo.start_line, - cmdWin->detail.commandInfo.curch); + getyx (w, TUI_CMD_WIN->detail.command_info.start_line, + TUI_CMD_WIN->detail.command_info.curch); if (c_line >= 0) { wmove (w, c_line, c_pos); - cmdWin->detail.commandInfo.curLine = c_line; - cmdWin->detail.commandInfo.curch = c_pos; + TUI_CMD_WIN->detail.command_info.cur_line = c_line; + TUI_CMD_WIN->detail.command_info.curch = c_pos; } - cmdWin->detail.commandInfo.start_line -= height - 1; + TUI_CMD_WIN->detail.command_info.start_line -= height - 1; wrefresh (w); fflush(stdout); @@ -415,7 +415,7 @@ tui_rl_display_match_list (matches, len, max) char *temp; /* Screen dimension correspond to the TUI command window. */ - int screenwidth = cmdWin->generic.width; + int screenwidth = TUI_CMD_WIN->generic.width; /* If there are many items, then ask the user if she really wants to see them all. */ @@ -587,10 +587,10 @@ tui_cont_sig (int sig) tui_refresh_all_win (); /* Update cursor position on the screen. */ - wmove (cmdWin->generic.handle, - cmdWin->detail.commandInfo.start_line, - cmdWin->detail.commandInfo.curch); - wrefresh (cmdWin->generic.handle); + wmove (TUI_CMD_WIN->generic.handle, + TUI_CMD_WIN->detail.command_info.start_line, + TUI_CMD_WIN->detail.command_info.curch); + wrefresh (TUI_CMD_WIN->generic.handle); } signal (sig, tui_cont_sig); } @@ -651,7 +651,7 @@ tui_getc (FILE *fp) int ch; WINDOW *w; - w = cmdWin->generic.handle; + w = TUI_CMD_WIN->generic.handle; #ifdef TUI_USE_PIPE_FOR_READLINE /* Flush readline output. */ @@ -671,7 +671,7 @@ tui_getc (FILE *fp) user we recognized the command. */ if (rl_end == 0) { - wmove (w, cmdWin->detail.commandInfo.curLine, 0); + wmove (w, TUI_CMD_WIN->detail.command_info.cur_line, 0); /* Clear the line. This will blink the gdb prompt since it will be redrawn at the same line. */ @@ -681,8 +681,8 @@ tui_getc (FILE *fp) } else { - wmove (w, cmdWin->detail.commandInfo.curLine, - cmdWin->detail.commandInfo.curch); + wmove (w, TUI_CMD_WIN->detail.command_info.cur_line, + TUI_CMD_WIN->detail.command_info.curch); waddch (w, ch); } } @@ -693,7 +693,7 @@ tui_getc (FILE *fp) } if (ch == '\n' || ch == '\r' || ch == '\f') - cmdWin->detail.commandInfo.curch = 0; + TUI_CMD_WIN->detail.command_info.curch = 0; #if 0 else tuiIncrCommandCharCountBy (1); diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index f6dde02..3c1e230 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -96,7 +96,7 @@ showLayout (enum tui_layout_type layout) if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND) { _showData (layout); - tui_refresh_all (winList); + tui_refresh_all (tui_win_list); } else { @@ -109,16 +109,16 @@ showLayout (enum tui_layout_type layout) /* Now show the new layout */ case SRC_COMMAND: _showSourceCommand (); - tui_add_to_source_windows (srcWin); + tui_add_to_source_windows (TUI_SRC_WIN); break; case DISASSEM_COMMAND: _showDisassemCommand (); - tui_add_to_source_windows (disassemWin); + tui_add_to_source_windows (TUI_DISASM_WIN); break; case SRC_DISASSEM_COMMAND: _showSourceDisassemCommand (); - tui_add_to_source_windows (srcWin); - tui_add_to_source_windows (disassemWin); + tui_add_to_source_windows (TUI_SRC_WIN); + tui_add_to_source_windows (TUI_DISASM_WIN); break; default: break; @@ -132,14 +132,14 @@ showLayout (enum tui_layout_type layout) SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND. If the layout is SRC_DATA_COMMAND, DISASSEM_DATA_COMMAND, or UNDEFINED_LAYOUT, then the data window is populated according to - regsDisplayType. */ + regs_display_type. */ enum tui_status tui_set_layout (enum tui_layout_type layoutType, - enum tui_register_display_type regsDisplayType) + enum tui_register_display_type regs_display_type) { enum tui_status status = TUI_SUCCESS; - if (layoutType != UNDEFINED_LAYOUT || regsDisplayType != TUI_UNDEFINED_REGS) + if (layoutType != UNDEFINED_LAYOUT || regs_display_type != TUI_UNDEFINED_REGS) { enum tui_layout_type curLayout = tui_current_layout (), newLayout = UNDEFINED_LAYOUT; int regsPopulate = FALSE; @@ -150,7 +150,7 @@ tui_set_layout (enum tui_layout_type layoutType, if (layoutType == UNDEFINED_LAYOUT && - regsDisplayType != TUI_UNDEFINED_REGS) + regs_display_type != TUI_UNDEFINED_REGS) { if (curLayout == SRC_DISASSEM_COMMAND) newLayout = DISASSEM_DATA_COMMAND; @@ -165,8 +165,8 @@ tui_set_layout (enum tui_layout_type layoutType, regsPopulate = (newLayout == SRC_DATA_COMMAND || newLayout == DISASSEM_DATA_COMMAND || - regsDisplayType != TUI_UNDEFINED_REGS); - if (newLayout != curLayout || regsDisplayType != TUI_UNDEFINED_REGS) + regs_display_type != TUI_UNDEFINED_REGS); + if (newLayout != curLayout || regs_display_type != TUI_UNDEFINED_REGS) { if (newLayout != curLayout) { @@ -174,13 +174,13 @@ tui_set_layout (enum tui_layout_type layoutType, /* ** Now determine where focus should be */ - if (winWithFocus != cmdWin) + if (winWithFocus != TUI_CMD_WIN) { switch (newLayout) { case SRC_COMMAND: - tui_set_win_focus_to (srcWin); - layoutDef->displayMode = SRC_WIN; + tui_set_win_focus_to (TUI_SRC_WIN); + layoutDef->display_mode = SRC_WIN; layoutDef->split = FALSE; break; case DISASSEM_COMMAND: @@ -192,8 +192,8 @@ tui_set_layout (enum tui_layout_type layoutType, ** We still want to show the assembly though! */ addr = tui_get_begin_asm_address (); - tui_set_win_focus_to (disassemWin); - layoutDef->displayMode = DISASSEM_WIN; + tui_set_win_focus_to (TUI_DISASM_WIN); + layoutDef->display_mode = DISASSEM_WIN; layoutDef->split = FALSE; break; case SRC_DISASSEM_COMMAND: @@ -205,18 +205,18 @@ tui_set_layout (enum tui_layout_type layoutType, ** We still want to show the assembly though! */ addr = tui_get_begin_asm_address (); - if (winWithFocus == srcWin) - tui_set_win_focus_to (srcWin); + if (winWithFocus == TUI_SRC_WIN) + tui_set_win_focus_to (TUI_SRC_WIN); else - tui_set_win_focus_to (disassemWin); + tui_set_win_focus_to (TUI_DISASM_WIN); layoutDef->split = TRUE; break; case SRC_DATA_COMMAND: - if (winWithFocus != dataWin) - tui_set_win_focus_to (srcWin); + if (winWithFocus != TUI_DATA_WIN) + tui_set_win_focus_to (TUI_SRC_WIN); else - tui_set_win_focus_to (dataWin); - layoutDef->displayMode = SRC_WIN; + tui_set_win_focus_to (TUI_DATA_WIN); + layoutDef->display_mode = SRC_WIN; layoutDef->split = FALSE; break; case DISASSEM_DATA_COMMAND: @@ -228,11 +228,11 @@ tui_set_layout (enum tui_layout_type layoutType, ** We still want to show the assembly though! */ addr = tui_get_begin_asm_address (); - if (winWithFocus != dataWin) - tui_set_win_focus_to (disassemWin); + if (winWithFocus != TUI_DATA_WIN) + tui_set_win_focus_to (TUI_DISASM_WIN); else - tui_set_win_focus_to (dataWin); - layoutDef->displayMode = DISASSEM_WIN; + tui_set_win_focus_to (TUI_DATA_WIN); + layoutDef->display_mode = DISASSEM_WIN; layoutDef->split = FALSE; break; default: @@ -253,10 +253,10 @@ tui_set_layout (enum tui_layout_type layoutType, } if (regsPopulate) { - layoutDef->regsDisplayType = - (regsDisplayType == TUI_UNDEFINED_REGS ? - TUI_GENERAL_REGS : regsDisplayType); - tui_show_registers (layoutDef->regsDisplayType); + layoutDef->regs_display_type = + (regs_display_type == TUI_UNDEFINED_REGS ? + TUI_GENERAL_REGS : regs_display_type); + tui_show_registers (layoutDef->regs_display_type); } } } @@ -329,26 +329,26 @@ tuiDefaultWinHeight (enum tui_win_type type, enum tui_layout_type layout) { int h; - if (winList[type] != (struct tui_win_info *) NULL) - h = winList[type]->generic.height; + if (tui_win_list[type] != (struct tui_win_info *) NULL) + h = tui_win_list[type]->generic.height; else { switch (layout) { case SRC_COMMAND: case DISASSEM_COMMAND: - if (m_winPtrIsNull (cmdWin)) + if (TUI_CMD_WIN == NULL) h = tui_term_height () / 2; else - h = tui_term_height () - cmdWin->generic.height; + h = tui_term_height () - TUI_CMD_WIN->generic.height; break; case SRC_DISASSEM_COMMAND: case SRC_DATA_COMMAND: case DISASSEM_DATA_COMMAND: - if (m_winPtrIsNull (cmdWin)) + if (TUI_CMD_WIN == NULL) h = tui_term_height () / 3; else - h = (tui_term_height () - cmdWin->generic.height) / 2; + h = (tui_term_height () - TUI_CMD_WIN->generic.height) / 2; break; default: h = 0; @@ -371,7 +371,7 @@ tui_default_win_viewport_height (enum tui_win_type type, h = tuiDefaultWinHeight (type, layout); - if (winList[type] == cmdWin) + if (tui_win_list[type] == TUI_CMD_WIN) h -= 1; else h -= 2; @@ -471,14 +471,14 @@ tui_set_layout_for_display_command (const char *layoutName) */ if (subset_compare (bufPtr, TUI_FLOAT_REGS_NAME)) { - if (dataWin->detail.dataDisplayInfo.regsDisplayType != + if (TUI_DATA_WIN->detail.data_display_info.regs_display_type != TUI_SFLOAT_REGS && - dataWin->detail.dataDisplayInfo.regsDisplayType != + TUI_DATA_WIN->detail.data_display_info.regs_display_type != TUI_DFLOAT_REGS) dpyType = TUI_SFLOAT_REGS; else dpyType = - dataWin->detail.dataDisplayInfo.regsDisplayType; + TUI_DATA_WIN->detail.data_display_info.regs_display_type; } else if (subset_compare (bufPtr, TUI_GENERAL_SPECIAL_REGS_NAME)) @@ -487,12 +487,12 @@ tui_set_layout_for_display_command (const char *layoutName) dpyType = TUI_GENERAL_REGS; else if (subset_compare (bufPtr, TUI_SPECIAL_REGS_NAME)) dpyType = TUI_SPECIAL_REGS; - else if (dataWin) + else if (TUI_DATA_WIN) { - if (dataWin->detail.dataDisplayInfo.regsDisplayType != + if (TUI_DATA_WIN->detail.data_display_info.regs_display_type != TUI_UNDEFINED_REGS) dpyType = - dataWin->detail.dataDisplayInfo.regsDisplayType; + TUI_DATA_WIN->detail.data_display_info.regs_display_type; else dpyType = TUI_GENERAL_REGS; } @@ -538,14 +538,14 @@ _extractDisplayStartAddr (void) case SRC_COMMAND: case SRC_DATA_COMMAND: find_line_pc (cursal.symtab, - srcWin->detail.sourceInfo.startLineOrAddr.lineNo, + TUI_SRC_WIN->detail.source_info.start_line_or_addr.line_no, &pc); addr = pc; break; case DISASSEM_COMMAND: case SRC_DISASSEM_COMMAND: case DISASSEM_DATA_COMMAND: - addr = disassemWin->detail.sourceInfo.startLineOrAddr.addr; + addr = TUI_DISASM_WIN->detail.source_info.start_line_or_addr.addr; break; default: addr = 0; @@ -562,14 +562,14 @@ _tuiHandleXDBLayout (struct tui_layout_def * layoutDef) if (layoutDef->split) { tui_set_layout (SRC_DISASSEM_COMMAND, TUI_UNDEFINED_REGS); - tui_set_win_focus_to (winList[layoutDef->displayMode]); + tui_set_win_focus_to (tui_win_list[layoutDef->display_mode]); } else { - if (layoutDef->displayMode == SRC_WIN) + if (layoutDef->display_mode == SRC_WIN) tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS); else - tui_set_layout (DISASSEM_DATA_COMMAND, layoutDef->regsDisplayType); + tui_set_layout (DISASSEM_DATA_COMMAND, layoutDef->regs_display_type); } @@ -584,10 +584,10 @@ _tuiToggleLayout_command (char *arg, int fromTTY) /* Make sure the curses mode is enabled. */ tui_enable (); - if (layoutDef->displayMode == SRC_WIN) - layoutDef->displayMode = DISASSEM_WIN; + if (layoutDef->display_mode == SRC_WIN) + layoutDef->display_mode = DISASSEM_WIN; else - layoutDef->displayMode = SRC_WIN; + layoutDef->display_mode = SRC_WIN; if (!layoutDef->split) _tuiHandleXDBLayout (layoutDef); @@ -681,7 +681,7 @@ _makeCommandWindow (struct tui_win_info * * winInfoPtr, int height, int originY) originY, DONT_BOX_WINDOW); - (*winInfoPtr)->canHighlight = FALSE; + (*winInfoPtr)->can_highlight = FALSE; return; } /* _makeCommandWindow */ @@ -767,43 +767,43 @@ _showSourceDisassemCommand (void) { int cmdHeight, srcHeight, asmHeight; - if (m_winPtrNotNull (cmdWin)) - cmdHeight = cmdWin->generic.height; + if (TUI_CMD_WIN != NULL) + cmdHeight = TUI_CMD_WIN->generic.height; else cmdHeight = tui_term_height () / 3; srcHeight = (tui_term_height () - cmdHeight) / 2; asmHeight = tui_term_height () - (srcHeight + cmdHeight); - if (m_winPtrIsNull (srcWin)) - _makeSourceWindow (&srcWin, srcHeight, 0); + if (TUI_SRC_WIN == NULL) + _makeSourceWindow (&TUI_SRC_WIN, srcHeight, 0); else { - _initGenWinInfo (&srcWin->generic, - srcWin->generic.type, + _initGenWinInfo (&TUI_SRC_WIN->generic, + TUI_SRC_WIN->generic.type, srcHeight, - srcWin->generic.width, - srcWin->detail.sourceInfo.executionInfo->width, + TUI_SRC_WIN->generic.width, + TUI_SRC_WIN->detail.source_info.execution_info->width, 0); - srcWin->canHighlight = TRUE; - _initGenWinInfo (srcWin->detail.sourceInfo.executionInfo, + TUI_SRC_WIN->can_highlight = TRUE; + _initGenWinInfo (TUI_SRC_WIN->detail.source_info.execution_info, EXEC_INFO_WIN, srcHeight, 3, 0, 0); - tui_make_visible (&srcWin->generic); - tui_make_visible (srcWin->detail.sourceInfo.executionInfo); - srcWin->detail.sourceInfo.hasLocator = FALSE;; + tui_make_visible (&TUI_SRC_WIN->generic); + tui_make_visible (TUI_SRC_WIN->detail.source_info.execution_info); + TUI_SRC_WIN->detail.source_info.has_locator = FALSE;; } - if (m_winPtrNotNull (srcWin)) + if (TUI_SRC_WIN != NULL) { struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); - tui_show_source_content (srcWin); - if (m_winPtrIsNull (disassemWin)) + tui_show_source_content (TUI_SRC_WIN); + if (TUI_DISASM_WIN == NULL) { - _makeDisassemWindow (&disassemWin, asmHeight, srcHeight - 1); + _makeDisassemWindow (&TUI_DISASM_WIN, asmHeight, srcHeight - 1); _initAndMakeWin ((void **) & locator, LOCATOR_WIN, 2 /* 1 */ , @@ -820,49 +820,49 @@ _showSourceDisassemCommand (void) tui_term_width (), 0, (srcHeight + asmHeight) - 1); - disassemWin->detail.sourceInfo.hasLocator = TRUE; + TUI_DISASM_WIN->detail.source_info.has_locator = TRUE; _initGenWinInfo ( - &disassemWin->generic, - disassemWin->generic.type, + &TUI_DISASM_WIN->generic, + TUI_DISASM_WIN->generic.type, asmHeight, - disassemWin->generic.width, - disassemWin->detail.sourceInfo.executionInfo->width, + TUI_DISASM_WIN->generic.width, + TUI_DISASM_WIN->detail.source_info.execution_info->width, srcHeight - 1); - _initGenWinInfo (disassemWin->detail.sourceInfo.executionInfo, + _initGenWinInfo (TUI_DISASM_WIN->detail.source_info.execution_info, EXEC_INFO_WIN, asmHeight, 3, 0, srcHeight - 1); - disassemWin->canHighlight = TRUE; - tui_make_visible (&disassemWin->generic); - tui_make_visible (disassemWin->detail.sourceInfo.executionInfo); + TUI_DISASM_WIN->can_highlight = TRUE; + tui_make_visible (&TUI_DISASM_WIN->generic); + tui_make_visible (TUI_DISASM_WIN->detail.source_info.execution_info); } - if (m_winPtrNotNull (disassemWin)) + if (TUI_DISASM_WIN != NULL) { - srcWin->detail.sourceInfo.hasLocator = FALSE; - disassemWin->detail.sourceInfo.hasLocator = TRUE; + TUI_SRC_WIN->detail.source_info.has_locator = FALSE; + TUI_DISASM_WIN->detail.source_info.has_locator = TRUE; tui_make_visible (locator); tui_show_locator_content (); - tui_show_source_content (disassemWin); + tui_show_source_content (TUI_DISASM_WIN); - if (m_winPtrIsNull (cmdWin)) - _makeCommandWindow (&cmdWin, + if (TUI_CMD_WIN == NULL) + _makeCommandWindow (&TUI_CMD_WIN, cmdHeight, tui_term_height () - cmdHeight); else { - _initGenWinInfo (&cmdWin->generic, - cmdWin->generic.type, - cmdWin->generic.height, - cmdWin->generic.width, + _initGenWinInfo (&TUI_CMD_WIN->generic, + TUI_CMD_WIN->generic.type, + TUI_CMD_WIN->generic.height, + TUI_CMD_WIN->generic.width, 0, - cmdWin->generic.origin.y); - cmdWin->canHighlight = FALSE; - tui_make_visible (&cmdWin->generic); + TUI_CMD_WIN->generic.origin.y); + TUI_CMD_WIN->can_highlight = FALSE; + tui_make_visible (&TUI_CMD_WIN->generic); } - if (m_winPtrNotNull (cmdWin)) - tui_refresh_win (&cmdWin->generic); + if (TUI_CMD_WIN != NULL) + tui_refresh_win (&TUI_CMD_WIN->generic); } } tui_set_current_layout_to (SRC_DISASSEM_COMMAND); @@ -879,7 +879,7 @@ _showSourceDisassemCommand (void) static void _showData (enum tui_layout_type newLayout) { - int totalHeight = (tui_term_height () - cmdWin->generic.height); + int totalHeight = (tui_term_height () - TUI_CMD_WIN->generic.height); int srcHeight, dataHeight; enum tui_win_type winType; struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); @@ -889,18 +889,18 @@ _showData (enum tui_layout_type newLayout) srcHeight = totalHeight - dataHeight; tui_make_all_invisible (); tui_make_invisible (locator); - _makeDataWindow (&dataWin, dataHeight, 0); - dataWin->canHighlight = TRUE; + _makeDataWindow (&TUI_DATA_WIN, dataHeight, 0); + TUI_DATA_WIN->can_highlight = TRUE; if (newLayout == SRC_DATA_COMMAND) winType = SRC_WIN; else winType = DISASSEM_WIN; - if (m_winPtrIsNull (winList[winType])) + if (tui_win_list[winType] == NULL) { if (winType == SRC_WIN) - _makeSourceWindow (&winList[winType], srcHeight, dataHeight - 1); + _makeSourceWindow (&tui_win_list[winType], srcHeight, dataHeight - 1); else - _makeDisassemWindow (&winList[winType], srcHeight, dataHeight - 1); + _makeDisassemWindow (&tui_win_list[winType], srcHeight, dataHeight - 1); _initAndMakeWin ((void **) & locator, LOCATOR_WIN, 2 /* 1 */ , @@ -911,20 +911,20 @@ _showData (enum tui_layout_type newLayout) } else { - _initGenWinInfo (&winList[winType]->generic, - winList[winType]->generic.type, + _initGenWinInfo (&tui_win_list[winType]->generic, + tui_win_list[winType]->generic.type, srcHeight, - winList[winType]->generic.width, - winList[winType]->detail.sourceInfo.executionInfo->width, + tui_win_list[winType]->generic.width, + tui_win_list[winType]->detail.source_info.execution_info->width, dataHeight - 1); - _initGenWinInfo (winList[winType]->detail.sourceInfo.executionInfo, + _initGenWinInfo (tui_win_list[winType]->detail.source_info.execution_info, EXEC_INFO_WIN, srcHeight, 3, 0, dataHeight - 1); - tui_make_visible (&winList[winType]->generic); - tui_make_visible (winList[winType]->detail.sourceInfo.executionInfo); + tui_make_visible (&tui_win_list[winType]->generic); + tui_make_visible (tui_win_list[winType]->detail.source_info.execution_info); _initGenWinInfo (locator, LOCATOR_WIN, 2 /* 1 */ , @@ -932,10 +932,10 @@ _showData (enum tui_layout_type newLayout) 0, totalHeight - 1); } - winList[winType]->detail.sourceInfo.hasLocator = TRUE; + tui_win_list[winType]->detail.source_info.has_locator = TRUE; tui_make_visible (locator); tui_show_locator_content (); - tui_add_to_source_windows (winList[winType]); + tui_add_to_source_windows (tui_win_list[winType]); tui_set_current_layout_to (newLayout); return; @@ -955,12 +955,12 @@ _initGenWinInfo (struct tui_gen_win_info * winInfo, enum tui_win_type type, winInfo->height = h; if (h > 1) { - winInfo->viewportHeight = h - 1; + winInfo->viewport_height = h - 1; if (winInfo->type != CMD_WIN) - winInfo->viewportHeight--; + winInfo->viewport_height--; } else - winInfo->viewportHeight = 1; + winInfo->viewport_height = 1; winInfo->origin.x = originX; winInfo->origin.y = originY; @@ -979,12 +979,12 @@ _initAndMakeWin (void ** winInfoPtr, enum tui_win_type winType, if (opaqueWinInfo == NULL) { - if (m_winIsAuxillary (winType)) + if (tui_win_is_auxillary (winType)) opaqueWinInfo = (void *) tui_alloc_generic_win_info (); else opaqueWinInfo = (void *) tui_alloc_win_info (winType); } - if (m_winIsAuxillary (winType)) + if (tui_win_is_auxillary (winType)) generic = (struct tui_gen_win_info *) opaqueWinInfo; else generic = &((struct tui_win_info *) opaqueWinInfo)->generic; @@ -992,12 +992,12 @@ _initAndMakeWin (void ** winInfoPtr, enum tui_win_type winType, if (opaqueWinInfo != NULL) { _initGenWinInfo (generic, winType, height, width, originX, originY); - if (!m_winIsAuxillary (winType)) + if (!tui_win_is_auxillary (winType)) { if (generic->type == CMD_WIN) - ((struct tui_win_info *) opaqueWinInfo)->canHighlight = FALSE; + ((struct tui_win_info *) opaqueWinInfo)->can_highlight = FALSE; else - ((struct tui_win_info *) opaqueWinInfo)->canHighlight = TRUE; + ((struct tui_win_info *) opaqueWinInfo)->can_highlight = TRUE; } tui_make_window (generic, boxIt); } @@ -1012,16 +1012,16 @@ static void _makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, enum tui_win_type type, int height, int originY) { - struct tui_gen_win_info * executionInfo = (struct tui_gen_win_info *) NULL; + struct tui_gen_win_info * execution_info = (struct tui_gen_win_info *) NULL; /* ** Create the exeuction info window. */ if (type == SRC_WIN) - executionInfo = tui_source_exec_info_win_ptr (); + execution_info = tui_source_exec_info_win_ptr (); else - executionInfo = tui_disassem_exec_info_win_ptr (); - _initAndMakeWin ((void **) & executionInfo, + execution_info = tui_disassem_exec_info_win_ptr (); + _initAndMakeWin ((void **) & execution_info, EXEC_INFO_WIN, height, 3, @@ -1034,12 +1034,12 @@ _makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, enum tui_win_ty _initAndMakeWin ((void **) winInfoPtr, type, height, - tui_term_width () - executionInfo->width, - executionInfo->width, + tui_term_width () - execution_info->width, + execution_info->width, originY, BOX_WINDOW); - (*winInfoPtr)->detail.sourceInfo.executionInfo = executionInfo; + (*winInfoPtr)->detail.source_info.execution_info = execution_info; return; } /* _makeSourceOrDisassemWindow */ @@ -1058,19 +1058,19 @@ _showSourceOrDisassemAndCommand (enum tui_layout_type layoutType) int srcHeight, cmdHeight; struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); - if (m_winPtrNotNull (cmdWin)) - cmdHeight = cmdWin->generic.height; + if (TUI_CMD_WIN != NULL) + cmdHeight = TUI_CMD_WIN->generic.height; else cmdHeight = tui_term_height () / 3; srcHeight = tui_term_height () - cmdHeight; if (layoutType == SRC_COMMAND) - winInfoPtr = &srcWin; + winInfoPtr = &TUI_SRC_WIN; else - winInfoPtr = &disassemWin; + winInfoPtr = &TUI_DISASM_WIN; - if (m_winPtrIsNull (*winInfoPtr)) + if ((*winInfoPtr) == NULL) { if (layoutType == SRC_COMMAND) _makeSourceWindow (winInfoPtr, srcHeight - 1, 0); @@ -1092,46 +1092,46 @@ _showSourceOrDisassemAndCommand (enum tui_layout_type layoutType) tui_term_width (), 0, srcHeight - 1); - (*winInfoPtr)->detail.sourceInfo.hasLocator = TRUE; + (*winInfoPtr)->detail.source_info.has_locator = TRUE; _initGenWinInfo ( &(*winInfoPtr)->generic, (*winInfoPtr)->generic.type, srcHeight - 1, (*winInfoPtr)->generic.width, - (*winInfoPtr)->detail.sourceInfo.executionInfo->width, + (*winInfoPtr)->detail.source_info.execution_info->width, 0); - _initGenWinInfo ((*winInfoPtr)->detail.sourceInfo.executionInfo, + _initGenWinInfo ((*winInfoPtr)->detail.source_info.execution_info, EXEC_INFO_WIN, srcHeight - 1, 3, 0, 0); - (*winInfoPtr)->canHighlight = TRUE; + (*winInfoPtr)->can_highlight = TRUE; tui_make_visible (&(*winInfoPtr)->generic); - tui_make_visible ((*winInfoPtr)->detail.sourceInfo.executionInfo); + tui_make_visible ((*winInfoPtr)->detail.source_info.execution_info); } - if (m_winPtrNotNull (*winInfoPtr)) + if ((*winInfoPtr) != NULL) { - (*winInfoPtr)->detail.sourceInfo.hasLocator = TRUE; + (*winInfoPtr)->detail.source_info.has_locator = TRUE; tui_make_visible (locator); tui_show_locator_content (); tui_show_source_content (*winInfoPtr); - if (m_winPtrIsNull (cmdWin)) + if (TUI_CMD_WIN == NULL) { - _makeCommandWindow (&cmdWin, cmdHeight, srcHeight); - tui_refresh_win (&cmdWin->generic); + _makeCommandWindow (&TUI_CMD_WIN, cmdHeight, srcHeight); + tui_refresh_win (&TUI_CMD_WIN->generic); } else { - _initGenWinInfo (&cmdWin->generic, - cmdWin->generic.type, - cmdWin->generic.height, - cmdWin->generic.width, - cmdWin->generic.origin.x, - cmdWin->generic.origin.y); - cmdWin->canHighlight = FALSE; - tui_make_visible (&cmdWin->generic); + _initGenWinInfo (&TUI_CMD_WIN->generic, + TUI_CMD_WIN->generic.type, + TUI_CMD_WIN->generic.height, + TUI_CMD_WIN->generic.width, + TUI_CMD_WIN->generic.origin.x, + TUI_CMD_WIN->generic.origin.y); + TUI_CMD_WIN->can_highlight = FALSE; + tui_make_visible (&TUI_CMD_WIN->generic); } } tui_set_current_layout_to (layoutType); diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index e5222c2..ad70a88 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -32,6 +32,7 @@ #include "regcache.h" #include "inferior.h" #include "target.h" +#include "gdb_string.h" #include "tui/tui-layout.h" #include "tui/tui-win.h" #include "tui/tui-windata.h" @@ -112,12 +113,12 @@ tui_last_regs_line_no (void) { register int numLines = (-1); - if (dataWin->detail.dataDisplayInfo.regsContentCount > 0) + if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0) { - numLines = (dataWin->detail.dataDisplayInfo.regsContentCount / - dataWin->detail.dataDisplayInfo.regsColumnCount); - if (dataWin->detail.dataDisplayInfo.regsContentCount % - dataWin->detail.dataDisplayInfo.regsColumnCount) + numLines = (TUI_DATA_WIN->detail.data_display_info.regs_content_count / + TUI_DATA_WIN->detail.data_display_info.regs_column_count); + if (TUI_DATA_WIN->detail.data_display_info.regs_content_count % + TUI_DATA_WIN->detail.data_display_info.regs_column_count) numLines++; } return numLines; @@ -130,7 +131,7 @@ tui_last_regs_line_no (void) int tui_line_from_reg_element_no (int elementNo) { - if (elementNo < dataWin->detail.dataDisplayInfo.regsContentCount) + if (elementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count) { int i, line = (-1); @@ -138,7 +139,7 @@ tui_line_from_reg_element_no (int elementNo) while (line == (-1)) { if (elementNo < - (dataWin->detail.dataDisplayInfo.regsColumnCount * i)) + (TUI_DATA_WIN->detail.data_display_info.regs_column_count * i)) line = i - 1; else i++; @@ -156,11 +157,11 @@ tui_line_from_reg_element_no (int elementNo) int tui_first_reg_element_no_inline (int lineNo) { - if ((lineNo * dataWin->detail.dataDisplayInfo.regsColumnCount) - <= dataWin->detail.dataDisplayInfo.regsContentCount) + if ((lineNo * TUI_DATA_WIN->detail.data_display_info.regs_column_count) + <= TUI_DATA_WIN->detail.data_display_info.regs_content_count) return ((lineNo + 1) * - dataWin->detail.dataDisplayInfo.regsColumnCount) - - dataWin->detail.dataDisplayInfo.regsColumnCount; + TUI_DATA_WIN->detail.data_display_info.regs_column_count) - + TUI_DATA_WIN->detail.data_display_info.regs_column_count; else return (-1); } @@ -174,10 +175,10 @@ tui_first_reg_element_no_inline (int lineNo) int tuiLastRegElementNoInLine (int lineNo) { - if ((lineNo * dataWin->detail.dataDisplayInfo.regsColumnCount) <= - dataWin->detail.dataDisplayInfo.regsContentCount) + if ((lineNo * TUI_DATA_WIN->detail.data_display_info.regs_column_count) <= + TUI_DATA_WIN->detail.data_display_info.regs_content_count) return ((lineNo + 1) * - dataWin->detail.dataDisplayInfo.regsColumnCount) - 1; + TUI_DATA_WIN->detail.data_display_info.regs_column_count) - 1; else return (-1); } /* tuiLastRegElementNoInLine */ @@ -199,10 +200,10 @@ tui_calculate_regs_column_count (enum tui_register_display_type dpyType) else colWidth = SINGLE_VALUE_WIDTH + SINGLE_LABEL_WIDTH; } - colCount = (dataWin->generic.width - 2) / colWidth; + colCount = (TUI_DATA_WIN->generic.width - 2) / colWidth; return colCount; -} /* tuiCalulateRegsColumnCount */ +} /* tuiCalulateRegs_column_count */ /* Show the registers int the data window as indicated by dpyType. If @@ -215,12 +216,12 @@ tui_show_registers (enum tui_register_display_type dpyType) int refreshValuesOnly = FALSE; /* Say that registers should be displayed, even if there is a problem */ - dataWin->detail.dataDisplayInfo.displayRegs = TRUE; + TUI_DATA_WIN->detail.data_display_info.display_regs = TRUE; if (target_has_registers) { refreshValuesOnly = - (dpyType == dataWin->detail.dataDisplayInfo.regsDisplayType); + (dpyType == TUI_DATA_WIN->detail.data_display_info.regs_display_type); switch (dpyType) { case TUI_GENERAL_REGS: @@ -248,7 +249,7 @@ tui_show_registers (enum tui_register_display_type dpyType) } if (ret == TUI_FAILURE) { - dataWin->detail.dataDisplayInfo.regsDisplayType = TUI_UNDEFINED_REGS; + TUI_DATA_WIN->detail.data_display_info.regs_display_type = TUI_UNDEFINED_REGS; tui_erase_data_content (NO_REGS_STRING); } else @@ -256,19 +257,19 @@ tui_show_registers (enum tui_register_display_type dpyType) int i; /* Clear all notation of changed values */ - for (i = 0; (i < dataWin->detail.dataDisplayInfo.regsContentCount); i++) + for (i = 0; (i < TUI_DATA_WIN->detail.data_display_info.regs_content_count); i++) { struct tui_gen_win_info * dataItemWin; - dataItemWin = &dataWin->detail.dataDisplayInfo. - regsContent[i]->whichElement.dataWindow; + dataItemWin = &TUI_DATA_WIN->detail.data_display_info. + regs_content[i]->which_element.data_window; (&((struct tui_win_element *) - dataItemWin->content[0])->whichElement.data)->highlight = FALSE; + dataItemWin->content[0])->which_element.data)->highlight = FALSE; } - dataWin->detail.dataDisplayInfo.regsDisplayType = dpyType; + TUI_DATA_WIN->detail.data_display_info.regs_display_type = dpyType; tui_display_all_data (); } - (tui_layout_def ())->regsDisplayType = dpyType; + (tui_layout_def ())->regs_display_type = dpyType; return; } @@ -281,25 +282,25 @@ tui_show_registers (enum tui_register_display_type dpyType) void tui_display_registers_from (int startElementNo) { - if (dataWin->detail.dataDisplayInfo.regsContent != (tui_win_content) NULL && - dataWin->detail.dataDisplayInfo.regsContentCount > 0) + if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL && + TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0) { register int i = startElementNo; int j, valueCharsWide, itemWinWidth, curY, labelWidth; enum precision_type precision; - precision = (dataWin->detail.dataDisplayInfo.regsDisplayType + precision = (TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS) ? double_precision : unspecified_precision; if (IS_64BIT || - dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_DFLOAT_REGS) + TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS) { valueCharsWide = DOUBLE_FLOAT_VALUE_WIDTH; labelWidth = DOUBLE_FLOAT_LABEL_WIDTH; } else { - if (dataWin->detail.dataDisplayInfo.regsDisplayType == + if (TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_SFLOAT_REGS) { valueCharsWide = SINGLE_FLOAT_VALUE_WIDTH; @@ -316,21 +317,21 @@ tui_display_registers_from (int startElementNo) ** Now create each data "sub" window, and write the display into it. */ curY = 1; - while (i < dataWin->detail.dataDisplayInfo.regsContentCount && - curY <= dataWin->generic.viewportHeight) + while (i < TUI_DATA_WIN->detail.data_display_info.regs_content_count && + curY <= TUI_DATA_WIN->generic.viewport_height) { for (j = 0; - (j < dataWin->detail.dataDisplayInfo.regsColumnCount && - i < dataWin->detail.dataDisplayInfo.regsContentCount); j++) + (j < TUI_DATA_WIN->detail.data_display_info.regs_column_count && + i < TUI_DATA_WIN->detail.data_display_info.regs_content_count); j++) { struct tui_gen_win_info * dataItemWin; struct tui_data_element * dataElementPtr; /* create the window if necessary */ - dataItemWin = &dataWin->detail.dataDisplayInfo. - regsContent[i]->whichElement.dataWindow; + dataItemWin = &TUI_DATA_WIN->detail.data_display_info. + regs_content[i]->which_element.data_window; dataElementPtr = &((struct tui_win_element *) - dataItemWin->content[0])->whichElement.data; + dataItemWin->content[0])->which_element.data; if (dataItemWin->handle == (WINDOW *) NULL) { dataItemWin->height = 1; @@ -348,7 +349,7 @@ tui_display_registers_from (int startElementNo) ** and display it */ _tuiDisplayRegister ( - dataElementPtr->itemNo, dataItemWin, precision); + dataElementPtr->item_no, dataItemWin, precision); i++; /* next register */ } curY++; /* next row; */ @@ -370,8 +371,8 @@ tui_display_registers_from (int startElementNo) void tuiDisplayRegElementAtLine (int startElementNo, int startLineNo) { - if (dataWin->detail.dataDisplayInfo.regsContent != (tui_win_content) NULL && - dataWin->detail.dataDisplayInfo.regsContentCount > 0) + if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL && + TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0) { register int elementNo = startElementNo; @@ -380,7 +381,7 @@ tuiDisplayRegElementAtLine (int startElementNo, int startLineNo) register int lastLineNo, firstLineOnLastPage; lastLineNo = tui_last_regs_line_no (); - firstLineOnLastPage = lastLineNo - (dataWin->generic.height - 2); + firstLineOnLastPage = lastLineNo - (TUI_DATA_WIN->generic.height - 2); if (firstLineOnLastPage < 0) firstLineOnLastPage = 0; /* @@ -388,7 +389,7 @@ tuiDisplayRegElementAtLine (int startElementNo, int startLineNo) ** and the elementNo causes us to scroll past the end of the ** registers, adjust what element to really start the display at. */ - if (dataWin->detail.dataDisplayInfo.dataContentCount <= 0 && + if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0 && startLineNo > firstLineOnLastPage) elementNo = tui_first_reg_element_no_inline (firstLineOnLastPage); } @@ -406,7 +407,7 @@ tuiDisplayRegElementAtLine (int startElementNo, int startLineNo) int tui_display_registers_from_line (int lineNo, int forceDisplay) { - if (dataWin->detail.dataDisplayInfo.regsContentCount > 0) + if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0) { int line, elementNo; @@ -420,7 +421,7 @@ tui_display_registers_from_line (int lineNo, int forceDisplay) if (lineNo >= tui_last_regs_line_no ()) { if ((line = tui_line_from_reg_element_no ( - dataWin->detail.dataDisplayInfo.regsContentCount - 1)) < 0) + TUI_DATA_WIN->detail.data_display_info.regs_content_count - 1)) < 0) line = 0; } else @@ -430,7 +431,7 @@ tui_display_registers_from_line (int lineNo, int forceDisplay) line = lineNo; elementNo = tui_first_reg_element_no_inline (line); - if (elementNo < dataWin->detail.dataDisplayInfo.regsContentCount) + if (elementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count) tuiDisplayRegElementAtLine (elementNo, line); else line = (-1); @@ -448,27 +449,27 @@ tui_display_registers_from_line (int lineNo, int forceDisplay) void tui_check_register_values (struct frame_info *frame) { - if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible) + if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible) { - if (dataWin->detail.dataDisplayInfo.regsContentCount <= 0 && - dataWin->detail.dataDisplayInfo.displayRegs) - tui_show_registers ((tui_layout_def ())->regsDisplayType); + if (TUI_DATA_WIN->detail.data_display_info.regs_content_count <= 0 && + TUI_DATA_WIN->detail.data_display_info.display_regs) + tui_show_registers ((tui_layout_def ())->regs_display_type); else { int i, j; char rawBuf[MAX_REGISTER_SIZE]; for (i = 0; - (i < dataWin->detail.dataDisplayInfo.regsContentCount); i++) + (i < TUI_DATA_WIN->detail.data_display_info.regs_content_count); i++) { struct tui_data_element * dataElementPtr; struct tui_gen_win_info * dataItemWinPtr; int wasHilighted; - dataItemWinPtr = &dataWin->detail.dataDisplayInfo. - regsContent[i]->whichElement.dataWindow; + dataItemWinPtr = &TUI_DATA_WIN->detail.data_display_info. + regs_content[i]->which_element.data_window; dataElementPtr = &((struct tui_win_element *) - dataItemWinPtr->content[0])->whichElement.data; + dataItemWinPtr->content[0])->which_element.data; wasHilighted = dataElementPtr->highlight; dataElementPtr->highlight = _tuiRegValueHasChanged (dataElementPtr, frame, &rawBuf[0]); @@ -476,13 +477,13 @@ tui_check_register_values (struct frame_info *frame) { int size; - size = DEPRECATED_REGISTER_RAW_SIZE (dataElementPtr->itemNo); + size = DEPRECATED_REGISTER_RAW_SIZE (dataElementPtr->item_no); for (j = 0; j < size; j++) ((char *) dataElementPtr->value)[j] = rawBuf[j]; _tuiDisplayRegister ( - dataElementPtr->itemNo, + dataElementPtr->item_no, dataItemWinPtr, - ((dataWin->detail.dataDisplayInfo.regsDisplayType == + ((TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS) ? double_precision : unspecified_precision)); } @@ -490,9 +491,9 @@ tui_check_register_values (struct frame_info *frame) { dataElementPtr->highlight = FALSE; _tuiDisplayRegister ( - dataElementPtr->itemNo, + dataElementPtr->item_no, dataItemWinPtr, - ((dataWin->detail.dataDisplayInfo.regsDisplayType == + ((TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS) ? double_precision : unspecified_precision)); } @@ -511,15 +512,15 @@ tuiToggleFloatRegs (void) { struct tui_layout_def * layoutDef = tui_layout_def (); - if (layoutDef->floatRegsDisplayType == TUI_SFLOAT_REGS) - layoutDef->floatRegsDisplayType = TUI_DFLOAT_REGS; + if (layoutDef->float_regs_display_type == TUI_SFLOAT_REGS) + layoutDef->float_regs_display_type = TUI_DFLOAT_REGS; else - layoutDef->floatRegsDisplayType = TUI_SFLOAT_REGS; + layoutDef->float_regs_display_type = TUI_SFLOAT_REGS; - if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible && - (dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_SFLOAT_REGS || - dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_DFLOAT_REGS)) - tui_show_registers (layoutDef->floatRegsDisplayType); + if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible && + (TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_SFLOAT_REGS || + TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS)) + tui_show_registers (layoutDef->float_regs_display_type); return; } /* tuiToggleFloatRegs */ @@ -730,16 +731,16 @@ _tuiRegValueHasChanged (struct tui_data_element * dataElement, { int hasChanged = FALSE; - if (dataElement->itemNo != UNDEFINED_ITEM && - _tuiRegisterName (dataElement->itemNo) != (char *) NULL) + if (dataElement->item_no != UNDEFINED_ITEM && + _tuiRegisterName (dataElement->item_no) != (char *) NULL) { char rawBuf[MAX_REGISTER_SIZE]; int i; if (_tuiGetRegisterRawValue ( - dataElement->itemNo, rawBuf, frame) == TUI_SUCCESS) + dataElement->item_no, rawBuf, frame) == TUI_SUCCESS) { - int size = DEPRECATED_REGISTER_RAW_SIZE (dataElement->itemNo); + int size = DEPRECATED_REGISTER_RAW_SIZE (dataElement->item_no); for (i = 0; (i < size && !hasChanged); i++) hasChanged = (((char *) dataElement->value)[i] != rawBuf[i]); @@ -792,7 +793,7 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame, { if (!refreshValueOnly) { - dataElement->itemNo = regNum; + dataElement->item_no = regNum; dataElement->name = _tuiRegisterName (regNum); dataElement->highlight = FALSE; } @@ -822,32 +823,32 @@ _tuiSetRegsContent (int startRegNum, int endRegNum, int numRegs = endRegNum - startRegNum + 1; int allocatedHere = FALSE; - if (dataWin->detail.dataDisplayInfo.regsContentCount > 0 && + if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0 && !refreshValuesOnly) { - tui_free_data_content (dataWin->detail.dataDisplayInfo.regsContent, - dataWin->detail.dataDisplayInfo.regsContentCount); - dataWin->detail.dataDisplayInfo.regsContentCount = 0; + tui_free_data_content (TUI_DATA_WIN->detail.data_display_info.regs_content, + TUI_DATA_WIN->detail.data_display_info.regs_content_count); + TUI_DATA_WIN->detail.data_display_info.regs_content_count = 0; } - if (dataWin->detail.dataDisplayInfo.regsContentCount <= 0) + if (TUI_DATA_WIN->detail.data_display_info.regs_content_count <= 0) { - dataWin->detail.dataDisplayInfo.regsContent = + TUI_DATA_WIN->detail.data_display_info.regs_content = tui_alloc_content (numRegs, DATA_WIN); allocatedHere = TRUE; } - if (dataWin->detail.dataDisplayInfo.regsContent != (tui_win_content) NULL) + if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL) { int i; if (!refreshValuesOnly || allocatedHere) { - dataWin->generic.content = NULL; - dataWin->generic.contentSize = 0; - tui_add_content_elements (&dataWin->generic, numRegs); - dataWin->detail.dataDisplayInfo.regsContent = - (tui_win_content) dataWin->generic.content; - dataWin->detail.dataDisplayInfo.regsContentCount = numRegs; + TUI_DATA_WIN->generic.content = NULL; + TUI_DATA_WIN->generic.content_size = 0; + tui_add_content_elements (&TUI_DATA_WIN->generic, numRegs); + TUI_DATA_WIN->detail.data_display_info.regs_content = + (tui_win_content) TUI_DATA_WIN->generic.content; + TUI_DATA_WIN->detail.data_display_info.regs_content_count = numRegs; } /* ** Now set the register names and values @@ -856,27 +857,27 @@ _tuiSetRegsContent (int startRegNum, int endRegNum, { struct tui_gen_win_info * dataItemWin; - dataItemWin = &dataWin->detail.dataDisplayInfo. - regsContent[i - startRegNum]->whichElement.dataWindow; + dataItemWin = &TUI_DATA_WIN->detail.data_display_info. + regs_content[i - startRegNum]->which_element.data_window; _tuiSetRegisterElement ( i, frame, - &((struct tui_win_element *) dataItemWin->content[0])->whichElement.data, + &((struct tui_win_element *) dataItemWin->content[0])->which_element.data, !allocatedHere && refreshValuesOnly); } - dataWin->detail.dataDisplayInfo.regsColumnCount = + TUI_DATA_WIN->detail.data_display_info.regs_column_count = tui_calculate_regs_column_count (dpyType); #ifdef LATER - if (dataWin->detail.dataDisplayInfo.dataContentCount > 0) + if (TUI_DATA_WIN->detail.data_display_info.data_content_count > 0) { /* delete all the windows? */ - /* realloc content equal to dataContentCount + regsContentCount */ - /* append dataWin->detail.dataDisplayInfo.dataContent to content */ + /* realloc content equal to data_content_count + regs_content_count */ + /* append TUI_DATA_WIN->detail.data_display_info.dataContent to content */ } #endif - dataWin->generic.contentSize = - dataWin->detail.dataDisplayInfo.regsContentCount + - dataWin->detail.dataDisplayInfo.dataContentCount; + TUI_DATA_WIN->generic.content_size = + TUI_DATA_WIN->detail.data_display_info.regs_content_count + + TUI_DATA_WIN->detail.data_display_info.data_content_count; ret = TUI_SUCCESS; } @@ -900,17 +901,17 @@ _tuiDisplayRegister (int regNum, char buf[40]; int valueCharsWide, labelWidth; struct tui_data_element * dataElementPtr = &((tui_win_content) - winInfo->content)[0]->whichElement.data; + winInfo->content)[0]->which_element.data; if (IS_64BIT || - dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_DFLOAT_REGS) + TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS) { valueCharsWide = DOUBLE_FLOAT_VALUE_WIDTH; labelWidth = DOUBLE_FLOAT_LABEL_WIDTH; } else { - if (dataWin->detail.dataDisplayInfo.regsDisplayType == + if (TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_SFLOAT_REGS) { valueCharsWide = SINGLE_FLOAT_VALUE_WIDTH; @@ -951,13 +952,13 @@ static void _tui_vShowRegisters_commandSupport (enum tui_register_display_type dpyType) { - if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible) + if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible) { /* Data window already displayed, show the registers */ - if (dataWin->detail.dataDisplayInfo.regsDisplayType != dpyType) + if (TUI_DATA_WIN->detail.data_display_info.regs_display_type != dpyType) tui_show_registers (dpyType); } else - (tui_layout_def ())->regsDisplayType = dpyType; + (tui_layout_def ())->regs_display_type = dpyType; return; } /* _tui_vShowRegisters_commandSupport */ @@ -966,10 +967,10 @@ _tui_vShowRegisters_commandSupport (enum tui_register_display_type dpyType) static void _tuiShowFloat_command (char *arg, int fromTTY) { - if (m_winPtrIsNull (dataWin) || !dataWin->generic.isVisible || - (dataWin->detail.dataDisplayInfo.regsDisplayType != TUI_SFLOAT_REGS && - dataWin->detail.dataDisplayInfo.regsDisplayType != TUI_DFLOAT_REGS)) - _tui_vShowRegisters_commandSupport ((tui_layout_def ())->floatRegsDisplayType); + if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible || + (TUI_DATA_WIN->detail.data_display_info.regs_display_type != TUI_SFLOAT_REGS && + TUI_DATA_WIN->detail.data_display_info.regs_display_type != TUI_DFLOAT_REGS)) + _tui_vShowRegisters_commandSupport ((tui_layout_def ())->float_regs_display_type); return; } /* _tuiShowFloat_command */ @@ -992,16 +993,16 @@ _tuiShowSpecial_command (char *arg, int fromTTY) static void _tuiToggleFloatRegs_command (char *arg, int fromTTY) { - if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible) + if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible) tuiToggleFloatRegs (); else { struct tui_layout_def * layoutDef = tui_layout_def (); - if (layoutDef->floatRegsDisplayType == TUI_SFLOAT_REGS) - layoutDef->floatRegsDisplayType = TUI_DFLOAT_REGS; + if (layoutDef->float_regs_display_type == TUI_SFLOAT_REGS) + layoutDef->float_regs_display_type = TUI_DFLOAT_REGS; else - layoutDef->floatRegsDisplayType = TUI_SFLOAT_REGS; + layoutDef->float_regs_display_type = TUI_SFLOAT_REGS; } @@ -1012,12 +1013,12 @@ _tuiToggleFloatRegs_command (char *arg, int fromTTY) static void _tuiScrollRegsForward_command (char *arg, int fromTTY) { - tui_scroll (FORWARD_SCROLL, dataWin, 1); + tui_scroll (FORWARD_SCROLL, TUI_DATA_WIN, 1); } static void _tuiScrollRegsBackward_command (char *arg, int fromTTY) { - tui_scroll (BACKWARD_SCROLL, dataWin, 1); + tui_scroll (BACKWARD_SCROLL, TUI_DATA_WIN, 1); } diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index 19703a2..c4de123 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -25,7 +25,7 @@ #ifndef TUI_REGS_H #define TUI_REGS_H -#include "tui/tui-data.h" /* For TuiRegisterDisplayType. */ +#include "tui/tui-data.h" /* For struct tui_register_display_type. */ extern void tui_check_register_values (struct frame_info *); extern void tui_show_registers (enum tui_register_display_type); diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 530ee43..7045f71 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -46,7 +46,7 @@ /* Function to display source in the source window. */ enum tui_status -tui_set_source_content (struct symtab *s, int lineNo, int noerror) +tui_set_source_content (struct symtab *s, int line_no, int noerror) { enum tui_status ret = TUI_FAILURE; @@ -56,19 +56,19 @@ tui_set_source_content (struct symtab *s, int lineNo, int noerror) register int i, desc, c, lineWidth, nlines; register char *srcLine = 0; - if ((ret = tui_alloc_source_buffer (srcWin)) == TUI_SUCCESS) + if ((ret = tui_alloc_source_buffer (TUI_SRC_WIN)) == TUI_SUCCESS) { - lineWidth = srcWin->generic.width - 1; + lineWidth = TUI_SRC_WIN->generic.width - 1; /* Take hilite (window border) into account, when calculating the number of lines */ - nlines = (lineNo + (srcWin->generic.height - 2)) - lineNo; + nlines = (line_no + (TUI_SRC_WIN->generic.height - 2)) - line_no; desc = open_source_file (s); if (desc < 0) { if (!noerror) { char *name = alloca (strlen (s->filename) + 100); - sprintf (name, "%s:%d", s->filename, lineNo); + sprintf (name, "%s:%d", s->filename, line_no); print_sys_errmsg (name, errno); } ret = TUI_FAILURE; @@ -78,14 +78,14 @@ tui_set_source_content (struct symtab *s, int lineNo, int noerror) if (s->line_charpos == 0) find_source_lines (s, desc); - if (lineNo < 1 || lineNo > s->nlines) + if (line_no < 1 || line_no > s->nlines) { close (desc); printf_unfiltered ( "Line number %d out of range; %s has %d lines.\n", - lineNo, s->filename, s->nlines); + line_no, s->filename, s->nlines); } - else if (lseek (desc, s->line_charpos[lineNo - 1], 0) < 0) + else if (lseek (desc, s->line_charpos[line_no - 1], 0) < 0) { close (desc); perror_with_name (s->filename); @@ -94,11 +94,11 @@ tui_set_source_content (struct symtab *s, int lineNo, int noerror) { register int offset, curLineNo, curLine, curLen, threshold; struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); - struct tui_source_info * src = &srcWin->detail.sourceInfo; + struct tui_source_info * src = &TUI_SRC_WIN->detail.source_info; - if (srcWin->generic.title) - xfree (srcWin->generic.title); - srcWin->generic.title = xstrdup (s->filename); + if (TUI_SRC_WIN->generic.title) + xfree (TUI_SRC_WIN->generic.title); + TUI_SRC_WIN->generic.title = xstrdup (s->filename); if (src->filename) xfree (src->filename); @@ -106,27 +106,27 @@ tui_set_source_content (struct symtab *s, int lineNo, int noerror) /* Determine the threshold for the length of the line and the offset to start the display. */ - offset = src->horizontalOffset; + offset = src->horizontal_offset; threshold = (lineWidth - 1) + offset; stream = fdopen (desc, FOPEN_RT); clearerr (stream); curLine = 0; - curLineNo = src->startLineOrAddr.lineNo = lineNo; + curLineNo = src->start_line_or_addr.line_no = line_no; if (offset > 0) srcLine = (char *) xmalloc ( (threshold + 1) * sizeof (char)); while (curLine < nlines) { struct tui_win_element * element = (struct tui_win_element *) - srcWin->generic.content[curLine]; + TUI_SRC_WIN->generic.content[curLine]; /* get the first character in the line */ c = fgetc (stream); if (offset == 0) srcLine = ((struct tui_win_element *) - srcWin->generic.content[ - curLine])->whichElement.source.line; + TUI_SRC_WIN->generic.content[ + curLine])->which_element.source.line; /* Init the line with the line number */ sprintf (srcLine, "%-6d", curLineNo); curLen = strlen (srcLine); @@ -142,14 +142,14 @@ tui_set_source_content (struct symtab *s, int lineNo, int noerror) /* Set whether element is the execution point and whether there is a break point on it. */ - element->whichElement.source.lineOrAddr.lineNo = + element->which_element.source.line_or_addr.line_no = curLineNo; - element->whichElement.source.isExecPoint = + element->which_element.source.is_exec_point = (strcmp (((struct tui_win_element *) - locator->content[0])->whichElement.locator.fileName, + locator->content[0])->which_element.locator.file_name, s->filename) == 0 && curLineNo == ((struct tui_win_element *) - locator->content[0])->whichElement.locator.lineNo); + locator->content[0])->which_element.locator.line_no); if (c != EOF) { i = strlen (srcLine) - 1; @@ -203,20 +203,20 @@ tui_set_source_content (struct symtab *s, int lineNo, int noerror) } /* Now copy the line taking the offset into account */ if (strlen (srcLine) > offset) - strcpy (((struct tui_win_element *) srcWin->generic.content[ - curLine])->whichElement.source.line, + strcpy (((struct tui_win_element *) TUI_SRC_WIN->generic.content[ + curLine])->which_element.source.line, &srcLine[offset]); else ((struct tui_win_element *) - srcWin->generic.content[ - curLine])->whichElement.source.line[0] = (char) 0; + TUI_SRC_WIN->generic.content[ + curLine])->which_element.source.line[0] = (char) 0; curLine++; curLineNo++; } if (offset > 0) xfree (srcLine); fclose (stream); - srcWin->generic.contentSize = nlines; + TUI_SRC_WIN->generic.content_size = nlines; ret = TUI_SUCCESS; } } @@ -244,7 +244,7 @@ tui_set_source_content_nil (struct tui_win_info * winInfo, char *warning_string) /* set to empty each line in the window, except for the one which contains the message */ - while (curr_line < winInfo->generic.contentSize) + while (curr_line < winInfo->generic.content_size) { /* set the information related to each displayed line to null: i.e. the line number is 0, there is no bp, @@ -252,12 +252,12 @@ tui_set_source_content_nil (struct tui_win_info * winInfo, char *warning_string) struct tui_win_element * element = (struct tui_win_element *) winInfo->generic.content[curr_line]; - element->whichElement.source.lineOrAddr.lineNo = 0; - element->whichElement.source.isExecPoint = FALSE; - element->whichElement.source.hasBreak = FALSE; + 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; /* set the contents of the line to blank */ - element->whichElement.source.line[0] = (char) 0; + 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. @@ -272,7 +272,7 @@ tui_set_source_content_nil (struct tui_win_info * winInfo, char *warning_string) int warning_length = strlen (warning_string); char *srcLine; - srcLine = element->whichElement.source.line; + srcLine = element->which_element.source.line; if (warning_length >= ((lineWidth - 1) / 2)) xpos = 1; @@ -302,8 +302,8 @@ tui_set_source_content_nil (struct tui_win_info * winInfo, char *warning_string) void tui_show_symtab_source (struct symtab *s, union tui_line_or_address line, int noerror) { - srcWin->detail.sourceInfo.horizontalOffset = 0; - tui_update_source_window_as_is (srcWin, s, line, noerror); + TUI_SRC_WIN->detail.source_info.horizontal_offset = 0; + tui_update_source_window_as_is (TUI_SRC_WIN, s, line, noerror); } @@ -312,9 +312,9 @@ tui_show_symtab_source (struct symtab *s, union tui_line_or_address line, int no int tui_source_is_displayed (char *fname) { - return (srcWin->generic.contentInUse && + return (TUI_SRC_WIN->generic.content_in_use && (strcmp (((struct tui_win_element *) (tui_locator_win_info_ptr ())-> - content[0])->whichElement.locator.fileName, fname) == 0)); + content[0])->which_element.locator.file_name, fname) == 0)); } @@ -323,11 +323,11 @@ void tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection, int numToScroll) { - if (srcWin->generic.content != NULL) + if (TUI_SRC_WIN->generic.content != NULL) { union tui_line_or_address l; struct symtab *s; - tui_win_content content = (tui_win_content) srcWin->generic.content; + tui_win_content content = (tui_win_content) TUI_SRC_WIN->generic.content; struct symtab_and_line cursal = get_current_source_symtab_and_line (); if (cursal.symtab == (struct symtab *) NULL) @@ -337,21 +337,21 @@ tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection, if (scrollDirection == FORWARD_SCROLL) { - l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo + + l.line_no = content[0]->which_element.source.line_or_addr.line_no + numToScroll; - if (l.lineNo > s->nlines) - /*line = s->nlines - winInfo->generic.contentSize + 1; */ + if (l.line_no > s->nlines) + /*line = s->nlines - winInfo->generic.content_size + 1; */ /*elz: fix for dts 23398 */ - l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo; + l.line_no = content[0]->which_element.source.line_or_addr.line_no; } else { - l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo - + l.line_no = content[0]->which_element.source.line_or_addr.line_no - numToScroll; - if (l.lineNo <= 0) - l.lineNo = 1; + if (l.line_no <= 0) + l.line_no = 1; } - print_source_lines (s, l.lineNo, l.lineNo + 1, 0); + print_source_lines (s, l.line_no, l.line_no + 1, 0); } } diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index e8cf927..7183bc2 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -30,7 +30,7 @@ #include "inferior.h" #include "target.h" #include "top.h" - +#include "gdb_string.h" #include "tui/tui.h" #include "tui/tui-data.h" #include "tui/tui-stack.h" @@ -99,8 +99,8 @@ tui_make_status_line (struct tui_locator_element* loc) buf = (char*) alloca (status_size + 1); /* Translate line number and obtain its size. */ - if (loc->lineNo > 0) - sprintf (line_buf, "%d", loc->lineNo); + if (loc->line_no > 0) + sprintf (line_buf, "%d", loc->line_no); else strcpy (line_buf, "??"); line_width = strlen (line_buf); @@ -122,7 +122,7 @@ tui_make_status_line (struct tui_locator_element* loc) - (sizeof (PROC_PREFIX) - 1 + 1) - (sizeof (LINE_PREFIX) - 1 + line_width + 1) - (sizeof (PC_PREFIX) - 1 + pc_width + 1) - - (tui_current_key_mode == tui_single_key_mode + - (tui_current_key_mode == TUI_SINGLE_KEY_MODE ? (sizeof (SINGLE_KEY) - 1 + 1) : 0)); @@ -152,7 +152,7 @@ tui_make_status_line (struct tui_locator_element* loc) } /* Now convert elements to string form */ - pname = loc->procName; + pname = loc->proc_name; /* Now create the locator line from the string version of the elements. We could use sprintf() here but @@ -174,7 +174,7 @@ tui_make_status_line (struct tui_locator_element* loc) } /* Show whether we are in SingleKey mode. */ - if (tui_current_key_mode == tui_single_key_mode) + if (tui_current_key_mode == TUI_SINGLE_KEY_MODE) { strcat_to_buf (string, status_size, SINGLE_KEY); strcat_to_buf (string, status_size, " "); @@ -253,13 +253,13 @@ tui_show_locator_content (void) locator = tui_locator_win_info_ptr (); - if (m_genWinPtrNotNull (locator) && locator->handle != (WINDOW *) NULL) + if (locator != NULL && locator->handle != (WINDOW *) NULL) { struct tui_win_element * element; element = (struct tui_win_element *) locator->content[0]; - string = tui_make_status_line (&element->whichElement.locator); + string = tui_make_status_line (&element->which_element.locator); wmove (locator->handle, 0, 0); wstandout (locator->handle); waddstr (locator->handle, string); @@ -268,7 +268,7 @@ tui_show_locator_content (void) tui_refresh_win (locator); wmove (locator->handle, 0, 0); xfree (string); - locator->contentInUse = TRUE; + locator->content_in_use = TRUE; } } @@ -286,9 +286,9 @@ tui_set_locator_filename (const char *filename) return; } - element = &((struct tui_win_element *) locator->content[0])->whichElement.locator; - element->fileName[0] = 0; - strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, filename); + element = &((struct tui_win_element *) locator->content[0])->which_element.locator; + element->file_name[0] = 0; + strcat_to_buf (element->file_name, MAX_LOCATOR_ELEMENT_LEN, filename); } /* Update the locator, with the provided arguments. */ @@ -300,16 +300,16 @@ tui_set_locator_info (const char *filename, const char *procname, int lineno, struct tui_locator_element * element; /* Allocate the locator content if necessary. */ - if (locator->contentSize <= 0) + if (locator->content_size <= 0) { locator->content = (void **) tui_alloc_content (1, locator->type); - locator->contentSize = 1; + locator->content_size = 1; } - element = &((struct tui_win_element *) locator->content[0])->whichElement.locator; - element->procName[0] = (char) 0; - strcat_to_buf (element->procName, MAX_LOCATOR_ELEMENT_LEN, procname); - element->lineNo = lineno; + element = &((struct tui_win_element *) locator->content[0])->which_element.locator; + element->proc_name[0] = (char) 0; + strcat_to_buf (element->proc_name, MAX_LOCATOR_ELEMENT_LEN, procname); + element->line_no = lineno; element->addr = addr; tui_set_locator_filename (filename); } @@ -326,12 +326,12 @@ tui_update_locator_filename (const char *filename) void tui_show_frame_info (struct frame_info *fi) { - struct tui_win_info * winInfo; + struct tui_win_info * win_info; register int i; if (fi) { - register int startLine, i; + register int start_line, i; CORE_ADDR low; struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); int sourceAlreadyDisplayed; @@ -346,19 +346,19 @@ tui_show_frame_info (struct frame_info *fi) sal.line, get_frame_pc (fi)); tui_show_locator_content (); - startLine = 0; + start_line = 0; for (i = 0; i < (tui_source_windows ())->count; i++) { union tui_which_element *item; - winInfo = (struct tui_win_info *) (tui_source_windows ())->list[i]; + win_info = (struct tui_win_info *) (tui_source_windows ())->list[i]; - item = &((struct tui_win_element *) locator->content[0])->whichElement; - if (winInfo == srcWin) + item = &((struct tui_win_element *) locator->content[0])->which_element; + if (win_info == TUI_SRC_WIN) { - startLine = (item->locator.lineNo - - (winInfo->generic.viewportHeight / 2)) + 1; - if (startLine <= 0) - startLine = 1; + start_line = (item->locator.line_no - + (win_info->generic.viewport_height / 2)) + 1; + if (start_line <= 0) + start_line = 1; } else { @@ -369,35 +369,35 @@ tui_show_frame_info (struct frame_info *fi) low = tui_get_low_disassembly_address (low, get_frame_pc (fi)); } - if (winInfo == srcWin) + if (win_info == TUI_SRC_WIN) { union tui_line_or_address l; - l.lineNo = startLine; + l.line_no = start_line; if (!(sourceAlreadyDisplayed - && tui_line_is_displayed (item->locator.lineNo, winInfo, TRUE))) - tui_update_source_window (winInfo, sal.symtab, l, TRUE); + && tui_line_is_displayed (item->locator.line_no, win_info, TRUE))) + tui_update_source_window (win_info, sal.symtab, l, TRUE); else { - l.lineNo = item->locator.lineNo; - tui_set_is_exec_point_at (l, winInfo); + l.line_no = item->locator.line_no; + tui_set_is_exec_point_at (l, win_info); } } else { - if (winInfo == disassemWin) + if (win_info == TUI_DISASM_WIN) { union tui_line_or_address a; a.addr = low; - if (!tui_addr_is_displayed (item->locator.addr, winInfo, TRUE)) - tui_update_source_window (winInfo, sal.symtab, a, TRUE); + if (!tui_addr_is_displayed (item->locator.addr, win_info, TRUE)) + tui_update_source_window (win_info, sal.symtab, a, TRUE); else { a.addr = item->locator.addr; - tui_set_is_exec_point_at (a, winInfo); + tui_set_is_exec_point_at (a, win_info); } } } - tui_update_exec_info (winInfo); + tui_update_exec_info (win_info); } } else @@ -406,9 +406,9 @@ tui_show_frame_info (struct frame_info *fi) tui_show_locator_content (); for (i = 0; i < (tui_source_windows ())->count; i++) { - winInfo = (struct tui_win_info *) (tui_source_windows ())->list[i]; - tui_clear_source_content (winInfo, EMPTY_SOURCE_PROMPT); - tui_update_exec_info (winInfo); + win_info = (struct tui_win_info *) (tui_source_windows ())->list[i]; + tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT); + tui_update_exec_info (win_info); } } } diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index d95c38a..6e5f204 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -415,28 +415,28 @@ tui_update_gdb_sizes () rl_get_screen_size (&screenheight, &screenwidth); /* Set to TUI command window dimension or use readline values. */ sprintf (cmd, "set width %d", - tui_active ? cmdWin->generic.width : screenwidth); + tui_active ? TUI_CMD_WIN->generic.width : screenwidth); execute_command (cmd, 0); sprintf (cmd, "set height %d", - tui_active ? cmdWin->generic.height : screenheight); + tui_active ? TUI_CMD_WIN->generic.height : screenheight); execute_command (cmd, 0); } -/* Set the logical focus to winInfo. */ +/* Set the logical focus to win_info. */ void -tui_set_win_focus_to (struct tui_win_info * winInfo) +tui_set_win_focus_to (struct tui_win_info * win_info) { - if (m_winPtrNotNull (winInfo)) + if (win_info != NULL) { struct tui_win_info * winWithFocus = tui_win_with_focus (); - if (m_winPtrNotNull (winWithFocus) && - winWithFocus->generic.type != CMD_WIN) + if (winWithFocus != NULL + && winWithFocus->generic.type != CMD_WIN) tui_unhighlight_win (winWithFocus); - tui_set_win_with_focus (winInfo); - if (winInfo->generic.type != CMD_WIN) - tui_highlight_win (winInfo); + tui_set_win_with_focus (win_info); + if (win_info->generic.type != CMD_WIN) + tui_highlight_win (win_info); } return; @@ -446,7 +446,7 @@ tui_set_win_focus_to (struct tui_win_info * winInfo) void tui_scroll_forward (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -458,11 +458,11 @@ tui_scroll_forward (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin) + if (winToScroll == TUI_SRC_WIN) tui_vertical_source_scroll (FORWARD_SCROLL, _numToScroll); - else if (winToScroll == disassemWin) + else if (winToScroll == TUI_DISASM_WIN) tui_vertical_disassem_scroll (FORWARD_SCROLL, _numToScroll); - else if (winToScroll == dataWin) + else if (winToScroll == TUI_DATA_WIN) tui_vertical_data_scroll (FORWARD_SCROLL, _numToScroll); } } @@ -470,7 +470,7 @@ tui_scroll_forward (struct tui_win_info * winToScroll, int numToScroll) void tui_scroll_backward (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -482,11 +482,11 @@ tui_scroll_backward (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin) + if (winToScroll == TUI_SRC_WIN) tui_vertical_source_scroll (BACKWARD_SCROLL, _numToScroll); - else if (winToScroll == disassemWin) + else if (winToScroll == TUI_DISASM_WIN) tui_vertical_disassem_scroll (BACKWARD_SCROLL, _numToScroll); - else if (winToScroll == dataWin) + else if (winToScroll == TUI_DATA_WIN) tui_vertical_data_scroll (BACKWARD_SCROLL, _numToScroll); } } @@ -495,7 +495,7 @@ tui_scroll_backward (struct tui_win_info * winToScroll, int numToScroll) void tui_scroll_left (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -507,7 +507,7 @@ tui_scroll_left (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin || winToScroll == disassemWin) + if (winToScroll == TUI_SRC_WIN || winToScroll == TUI_DISASM_WIN) tui_horizontal_source_scroll (winToScroll, LEFT_SCROLL, _numToScroll); } } @@ -516,7 +516,7 @@ tui_scroll_left (struct tui_win_info * winToScroll, int numToScroll) void tui_scroll_right (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -528,7 +528,7 @@ tui_scroll_right (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin || winToScroll == disassemWin) + if (winToScroll == TUI_SRC_WIN || winToScroll == TUI_DISASM_WIN) tui_horizontal_source_scroll (winToScroll, RIGHT_SCROLL, _numToScroll); } } @@ -566,19 +566,19 @@ tui_refresh_all_win (void) enum tui_win_type type; clearok (curscr, TRUE); - tui_refresh_all (winList); + tui_refresh_all (tui_win_list); for (type = SRC_WIN; type < MAX_MAJOR_WINDOWS; type++) { - if (winList[type] && winList[type]->generic.isVisible) + if (tui_win_list[type] && tui_win_list[type]->generic.is_visible) { switch (type) { case SRC_WIN: case DISASSEM_WIN: - tui_show_source_content (winList[type]); - tui_check_and_display_highlight_if_needed (winList[type]); - tui_erase_exec_info_content (winList[type]); - tui_update_exec_info (winList[type]); + tui_show_source_content (tui_win_list[type]); + tui_check_and_display_highlight_if_needed (tui_win_list[type]); + tui_erase_exec_info_content (tui_win_list[type]); + tui_update_exec_info (tui_win_list[type]); break; case DATA_WIN: tui_refresh_data_win (); @@ -617,8 +617,8 @@ tuiResizeAll (void) int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2; /* turn keypad off while we resize */ - if (winWithFocus != cmdWin) - keypad (cmdWin->generic.handle, FALSE); + if (winWithFocus != TUI_CMD_WIN) + keypad (TUI_CMD_WIN->generic.handle, FALSE); tui_update_gdb_sizes (); tui_set_term_height_to (screenheight); tui_set_term_width_to (screenwidth); @@ -656,26 +656,26 @@ tuiResizeAll (void) newHeight = firstWin->generic.height + splitDiff; _makeInvisibleAndSetNewHeight (firstWin, newHeight); - cmdWin->generic.origin.y = locator->origin.y + 1; - cmdWin->generic.width += widthDiff; - newHeight = screenheight - cmdWin->generic.origin.y; - _makeInvisibleAndSetNewHeight (cmdWin, newHeight); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + TUI_CMD_WIN->generic.width += widthDiff; + newHeight = screenheight - TUI_CMD_WIN->generic.origin.y; + _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, newHeight); _makeVisibleWithNewHeight (firstWin); - _makeVisibleWithNewHeight (cmdWin); - if (firstWin->generic.contentSize <= 0) + _makeVisibleWithNewHeight (TUI_CMD_WIN); + if (firstWin->generic.content_size <= 0) tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT); break; default: if (curLayout == SRC_DISASSEM_COMMAND) { - firstWin = srcWin; + firstWin = TUI_SRC_WIN; firstWin->generic.width += widthDiff; - secondWin = disassemWin; + secondWin = TUI_DISASM_WIN; secondWin->generic.width += widthDiff; } else { - firstWin = dataWin; + firstWin = TUI_DATA_WIN; firstWin->generic.width += widthDiff; secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0]; secondWin->generic.width += widthDiff; @@ -694,10 +694,10 @@ tuiResizeAll (void) newHeight = firstWin->generic.height + splitDiff; _makeInvisibleAndSetNewHeight (firstWin, newHeight); - if (firstWin == dataWin && widthDiff != 0) - firstWin->detail.dataDisplayInfo.regsColumnCount = + if (firstWin == TUI_DATA_WIN && widthDiff != 0) + firstWin->detail.data_display_info.regs_column_count = tui_calculate_regs_column_count ( - firstWin->detail.dataDisplayInfo.regsDisplayType); + firstWin->detail.data_display_info.regs_display_type); locator->width += widthDiff; /* Change the second window's height/width */ @@ -722,15 +722,15 @@ tuiResizeAll (void) _makeInvisibleAndSetNewHeight (secondWin, newHeight); /* Change the command window's height/width */ - cmdWin->generic.origin.y = locator->origin.y + 1; + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; _makeInvisibleAndSetNewHeight ( - cmdWin, cmdWin->generic.height + cmdSplitDiff); + TUI_CMD_WIN, TUI_CMD_WIN->generic.height + cmdSplitDiff); _makeVisibleWithNewHeight (firstWin); _makeVisibleWithNewHeight (secondWin); - _makeVisibleWithNewHeight (cmdWin); - if (firstWin->generic.contentSize <= 0) + _makeVisibleWithNewHeight (TUI_CMD_WIN); + if (firstWin->generic.content_size <= 0) tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT); - if (secondWin->generic.contentSize <= 0) + if (secondWin->generic.content_size <= 0) tui_erase_source_content (secondWin, EMPTY_SOURCE_PROMPT); break; } @@ -740,17 +740,17 @@ tuiResizeAll (void) */ for (winType = SRC_WIN; (winType < MAX_MAJOR_WINDOWS); winType++) { - if (winType != CMD_WIN && m_winPtrNotNull (winList[winType]) && - !winList[winType]->generic.isVisible) + if (winType != CMD_WIN && (tui_win_list[winType] != NULL) + && !tui_win_list[winType]->generic.is_visible) { - tui_free_window (winList[winType]); - winList[winType] = (struct tui_win_info *) NULL; + tui_free_window (tui_win_list[winType]); + tui_win_list[winType] = (struct tui_win_info *) NULL; } } tui_set_win_resized_to (TRUE); /* turn keypad back on, unless focus is in the command window */ - if (winWithFocus != cmdWin) - keypad (cmdWin->generic.handle, TRUE); + if (winWithFocus != TUI_CMD_WIN) + keypad (TUI_CMD_WIN->generic.handle, TRUE); } return; } /* tuiResizeAll */ @@ -862,28 +862,28 @@ _tuiSetFocus (char *arg, int fromTTY) { char *bufPtr = (char *) xstrdup (arg); int i; - struct tui_win_info * winInfo = (struct tui_win_info *) NULL; + struct tui_win_info * win_info = (struct tui_win_info *) NULL; for (i = 0; (i < strlen (bufPtr)); i++) bufPtr[i] = toupper (arg[i]); if (subset_compare (bufPtr, "NEXT")) - winInfo = tui_next_win (tui_win_with_focus ()); + win_info = tui_next_win (tui_win_with_focus ()); else if (subset_compare (bufPtr, "PREV")) - winInfo = tui_prev_win (tui_win_with_focus ()); + win_info = tui_prev_win (tui_win_with_focus ()); else - winInfo = tui_partial_win_by_name (bufPtr); + win_info = tui_partial_win_by_name (bufPtr); - if (winInfo == (struct tui_win_info *) NULL || !winInfo->generic.isVisible) + if (win_info == (struct tui_win_info *) NULL || !win_info->generic.is_visible) warning ("Invalid window specified. \n\ The window name specified must be valid and visible.\n"); else { - tui_set_win_focus_to (winInfo); - keypad (cmdWin->generic.handle, (winInfo != cmdWin)); + tui_set_win_focus_to (win_info); + keypad (TUI_CMD_WIN->generic.handle, (win_info != TUI_CMD_WIN)); } - if (dataWin && dataWin->generic.isVisible) + if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible) tui_refresh_data_win (); xfree (bufPtr); printf_filtered ("Focus set to %s window.\n", @@ -917,16 +917,16 @@ _tuiAllWindowsInfo (char *arg, int fromTTY) struct tui_win_info * winWithFocus = tui_win_with_focus (); for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++) - if (winList[type] && winList[type]->generic.isVisible) + if (tui_win_list[type] && tui_win_list[type]->generic.is_visible) { - if (winWithFocus == winList[type]) + if (winWithFocus == tui_win_list[type]) printf_filtered (" %s\t(%d lines) <has focus>\n", - tui_win_name (&winList[type]->generic), - winList[type]->generic.height); + tui_win_name (&tui_win_list[type]->generic), + tui_win_list[type]->generic.height); else printf_filtered (" %s\t(%d lines)\n", - tui_win_name (&winList[type]->generic), - winList[type]->generic.height); + tui_win_name (&tui_win_list[type]->generic), + tui_win_list[type]->generic.height); } return; @@ -985,7 +985,7 @@ _tuiSetWinHeight (char *arg, int fromTTY) char *bufPtr = buf; char *wname = (char *) NULL; int newHeight, i; - struct tui_win_info * winInfo; + struct tui_win_info * win_info; wname = bufPtr; bufPtr = strchr (bufPtr, ' '); @@ -998,9 +998,9 @@ _tuiSetWinHeight (char *arg, int fromTTY) */ for (i = 0; i < strlen (wname); i++) wname[i] = toupper (wname[i]); - winInfo = tui_partial_win_by_name (wname); + win_info = tui_partial_win_by_name (wname); - if (winInfo == (struct tui_win_info *) NULL || !winInfo->generic.isVisible) + if (win_info == (struct tui_win_info *) NULL || !win_info->generic.is_visible) warning ("Invalid window specified. \n\ The window name specified must be valid and visible.\n"); else @@ -1030,12 +1030,12 @@ The window name specified must be valid and visible.\n"); if (fixedSize) newHeight = inputNo; else - newHeight = winInfo->generic.height + inputNo; + newHeight = win_info->generic.height + inputNo; /* ** Now change the window's height, and adjust all ** other windows around it */ - if (_tuiAdjustWinHeights (winInfo, + if (_tuiAdjustWinHeights (win_info, newHeight) == TUI_FAILURE) warning ("Invalid window height specified.\n%s", WIN_HEIGHT_USAGE); @@ -1091,8 +1091,8 @@ _tuiXDBsetWinHeight (char *arg, int fromTTY) { /* Add 1 for the locator */ int newHeight = tui_term_height () - (inputNo + 1); - if (!_newHeightOk (winList[CMD_WIN], newHeight) || - _tuiAdjustWinHeights (winList[CMD_WIN], + if (!_newHeightOk (tui_win_list[CMD_WIN], newHeight) || + _tuiAdjustWinHeights (tui_win_list[CMD_WIN], newHeight) == TUI_FAILURE) warning ("Invalid window height specified.\n%s", XDBWIN_HEIGHT_USAGE); @@ -1133,7 +1133,7 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) if (newHeight != primaryWinInfo->generic.height) { int diff; - struct tui_win_info * winInfo; + struct tui_win_info * win_info; struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); enum tui_layout_type curLayout = tui_current_layout (); @@ -1145,20 +1145,20 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) _makeInvisibleAndSetNewHeight (primaryWinInfo, newHeight); if (primaryWinInfo->generic.type == CMD_WIN) { - winInfo = (struct tui_win_info *) (tui_source_windows ())->list[0]; - srcWinInfo = winInfo; + win_info = (struct tui_win_info *) (tui_source_windows ())->list[0]; + srcWinInfo = win_info; } else { - winInfo = winList[CMD_WIN]; + win_info = tui_win_list[CMD_WIN]; srcWinInfo = primaryWinInfo; } - _makeInvisibleAndSetNewHeight (winInfo, - winInfo->generic.height + diff); - cmdWin->generic.origin.y = locator->origin.y + 1; - _makeVisibleWithNewHeight (winInfo); + _makeInvisibleAndSetNewHeight (win_info, + win_info->generic.height + diff); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + _makeVisibleWithNewHeight (win_info); _makeVisibleWithNewHeight (primaryWinInfo); - if (srcWinInfo->generic.contentSize <= 0) + if (srcWinInfo->generic.content_size <= 0) tui_erase_source_content (srcWinInfo, EMPTY_SOURCE_PROMPT); } else @@ -1168,15 +1168,15 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) if (curLayout == SRC_DISASSEM_COMMAND) { - firstWin = srcWin; - secondWin = disassemWin; + firstWin = TUI_SRC_WIN; + secondWin = TUI_DISASM_WIN; } else { - firstWin = dataWin; + firstWin = TUI_DATA_WIN; secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0]; } - if (primaryWinInfo == cmdWin) + if (primaryWinInfo == TUI_CMD_WIN) { /* ** Split the change in height accross the 1st & 2nd windows ** adjusting them as well. @@ -1217,20 +1217,20 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) secondWin->generic.origin.y = firstWin->generic.height - 1; _makeInvisibleAndSetNewHeight ( secondWin, secondWin->generic.height + secondSplitDiff); - cmdWin->generic.origin.y = locator->origin.y + 1; - _makeInvisibleAndSetNewHeight (cmdWin, newHeight); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, newHeight); } else { - if ((cmdWin->generic.height + diff) < 1) + if ((TUI_CMD_WIN->generic.height + diff) < 1) { /* ** If there is no way to increase the command window ** take real estate from the 1st or 2nd window. */ - if ((cmdWin->generic.height + diff) < 1) + if ((TUI_CMD_WIN->generic.height + diff) < 1) { int i; - for (i = cmdWin->generic.height + diff; + for (i = TUI_CMD_WIN->generic.height + diff; (i < 1); i++) if (primaryWinInfo == firstWin) secondWin->generic.height--; @@ -1250,19 +1250,19 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) else _makeInvisibleAndSetNewHeight ( secondWin, secondWin->generic.height); - cmdWin->generic.origin.y = locator->origin.y + 1; - if ((cmdWin->generic.height + diff) < 1) - _makeInvisibleAndSetNewHeight (cmdWin, 1); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + if ((TUI_CMD_WIN->generic.height + diff) < 1) + _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, 1); else _makeInvisibleAndSetNewHeight ( - cmdWin, cmdWin->generic.height + diff); + TUI_CMD_WIN, TUI_CMD_WIN->generic.height + diff); } - _makeVisibleWithNewHeight (cmdWin); + _makeVisibleWithNewHeight (TUI_CMD_WIN); _makeVisibleWithNewHeight (secondWin); _makeVisibleWithNewHeight (firstWin); - if (firstWin->generic.contentSize <= 0) + if (firstWin->generic.content_size <= 0) tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT); - if (secondWin->generic.contentSize <= 0) + if (secondWin->generic.content_size <= 0) tui_erase_source_content (secondWin, EMPTY_SOURCE_PROMPT); } } @@ -1278,49 +1278,49 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) ** with the targer) invisible, and set the new height and location. */ static void -_makeInvisibleAndSetNewHeight (struct tui_win_info * winInfo, int height) +_makeInvisibleAndSetNewHeight (struct tui_win_info * win_info, int height) { int i; struct tui_gen_win_info * genWinInfo; - tui_make_invisible (&winInfo->generic); - winInfo->generic.height = height; + tui_make_invisible (&win_info->generic); + win_info->generic.height = height; if (height > 1) - winInfo->generic.viewportHeight = height - 1; + win_info->generic.viewport_height = height - 1; else - winInfo->generic.viewportHeight = height; - if (winInfo != cmdWin) - winInfo->generic.viewportHeight--; + win_info->generic.viewport_height = height; + if (win_info != TUI_CMD_WIN) + win_info->generic.viewport_height--; - /* Now deal with the auxillary windows associated with winInfo */ - switch (winInfo->generic.type) + /* Now deal with the auxillary windows associated with win_info */ + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - genWinInfo = winInfo->detail.sourceInfo.executionInfo; + genWinInfo = win_info->detail.source_info.execution_info; tui_make_invisible (genWinInfo); genWinInfo->height = height; - genWinInfo->origin.y = winInfo->generic.origin.y; + genWinInfo->origin.y = win_info->generic.origin.y; if (height > 1) - genWinInfo->viewportHeight = height - 1; + genWinInfo->viewport_height = height - 1; else - genWinInfo->viewportHeight = height; - if (winInfo != cmdWin) - genWinInfo->viewportHeight--; + genWinInfo->viewport_height = height; + if (win_info != TUI_CMD_WIN) + genWinInfo->viewport_height--; - if (m_hasLocator (winInfo)) + if (tui_win_has_locator (win_info)) { genWinInfo = tui_locator_win_info_ptr (); tui_make_invisible (genWinInfo); - genWinInfo->origin.y = winInfo->generic.origin.y + height; + genWinInfo->origin.y = win_info->generic.origin.y + height; } break; case DATA_WIN: /* delete all data item windows */ - for (i = 0; i < winInfo->generic.contentSize; i++) + for (i = 0; i < win_info->generic.content_size; i++) { genWinInfo = (struct tui_gen_win_info *) & ((struct tui_win_element *) - winInfo->generic.content[i])->whichElement.dataWindow; + win_info->generic.content[i])->which_element.data_window; tui_delete_win (genWinInfo->handle); genWinInfo->handle = (WINDOW *) NULL; } @@ -1338,32 +1338,32 @@ _makeInvisibleAndSetNewHeight (struct tui_win_info * winInfo, int height) ** had to be destroyed to be made invisible. */ static void -_makeVisibleWithNewHeight (struct tui_win_info * winInfo) +_makeVisibleWithNewHeight (struct tui_win_info * win_info) { struct symtab *s; - tui_make_visible (&winInfo->generic); - tui_check_and_display_highlight_if_needed (winInfo); - switch (winInfo->generic.type) + tui_make_visible (&win_info->generic); + tui_check_and_display_highlight_if_needed (win_info); + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - tui_free_win_content (winInfo->detail.sourceInfo.executionInfo); - tui_make_visible (winInfo->detail.sourceInfo.executionInfo); - if (winInfo->generic.content != NULL) + tui_free_win_content (win_info->detail.source_info.execution_info); + tui_make_visible (win_info->detail.source_info.execution_info); + if (win_info->generic.content != NULL) { union tui_line_or_address lineOrAddr; struct symtab_and_line cursal = get_current_source_symtab_and_line (); - if (winInfo->generic.type == SRC_WIN) - lineOrAddr.lineNo = - winInfo->detail.sourceInfo.startLineOrAddr.lineNo; + if (win_info->generic.type == SRC_WIN) + lineOrAddr.line_no = + win_info->detail.source_info.start_line_or_addr.line_no; else lineOrAddr.addr = - winInfo->detail.sourceInfo.startLineOrAddr.addr; - tui_free_win_content (&winInfo->generic); - tui_update_source_window (winInfo, cursal.symtab, lineOrAddr, TRUE); + win_info->detail.source_info.start_line_or_addr.addr; + tui_free_win_content (&win_info->generic); + tui_update_source_window (win_info, cursal.symtab, lineOrAddr, TRUE); } else if (deprecated_selected_frame != (struct frame_info *) NULL) { @@ -1372,15 +1372,15 @@ _makeVisibleWithNewHeight (struct tui_win_info * winInfo) s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); - if (winInfo->generic.type == SRC_WIN) - line.lineNo = cursal.line; + if (win_info->generic.type == SRC_WIN) + line.line_no = cursal.line; else { find_line_pc (s, cursal.line, &line.addr); } - tui_update_source_window (winInfo, s, line, TRUE); + tui_update_source_window (win_info, s, line, TRUE); } - if (m_hasLocator (winInfo)) + if (tui_win_has_locator (win_info)) { tui_make_visible (tui_locator_win_info_ptr ()); tui_show_locator_content (); @@ -1390,11 +1390,11 @@ _makeVisibleWithNewHeight (struct tui_win_info * winInfo) tui_display_all_data (); break; case CMD_WIN: - winInfo->detail.commandInfo.curLine = 0; - winInfo->detail.commandInfo.curch = 0; - wmove (winInfo->generic.handle, - winInfo->detail.commandInfo.curLine, - winInfo->detail.commandInfo.curch); + win_info->detail.command_info.cur_line = 0; + win_info->detail.command_info.curch = 0; + wmove (win_info->generic.handle, + win_info->detail.command_info.cur_line, + win_info->detail.command_info.curch); break; default: break; @@ -1412,10 +1412,10 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) if (ok) { int diff; - enum tui_layout_type curLayout = tui_current_layout (); + enum tui_layout_type cur_layout = tui_current_layout (); diff = (newHeight - primaryWinInfo->generic.height) * (-1); - if (curLayout == SRC_COMMAND || curLayout == DISASSEM_COMMAND) + if (cur_layout == SRC_COMMAND || cur_layout == DISASSEM_COMMAND) { ok = ((primaryWinInfo->generic.type == CMD_WIN && newHeight <= (tui_term_height () - 4) && @@ -1425,14 +1425,14 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) newHeight >= MIN_WIN_HEIGHT)); if (ok) { /* check the total height */ - struct tui_win_info * winInfo; + struct tui_win_info * win_info; - if (primaryWinInfo == cmdWin) - winInfo = (struct tui_win_info *) (tui_source_windows ())->list[0]; + if (primaryWinInfo == TUI_CMD_WIN) + win_info = (struct tui_win_info *) (tui_source_windows ())->list[0]; else - winInfo = cmdWin; + win_info = TUI_CMD_WIN; ok = ((newHeight + - (winInfo->generic.height + diff)) <= tui_term_height ()); + (win_info->generic.height + diff)) <= tui_term_height ()); } } else @@ -1441,14 +1441,14 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) struct tui_win_info *firstWin; struct tui_win_info *secondWin; - if (curLayout == SRC_DISASSEM_COMMAND) + if (cur_layout == SRC_DISASSEM_COMMAND) { - firstWin = srcWin; - secondWin = disassemWin; + firstWin = TUI_SRC_WIN; + secondWin = TUI_DISASM_WIN; } else { - firstWin = dataWin; + firstWin = TUI_DATA_WIN; secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0]; } /* @@ -1459,8 +1459,8 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) */ totalHeight = curTotalHeight = (firstWin->generic.height + secondWin->generic.height - 1) - + cmdWin->generic.height + 1 /*locator */ ; - if (primaryWinInfo == cmdWin) + + TUI_CMD_WIN->generic.height + 1 /*locator */ ; + if (primaryWinInfo == TUI_CMD_WIN) { /* locator included since first & second win share a line */ ok = ((firstWin->generic.height + @@ -1482,7 +1482,7 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) ** window. And make sure that the command window is ** at least 1 line */ - ok = ((cmdWin->generic.height + diff) > 0); + ok = ((TUI_CMD_WIN->generic.height + diff) > 0); if (!ok) { /* ** Looks like we have to increase/decrease one of @@ -1498,11 +1498,11 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) if (primaryWinInfo == firstWin) totalHeight = newHeight + secondWin->generic.height + - cmdWin->generic.height + diff; + TUI_CMD_WIN->generic.height + diff; else totalHeight = newHeight + firstWin->generic.height + - cmdWin->generic.height + diff; + TUI_CMD_WIN->generic.height + diff; } } /* @@ -1576,10 +1576,10 @@ _parseScrollingArgs (char *arg, struct tui_win_info * * winToScroll, int *numToS *winToScroll = tui_partial_win_by_name (wname); if (*winToScroll == (struct tui_win_info *) NULL || - !(*winToScroll)->generic.isVisible) + !(*winToScroll)->generic.is_visible) warning ("Invalid window specified. \n\ The window name specified must be valid and visible.\n"); - else if (*winToScroll == cmdWin) + else if (*winToScroll == TUI_CMD_WIN) *winToScroll = (struct tui_win_info *) (tui_source_windows ())->list[0]; } xfree (buf); diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c index 93993af..0548536 100644 --- a/gdb/tui/tui-windata.c +++ b/gdb/tui/tui-windata.c @@ -59,13 +59,13 @@ tuiFirstDataItemDisplayed (void) int elementNo = (-1); int i; - for (i = 0; (i < dataWin->generic.contentSize && elementNo < 0); i++) + for (i = 0; (i < TUI_DATA_WIN->generic.content_size && elementNo < 0); i++) { struct tui_gen_win_info * dataItemWin; dataItemWin = &((tui_win_content) - dataWin->generic.content)[i]->whichElement.dataWindow; - if (dataItemWin->handle != (WINDOW *) NULL && dataItemWin->isVisible) + TUI_DATA_WIN->generic.content)[i]->which_element.data_window; + if (dataItemWin->handle != (WINDOW *) NULL && dataItemWin->is_visible) elementNo = i; } @@ -108,13 +108,13 @@ tuiDeleteDataContentWindows (void) int i; struct tui_gen_win_info * dataItemWinPtr; - for (i = 0; (i < dataWin->generic.contentSize); i++) + for (i = 0; (i < TUI_DATA_WIN->generic.content_size); i++) { dataItemWinPtr = &((tui_win_content) - dataWin->generic.content)[i]->whichElement.dataWindow; + TUI_DATA_WIN->generic.content)[i]->which_element.data_window; tui_delete_win (dataItemWinPtr->handle); dataItemWinPtr->handle = (WINDOW *) NULL; - dataItemWinPtr->isVisible = FALSE; + dataItemWinPtr->is_visible = FALSE; } return; @@ -124,23 +124,23 @@ tuiDeleteDataContentWindows (void) void tui_erase_data_content (char *prompt) { - werase (dataWin->generic.handle); - tui_check_and_display_highlight_if_needed (dataWin); + werase (TUI_DATA_WIN->generic.handle); + tui_check_and_display_highlight_if_needed (TUI_DATA_WIN); if (prompt != (char *) NULL) { - int halfWidth = (dataWin->generic.width - 2) / 2; + int halfWidth = (TUI_DATA_WIN->generic.width - 2) / 2; int xPos; if (strlen (prompt) >= halfWidth) xPos = 1; else xPos = halfWidth - strlen (prompt); - mvwaddstr (dataWin->generic.handle, - (dataWin->generic.height / 2), + mvwaddstr (TUI_DATA_WIN->generic.handle, + (TUI_DATA_WIN->generic.height / 2), xPos, prompt); } - wrefresh (dataWin->generic.handle); + wrefresh (TUI_DATA_WIN->generic.handle); } @@ -149,20 +149,20 @@ tui_erase_data_content (char *prompt) void tui_display_all_data (void) { - if (dataWin->generic.contentSize <= 0) + if (TUI_DATA_WIN->generic.content_size <= 0) tui_erase_data_content (NO_DATA_STRING); else { tui_erase_data_content ((char *) NULL); tuiDeleteDataContentWindows (); - tui_check_and_display_highlight_if_needed (dataWin); + tui_check_and_display_highlight_if_needed (TUI_DATA_WIN); tui_display_registers_from (0); /* ** Then display the other data */ - if (dataWin->detail.dataDisplayInfo.dataContent != + if (TUI_DATA_WIN->detail.data_display_info.data_content != (tui_win_content) NULL && - dataWin->detail.dataDisplayInfo.dataContentCount > 0) + TUI_DATA_WIN->detail.data_display_info.data_content_count > 0) { } } @@ -182,10 +182,10 @@ tuiDisplayDataFromLine (int lineNo) if (lineNo < 0) _lineNo = 0; - tui_check_and_display_highlight_if_needed (dataWin); + tui_check_and_display_highlight_if_needed (TUI_DATA_WIN); /* there is no general data, force regs to display (if there are any) */ - if (dataWin->detail.dataDisplayInfo.dataContentCount <= 0) + if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0) tui_display_registers_from_line (_lineNo, TRUE); else { @@ -227,7 +227,7 @@ tuiDisplayDataFrom (int elementNo, int reuseWindows) { int firstLine = (-1); - if (elementNo < dataWin->detail.dataDisplayInfo.regsContentCount) + if (elementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count) firstLine = tui_line_from_reg_element_no (elementNo); else { /* calculate the firstLine from the element number */ @@ -250,7 +250,7 @@ void tui_refresh_data_win (void) { tui_erase_data_content ((char *) NULL); - if (dataWin->generic.contentSize > 0) + if (TUI_DATA_WIN->generic.content_size > 0) { int firstElement = tuiFirstDataItemDisplayed (); @@ -267,21 +267,21 @@ tui_check_data_values (struct frame_info *frame) tui_check_register_values (frame); /* Now check any other data values that there are */ - if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible) + if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible) { int i; - for (i = 0; dataWin->detail.dataDisplayInfo.dataContentCount; i++) + 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; - dataItemPtr = &dataWin->detail.dataDisplayInfo. - dataContent[i]->whichElement.dataWindow; + dataItemPtr = &TUI_DATA_WIN->detail.data_display_info. + data_content[i]->which_element.data_window; dataElementPtr = &((tui_win_content) - dataItemWinPtr->content)[0]->whichElement.data; + dataItemWinPtr->content)[0]->which_element.data; if value has changed (dataElementPtr, frame, &newValue) { @@ -302,7 +302,7 @@ tui_vertical_data_scroll (enum tui_scroll_direction scrollDirection, int numToSc int firstLine = (-1); firstElementNo = tuiFirstDataItemDisplayed (); - if (firstElementNo < dataWin->detail.dataDisplayInfo.regsContentCount) + if (firstElementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count) firstLine = tui_line_from_reg_element_no (firstElementNo); else { /* calculate the first line from the element number which is in diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 12fc415..9239a05 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -42,31 +42,31 @@ /* Refresh the window. */ void -tui_refresh_win (struct tui_gen_win_info * winInfo) +tui_refresh_win (struct tui_gen_win_info * win_info) { - if (winInfo->type == DATA_WIN && winInfo->contentSize > 0) + if (win_info->type == DATA_WIN && win_info->content_size > 0) { int i; - for (i = 0; (i < winInfo->contentSize); i++) + for (i = 0; (i < win_info->content_size); i++) { struct tui_gen_win_info * dataItemWinPtr; dataItemWinPtr = &((tui_win_content) - winInfo->content)[i]->whichElement.dataWindow; - if (m_genWinPtrNotNull (dataItemWinPtr) && - dataItemWinPtr->handle != (WINDOW *) NULL) + win_info->content)[i]->which_element.data_window; + if (dataItemWinPtr != NULL + && dataItemWinPtr->handle != (WINDOW *) NULL) wrefresh (dataItemWinPtr->handle); } } - else if (winInfo->type == CMD_WIN) + else if (win_info->type == CMD_WIN) { /* Do nothing */ } else { - if (winInfo->handle != (WINDOW *) NULL) - wrefresh (winInfo->handle); + if (win_info->handle != (WINDOW *) NULL) + wrefresh (win_info->handle); } return; @@ -86,14 +86,14 @@ tui_delete_win (WINDOW * window) /* Draw a border arround the window. */ void -boxWin (struct tui_gen_win_info * winInfo, int highlightFlag) +boxWin (struct tui_gen_win_info * win_info, int highlightFlag) { - if (winInfo && winInfo->handle) + if (win_info && win_info->handle) { WINDOW *win; int attrs; - win = winInfo->handle; + win = win_info->handle; if (highlightFlag == HILITE) attrs = tui_active_border_attrs; else @@ -104,46 +104,47 @@ boxWin (struct tui_gen_win_info * winInfo, int highlightFlag) tui_border_hline, tui_border_hline, tui_border_ulcorner, tui_border_urcorner, tui_border_llcorner, tui_border_lrcorner); - if (winInfo->title) - mvwaddstr (win, 0, 3, winInfo->title); + if (win_info->title) + mvwaddstr (win, 0, 3, win_info->title); wattroff (win, attrs); } } void -tui_unhighlight_win (struct tui_win_info * winInfo) +tui_unhighlight_win (struct tui_win_info * win_info) { - if (m_winPtrNotNull (winInfo) && winInfo->generic.handle != (WINDOW *) NULL) + if (win_info != NULL && win_info->generic.handle != (WINDOW *) NULL) { - boxWin ((struct tui_gen_win_info *) winInfo, NO_HILITE); - wrefresh (winInfo->generic.handle); - m_setWinHighlightOff (winInfo); + boxWin ((struct tui_gen_win_info *) win_info, NO_HILITE); + wrefresh (win_info->generic.handle); + tui_set_win_highlight (win_info, 0); } } void -tui_highlight_win (struct tui_win_info * winInfo) +tui_highlight_win (struct tui_win_info * win_info) { - if (m_winPtrNotNull (winInfo) && - winInfo->canHighlight && winInfo->generic.handle != (WINDOW *) NULL) + if (win_info != NULL + && win_info->can_highlight + && win_info->generic.handle != (WINDOW *) NULL) { - boxWin ((struct tui_gen_win_info *) winInfo, HILITE); - wrefresh (winInfo->generic.handle); - m_setWinHighlightOn (winInfo); + boxWin ((struct tui_gen_win_info *) win_info, HILITE); + wrefresh (win_info->generic.handle); + tui_set_win_highlight (win_info, 1); } } void -tui_check_and_display_highlight_if_needed (struct tui_win_info * winInfo) +tui_check_and_display_highlight_if_needed (struct tui_win_info * win_info) { - if (m_winPtrNotNull (winInfo) && winInfo->generic.type != CMD_WIN) + if (win_info != NULL && win_info->generic.type != CMD_WIN) { - if (winInfo->isHighlighted) - tui_highlight_win (winInfo); + if (win_info->is_highlighted) + tui_highlight_win (win_info); else - tui_unhighlight_win (winInfo); + tui_unhighlight_win (win_info); } return; @@ -151,20 +152,20 @@ tui_check_and_display_highlight_if_needed (struct tui_win_info * winInfo) void -tui_make_window (struct tui_gen_win_info * winInfo, int boxIt) +tui_make_window (struct tui_gen_win_info * win_info, int boxIt) { WINDOW *handle; - handle = newwin (winInfo->height, - winInfo->width, - winInfo->origin.y, - winInfo->origin.x); - winInfo->handle = handle; + handle = newwin (win_info->height, + win_info->width, + win_info->origin.y, + win_info->origin.x); + win_info->handle = handle; if (handle != (WINDOW *) NULL) { if (boxIt == BOX_WINDOW) - boxWin (winInfo, NO_HILITE); - winInfo->isVisible = TRUE; + boxWin (win_info, NO_HILITE); + win_info->is_visible = TRUE; scrollok (handle, TRUE); } } @@ -182,18 +183,18 @@ make_visible (struct tui_gen_win_info *win_info, int visible) if (visible) { - if (!win_info->isVisible) + if (!win_info->is_visible) { tui_make_window (win_info, (win_info->type != CMD_WIN - && !m_winIsAuxillary (win_info->type))); - win_info->isVisible = TRUE; + && !tui_win_is_auxillary (win_info->type))); + win_info->is_visible = TRUE; } } else if (!visible && - win_info->isVisible && win_info->handle != (WINDOW *) NULL) + win_info->is_visible && win_info->handle != (WINDOW *) NULL) { - win_info->isVisible = FALSE; + win_info->is_visible = FALSE; tui_delete_win (win_info->handle); win_info->handle = (WINDOW *) NULL; } @@ -222,13 +223,13 @@ make_all_visible (int visible) for (i = 0; i < MAX_MAJOR_WINDOWS; i++) { - if (m_winPtrNotNull (winList[i]) && - ((winList[i])->generic.type) != CMD_WIN) + if (tui_win_list[i] != NULL + && ((tui_win_list[i])->generic.type) != CMD_WIN) { - if (m_winIsSourceType ((winList[i])->generic.type)) - make_visible ((winList[i])->detail.sourceInfo.executionInfo, + if (tui_win_is_source_type ((tui_win_list[i])->generic.type)) + make_visible ((tui_win_list[i])->detail.source_info.execution_info, visible); - make_visible ((struct tui_gen_win_info *) winList[i], visible); + make_visible ((struct tui_gen_win_info *) tui_win_list[i], visible); } } @@ -257,18 +258,18 @@ tui_refresh_all (struct tui_win_info * * list) for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++) { - if (list[type] && list[type]->generic.isVisible) + if (list[type] && list[type]->generic.is_visible) { if (type == SRC_WIN || type == DISASSEM_WIN) { - touchwin (list[type]->detail.sourceInfo.executionInfo->handle); - tui_refresh_win (list[type]->detail.sourceInfo.executionInfo); + touchwin (list[type]->detail.source_info.execution_info->handle); + tui_refresh_win (list[type]->detail.source_info.execution_info); } touchwin (list[type]->generic.handle); tui_refresh_win (&list[type]->generic); } } - if (locator->isVisible) + if (locator->is_visible) { touchwin (locator->handle); tui_refresh_win (locator); diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h index f91095d..306d794 100644 --- a/gdb/tui/tui-wingeneral.h +++ b/gdb/tui/tui-wingeneral.h @@ -42,11 +42,4 @@ extern void tui_refresh_all (struct tui_win_info **); extern void tui_delete_win (WINDOW * window); extern void tui_refresh_win (struct tui_gen_win_info *); -/* - ** Macros - */ -#define m_beVisible(winInfo) makeVisible((struct tui_gen_win_info *)(winInfo), TRUE) -#define m_beInvisible(winInfo) \ - makeVisible((struct tui_gen_win_info *)(winInfo), FALSE) - #endif diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 0a94399..1a8775e 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -75,11 +75,11 @@ tui_display_main (void) /* Function to display source in the source window. This function initializes the horizontal scroll to 0. */ void -tui_update_source_window (struct tui_win_info * winInfo, struct symtab *s, +tui_update_source_window (struct tui_win_info * win_info, struct symtab *s, union tui_line_or_address lineOrAddr, int noerror) { - winInfo->detail.sourceInfo.horizontalOffset = 0; - tui_update_source_window_as_is (winInfo, s, lineOrAddr, noerror); + win_info->detail.source_info.horizontal_offset = 0; + tui_update_source_window_as_is (win_info, s, lineOrAddr, noerror); return; } @@ -88,41 +88,41 @@ tui_update_source_window (struct tui_win_info * winInfo, struct symtab *s, /* Function to display source in the source/asm window. This function shows the source as specified by the horizontal offset. */ void -tui_update_source_window_as_is (struct tui_win_info * winInfo, struct symtab *s, +tui_update_source_window_as_is (struct tui_win_info * win_info, struct symtab *s, union tui_line_or_address lineOrAddr, int noerror) { enum tui_status ret; - if (winInfo->generic.type == SRC_WIN) - ret = tui_set_source_content (s, lineOrAddr.lineNo, noerror); + if (win_info->generic.type == SRC_WIN) + ret = tui_set_source_content (s, lineOrAddr.line_no, noerror); else ret = tui_set_disassem_content (lineOrAddr.addr); if (ret == TUI_FAILURE) { - tui_clear_source_content (winInfo, EMPTY_SOURCE_PROMPT); - tui_clear_exec_info_content (winInfo); + tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT); + tui_clear_exec_info_content (win_info); } else { - tui_update_breakpoint_info (winInfo, 0); - tui_show_source_content (winInfo); - tui_update_exec_info (winInfo); - if (winInfo->generic.type == SRC_WIN) + tui_update_breakpoint_info (win_info, 0); + tui_show_source_content (win_info); + tui_update_exec_info (win_info); + if (win_info->generic.type == SRC_WIN) { struct symtab_and_line sal; - sal.line = lineOrAddr.lineNo + - (winInfo->generic.contentSize - 2); + sal.line = lineOrAddr.line_no + + (win_info->generic.content_size - 2); sal.symtab = s; set_current_source_symtab_and_line (&sal); /* ** If the focus was in the asm win, put it in the src ** win if we don't have a split layout */ - if (tui_win_with_focus () == disassemWin && + if (tui_win_with_focus () == TUI_DISASM_WIN && tui_current_layout () != SRC_DISASSEM_COMMAND) - tui_set_win_focus_to (srcWin); + tui_set_win_focus_to (TUI_SRC_WIN); } } @@ -152,7 +152,7 @@ tui_update_source_windows_with_addr (CORE_ADDR addr) break; default: sal = find_pc_line (addr, 0); - l.lineNo = sal.line; + l.line_no = sal.line; tui_show_symtab_source (sal.symtab, l, FALSE); break; } @@ -163,10 +163,10 @@ tui_update_source_windows_with_addr (CORE_ADDR addr) for (i = 0; i < (tui_source_windows ())->count; i++) { - struct tui_win_info * winInfo = (struct tui_win_info *) (tui_source_windows ())->list[i]; + struct tui_win_info * win_info = (struct tui_win_info *) (tui_source_windows ())->list[i]; - tui_clear_source_content (winInfo, EMPTY_SOURCE_PROMPT); - tui_clear_exec_info_content (winInfo); + tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT); + tui_clear_exec_info_content (win_info); } } @@ -189,7 +189,7 @@ tui_update_source_windows_with_line (struct symtab *s, int line) tui_update_source_windows_with_addr (pc); break; default: - l.lineNo = line; + l.line_no = line; tui_show_symtab_source (s, l, FALSE); if (tui_current_layout () == SRC_DISASSEM_COMMAND) { @@ -203,20 +203,20 @@ tui_update_source_windows_with_line (struct symtab *s, int line) } void -tui_clear_source_content (struct tui_win_info * winInfo, int displayPrompt) +tui_clear_source_content (struct tui_win_info * win_info, int displayPrompt) { - if (m_winPtrNotNull (winInfo)) + if (win_info != NULL) { register int i; - winInfo->generic.contentInUse = FALSE; - tui_erase_source_content (winInfo, displayPrompt); - for (i = 0; i < winInfo->generic.contentSize; i++) + win_info->generic.content_in_use = FALSE; + tui_erase_source_content (win_info, displayPrompt); + for (i = 0; i < win_info->generic.content_size; i++) { struct tui_win_element * element = - (struct tui_win_element *) winInfo->generic.content[i]; - element->whichElement.source.hasBreak = FALSE; - element->whichElement.source.isExecPoint = FALSE; + (struct tui_win_element *) win_info->generic.content[i]; + element->which_element.source.has_break = FALSE; + element->which_element.source.is_exec_point = FALSE; } } @@ -225,20 +225,20 @@ tui_clear_source_content (struct tui_win_info * winInfo, int displayPrompt) void -tui_erase_source_content (struct tui_win_info * winInfo, int displayPrompt) +tui_erase_source_content (struct tui_win_info * win_info, int displayPrompt) { int xPos; - int halfWidth = (winInfo->generic.width - 2) / 2; + int halfWidth = (win_info->generic.width - 2) / 2; - if (winInfo->generic.handle != (WINDOW *) NULL) + if (win_info->generic.handle != (WINDOW *) NULL) { - werase (winInfo->generic.handle); - tui_check_and_display_highlight_if_needed (winInfo); + werase (win_info->generic.handle); + tui_check_and_display_highlight_if_needed (win_info); if (displayPrompt == EMPTY_SOURCE_PROMPT) { char *noSrcStr; - if (winInfo->generic.type == SRC_WIN) + if (win_info->generic.type == SRC_WIN) noSrcStr = NO_SRC_STRING; else noSrcStr = NO_DISASSEM_STRING; @@ -246,8 +246,8 @@ tui_erase_source_content (struct tui_win_info * winInfo, int displayPrompt) xPos = 1; else xPos = halfWidth - strlen (noSrcStr); - mvwaddstr (winInfo->generic.handle, - (winInfo->generic.height / 2), + mvwaddstr (win_info->generic.handle, + (win_info->generic.height / 2), xPos, noSrcStr); @@ -256,9 +256,9 @@ tui_erase_source_content (struct tui_win_info * winInfo, int displayPrompt) to refresh, do display the correct stuff, and not the old image */ - tui_set_source_content_nil (winInfo, noSrcStr); + tui_set_source_content_nil (win_info, noSrcStr); } - tui_refresh_win (&winInfo->generic); + tui_refresh_win (&win_info->generic); } return; } /* tuiEraseSourceContent */ @@ -266,55 +266,55 @@ tui_erase_source_content (struct tui_win_info * winInfo, int displayPrompt) /* Redraw the complete line of a source or disassembly window. */ static void -tui_show_source_line (struct tui_win_info * winInfo, int lineno) +tui_show_source_line (struct tui_win_info * win_info, int lineno) { struct tui_win_element * line; int x, y; - line = (struct tui_win_element *) winInfo->generic.content[lineno - 1]; - if (line->whichElement.source.isExecPoint) - wattron (winInfo->generic.handle, A_STANDOUT); + line = (struct tui_win_element *) win_info->generic.content[lineno - 1]; + if (line->which_element.source.is_exec_point) + wattron (win_info->generic.handle, A_STANDOUT); - mvwaddstr (winInfo->generic.handle, lineno, 1, - line->whichElement.source.line); - if (line->whichElement.source.isExecPoint) - wattroff (winInfo->generic.handle, A_STANDOUT); + mvwaddstr (win_info->generic.handle, lineno, 1, + line->which_element.source.line); + if (line->which_element.source.is_exec_point) + wattroff (win_info->generic.handle, A_STANDOUT); /* Clear to end of line but stop before the border. */ - getyx (winInfo->generic.handle, y, x); - while (x + 1 < winInfo->generic.width) + getyx (win_info->generic.handle, y, x); + while (x + 1 < win_info->generic.width) { - waddch (winInfo->generic.handle, ' '); - getyx (winInfo->generic.handle, y, x); + waddch (win_info->generic.handle, ' '); + getyx (win_info->generic.handle, y, x); } } void -tui_show_source_content (struct tui_win_info * winInfo) +tui_show_source_content (struct tui_win_info * win_info) { - if (winInfo->generic.contentSize > 0) + if (win_info->generic.content_size > 0) { int lineno; - for (lineno = 1; lineno <= winInfo->generic.contentSize; lineno++) - tui_show_source_line (winInfo, lineno); + for (lineno = 1; lineno <= win_info->generic.content_size; lineno++) + tui_show_source_line (win_info, lineno); } else - tui_erase_source_content (winInfo, TRUE); + tui_erase_source_content (win_info, TRUE); - tui_check_and_display_highlight_if_needed (winInfo); - tui_refresh_win (&winInfo->generic); - winInfo->generic.contentInUse = TRUE; + tui_check_and_display_highlight_if_needed (win_info); + tui_refresh_win (&win_info->generic); + win_info->generic.content_in_use = TRUE; } /* Scroll the source forward or backward horizontally. */ void -tui_horizontal_source_scroll (struct tui_win_info * winInfo, +tui_horizontal_source_scroll (struct tui_win_info * win_info, enum tui_scroll_direction direction, int numToScroll) { - if (winInfo->generic.content != NULL) + if (win_info->generic.content != NULL) { int offset; struct symtab *s; @@ -326,17 +326,17 @@ tui_horizontal_source_scroll (struct tui_win_info * winInfo, s = cursal.symtab; if (direction == LEFT_SCROLL) - offset = winInfo->detail.sourceInfo.horizontalOffset + numToScroll; + offset = win_info->detail.source_info.horizontal_offset + numToScroll; else { if ((offset = - winInfo->detail.sourceInfo.horizontalOffset - numToScroll) < 0) + win_info->detail.source_info.horizontal_offset - numToScroll) < 0) offset = 0; } - winInfo->detail.sourceInfo.horizontalOffset = offset; - tui_update_source_window_as_is (winInfo, s, + win_info->detail.source_info.horizontal_offset = offset; + tui_update_source_window_as_is (win_info, s, ((struct tui_win_element *) - winInfo->generic.content[0])->whichElement.source.lineOrAddr, + win_info->generic.content[0])->which_element.source.line_or_addr, FALSE); } @@ -344,33 +344,33 @@ tui_horizontal_source_scroll (struct tui_win_info * winInfo, } /* tuiHorizontalSourceScroll */ -/* Set or clear the hasBreak flag in the line whose line is lineNo. */ +/* Set or clear the has_break flag in the line whose line is line_no. */ void -tui_set_is_exec_point_at (union tui_line_or_address l, struct tui_win_info * winInfo) +tui_set_is_exec_point_at (union tui_line_or_address l, struct tui_win_info * win_info) { int changed = 0; int i; - tui_win_content content = (tui_win_content) winInfo->generic.content; + tui_win_content content = (tui_win_content) win_info->generic.content; i = 0; - while (i < winInfo->generic.contentSize) + while (i < win_info->generic.content_size) { int newState; - if (content[i]->whichElement.source.lineOrAddr.addr == l.addr) + if (content[i]->which_element.source.line_or_addr.addr == l.addr) newState = TRUE; else newState = FALSE; - if (newState != content[i]->whichElement.source.isExecPoint) + if (newState != content[i]->which_element.source.is_exec_point) { changed++; - content[i]->whichElement.source.isExecPoint = newState; - tui_show_source_line (winInfo, i + 1); + content[i]->which_element.source.is_exec_point = newState; + tui_show_source_line (win_info, i + 1); } i++; } if (changed) - tui_refresh_win (&winInfo->generic); + tui_refresh_win (&win_info->generic); } /* Update the execution windows to show the active breakpoints. @@ -395,7 +395,7 @@ tui_update_all_breakpoint_info () /* Scan the source window and the breakpoints to update the - hasBreak information for each line. + has_break information for each line. Returns 1 if something changed and the execution window must be refreshed. */ int @@ -403,17 +403,17 @@ tui_update_breakpoint_info (struct tui_win_info * win, int current_only) { int i; int need_refresh = 0; - struct tui_source_info * src = &win->detail.sourceInfo; + struct tui_source_info * src = &win->detail.source_info; - for (i = 0; i < win->generic.contentSize; i++) + for (i = 0; i < win->generic.content_size; i++) { struct breakpoint *bp; extern struct breakpoint *breakpoint_chain; int mode; struct tui_source_element* line; - line = &((struct tui_win_element *) win->generic.content[i])->whichElement.source; - if (current_only && !line->isExecPoint) + line = &((struct tui_win_element *) win->generic.content[i])->which_element.source; + if (current_only && !line->is_exec_point) continue; /* Scan each breakpoint to see if the current line has something to @@ -424,12 +424,12 @@ tui_update_breakpoint_info (struct tui_win_info * win, int current_only) bp != (struct breakpoint *) NULL; bp = bp->next) { - if ((win == srcWin + if ((win == TUI_SRC_WIN && bp->source_file && (strcmp (src->filename, bp->source_file) == 0) - && bp->line_number == line->lineOrAddr.lineNo) - || (win == disassemWin - && bp->loc->address == line->lineOrAddr.addr)) + && bp->line_number == line->line_or_addr.line_no) + || (win == TUI_DISASM_WIN + && bp->loc->address == line->line_or_addr.addr)) { if (bp->enable_state == bp_disabled) mode |= TUI_BP_DISABLED; @@ -443,9 +443,9 @@ tui_update_breakpoint_info (struct tui_win_info * win, int current_only) mode |= TUI_BP_HARDWARE; } } - if (line->hasBreak != mode) + if (line->has_break != mode) { - line->hasBreak = mode; + line->has_break = mode; need_refresh = 1; } } @@ -460,55 +460,55 @@ tui_update_breakpoint_info (struct tui_win_info * win, int current_only) ** disassembly window. */ enum tui_status -tuiSetExecInfoContent (struct tui_win_info * winInfo) +tuiSetExecInfoContent (struct tui_win_info * win_info) { enum tui_status ret = TUI_SUCCESS; - if (winInfo->detail.sourceInfo.executionInfo != (struct tui_gen_win_info *) NULL) + if (win_info->detail.source_info.execution_info != (struct tui_gen_win_info *) NULL) { - struct tui_gen_win_info * execInfoPtr = winInfo->detail.sourceInfo.executionInfo; + struct tui_gen_win_info * execInfoPtr = win_info->detail.source_info.execution_info; if (execInfoPtr->content == NULL) execInfoPtr->content = - (void **) tui_alloc_content (winInfo->generic.height, + (void **) tui_alloc_content (win_info->generic.height, execInfoPtr->type); if (execInfoPtr->content != NULL) { int i; - tui_update_breakpoint_info (winInfo, 1); - for (i = 0; i < winInfo->generic.contentSize; i++) + tui_update_breakpoint_info (win_info, 1); + for (i = 0; i < win_info->generic.content_size; i++) { struct tui_win_element * element; struct tui_win_element * srcElement; int mode; element = (struct tui_win_element *) execInfoPtr->content[i]; - srcElement = (struct tui_win_element *) winInfo->generic.content[i]; + srcElement = (struct tui_win_element *) win_info->generic.content[i]; - memset(element->whichElement.simpleString, ' ', - sizeof(element->whichElement.simpleString)); - element->whichElement.simpleString[TUI_EXECINFO_SIZE - 1] = 0; + memset(element->which_element.simple_string, ' ', + sizeof(element->which_element.simple_string)); + element->which_element.simple_string[TUI_EXECINFO_SIZE - 1] = 0; /* Now update the exec info content based upon the state of each line as indicated by the source content. */ - mode = srcElement->whichElement.source.hasBreak; + mode = srcElement->which_element.source.has_break; if (mode & TUI_BP_HIT) - element->whichElement.simpleString[TUI_BP_HIT_POS] = + element->which_element.simple_string[TUI_BP_HIT_POS] = (mode & TUI_BP_HARDWARE) ? 'H' : 'B'; else if (mode & (TUI_BP_ENABLED | TUI_BP_DISABLED)) - element->whichElement.simpleString[TUI_BP_HIT_POS] = + element->which_element.simple_string[TUI_BP_HIT_POS] = (mode & TUI_BP_HARDWARE) ? 'h' : 'b'; if (mode & TUI_BP_ENABLED) - element->whichElement.simpleString[TUI_BP_BREAK_POS] = '+'; + element->which_element.simple_string[TUI_BP_BREAK_POS] = '+'; else if (mode & TUI_BP_DISABLED) - element->whichElement.simpleString[TUI_BP_BREAK_POS] = '-'; + element->which_element.simple_string[TUI_BP_BREAK_POS] = '-'; - if (srcElement->whichElement.source.isExecPoint) - element->whichElement.simpleString[TUI_EXEC_POS] = '>'; + if (srcElement->which_element.source.is_exec_point) + element->which_element.simple_string[TUI_EXEC_POS] = '>'; } - execInfoPtr->contentSize = winInfo->generic.contentSize; + execInfoPtr->content_size = win_info->generic.content_size; } else ret = TUI_FAILURE; @@ -522,30 +522,30 @@ tuiSetExecInfoContent (struct tui_win_info * winInfo) ** tuiShowExecInfoContent(). */ void -tuiShowExecInfoContent (struct tui_win_info * winInfo) +tuiShowExecInfoContent (struct tui_win_info * win_info) { - struct tui_gen_win_info * execInfo = winInfo->detail.sourceInfo.executionInfo; + struct tui_gen_win_info * execInfo = win_info->detail.source_info.execution_info; int curLine; werase (execInfo->handle); tui_refresh_win (execInfo); - for (curLine = 1; (curLine <= execInfo->contentSize); curLine++) + for (curLine = 1; (curLine <= execInfo->content_size); curLine++) mvwaddstr (execInfo->handle, curLine, 0, ((struct tui_win_element *) - execInfo->content[curLine - 1])->whichElement.simpleString); + execInfo->content[curLine - 1])->which_element.simple_string); tui_refresh_win (execInfo); - execInfo->contentInUse = TRUE; + execInfo->content_in_use = TRUE; return; } void -tui_erase_exec_info_content (struct tui_win_info * winInfo) +tui_erase_exec_info_content (struct tui_win_info * win_info) { - struct tui_gen_win_info * execInfo = winInfo->detail.sourceInfo.executionInfo; + struct tui_gen_win_info * execInfo = win_info->detail.source_info.execution_info; werase (execInfo->handle); tui_refresh_win (execInfo); @@ -554,37 +554,37 @@ tui_erase_exec_info_content (struct tui_win_info * winInfo) } void -tui_clear_exec_info_content (struct tui_win_info * winInfo) +tui_clear_exec_info_content (struct tui_win_info * win_info) { - winInfo->detail.sourceInfo.executionInfo->contentInUse = FALSE; - tui_erase_exec_info_content (winInfo); + win_info->detail.source_info.execution_info->content_in_use = FALSE; + tui_erase_exec_info_content (win_info); return; } /* Function to update the execution info window. */ void -tui_update_exec_info (struct tui_win_info * winInfo) +tui_update_exec_info (struct tui_win_info * win_info) { - tuiSetExecInfoContent (winInfo); - tuiShowExecInfoContent (winInfo); + tuiSetExecInfoContent (win_info); + tuiShowExecInfoContent (win_info); } /* tuiUpdateExecInfo */ enum tui_status -tui_alloc_source_buffer (struct tui_win_info *winInfo) +tui_alloc_source_buffer (struct tui_win_info *win_info) { register char *srcLineBuf; register int i, lineWidth, maxLines; enum tui_status ret = TUI_FAILURE; - maxLines = winInfo->generic.height; /* less the highlight box */ - lineWidth = winInfo->generic.width - 1; + maxLines = win_info->generic.height; /* less the highlight box */ + lineWidth = 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 ** be done is when a window's size changes. */ - if (winInfo->generic.content == NULL) + if (win_info->generic.content == NULL) { srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char)); if (srcLineBuf == (char *) NULL) @@ -594,7 +594,7 @@ tui_alloc_source_buffer (struct tui_win_info *winInfo) else { /* allocate the content list */ - if ((winInfo->generic.content = + if ((win_info->generic.content = (void **) tui_alloc_content (maxLines, SRC_WIN)) == NULL) { xfree (srcLineBuf); @@ -606,7 +606,7 @@ tui_alloc_source_buffer (struct tui_win_info *winInfo) } for (i = 0; i < maxLines; i++) ((struct tui_win_element *) - winInfo->generic.content[i])->whichElement.source.line = + win_info->generic.content[i])->which_element.source.line = srcLineBuf + (lineWidth * i); ret = TUI_SUCCESS; } @@ -620,7 +620,7 @@ tui_alloc_source_buffer (struct tui_win_info *winInfo) /* 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 * winInfo, +tui_line_is_displayed (int line, struct tui_win_info * win_info, int checkThreshold) { int isDisplayed = FALSE; @@ -631,10 +631,10 @@ tui_line_is_displayed (int line, struct tui_win_info * winInfo, else threshold = 0; i = 0; - while (i < winInfo->generic.contentSize - threshold && !isDisplayed) + while (i < win_info->generic.content_size - threshold && !isDisplayed) { isDisplayed = (((struct tui_win_element *) - winInfo->generic.content[i])->whichElement.source.lineOrAddr.lineNo + win_info->generic.content[i])->which_element.source.line_or_addr.line_no == (int) line); i++; } @@ -646,7 +646,7 @@ tui_line_is_displayed (int line, struct tui_win_info * winInfo, /* Answer whether the a particular line number or address is displayed in the current source window. */ int -tui_addr_is_displayed (CORE_ADDR addr, struct tui_win_info * winInfo, +tui_addr_is_displayed (CORE_ADDR addr, struct tui_win_info * win_info, int checkThreshold) { int isDisplayed = FALSE; @@ -657,10 +657,10 @@ tui_addr_is_displayed (CORE_ADDR addr, struct tui_win_info * winInfo, else threshold = 0; i = 0; - while (i < winInfo->generic.contentSize - threshold && !isDisplayed) + while (i < win_info->generic.content_size - threshold && !isDisplayed) { isDisplayed = (((struct tui_win_element *) - winInfo->generic.content[i])->whichElement.source.lineOrAddr.addr + win_info->generic.content[i])->which_element.source.line_or_addr.addr == addr); i++; } diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 49a9937..0e413d4 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -66,7 +66,7 @@ int tui_active = 0; static int tui_finish_init = 1; -enum tui_key_mode tui_current_key_mode = tui_command_mode; +enum tui_key_mode tui_current_key_mode = TUI_COMMAND_MODE; struct tui_char_command { @@ -224,9 +224,9 @@ tui_rl_other_window (int count, int key) if (winInfo) { tui_set_win_focus_to (winInfo); - if (dataWin && dataWin->generic.isVisible) + if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible) tui_refresh_data_win (); - keypad (cmdWin->generic.handle, (winInfo != cmdWin)); + keypad (TUI_CMD_WIN->generic.handle, (winInfo != TUI_CMD_WIN)); } return 0; } @@ -261,7 +261,7 @@ tui_rl_command_key (int count, int key) static int tui_rl_command_mode (int count, int key) { - tui_set_key_mode (tui_one_command_mode); + tui_set_key_mode (TUI_ONE_COMMAND_MODE); return rl_insert (count, key); } @@ -273,8 +273,8 @@ tui_rl_next_keymap (int notused1, int notused2) if (!tui_active) tui_rl_switch_mode (0/*notused*/, 0/*notused*/); - tui_set_key_mode (tui_current_key_mode == tui_command_mode - ? tui_single_key_mode : tui_command_mode); + tui_set_key_mode (tui_current_key_mode == TUI_COMMAND_MODE + ? TUI_SINGLE_KEY_MODE : TUI_COMMAND_MODE); return 0; } @@ -286,8 +286,8 @@ static int tui_rl_startup_hook () { rl_already_prompted = 1; - if (tui_current_key_mode != tui_command_mode) - tui_set_key_mode (tui_single_key_mode); + if (tui_current_key_mode != TUI_COMMAND_MODE) + tui_set_key_mode (TUI_SINGLE_KEY_MODE); tui_redisplay_readline (); return 0; } @@ -297,7 +297,7 @@ void tui_set_key_mode (enum tui_key_mode mode) { tui_current_key_mode = mode; - rl_set_keymap (mode == tui_single_key_mode + rl_set_keymap (mode == TUI_SINGLE_KEY_MODE ? tui_keymap : tui_readline_standard_keymap); tui_show_locator_content (); } @@ -390,9 +390,9 @@ tui_enable (void) tui_show_frame_info (0); tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS); - tui_set_win_focus_to (srcWin); - keypad (cmdWin->generic.handle, TRUE); - wrefresh (cmdWin->generic.handle); + tui_set_win_focus_to (TUI_SRC_WIN); + keypad (TUI_CMD_WIN->generic.handle, TRUE); + wrefresh (TUI_CMD_WIN->generic.handle); tui_finish_init = 0; } else @@ -571,21 +571,21 @@ tui_is_window_visible (enum tui_win_type type) if (tui_active == 0) return 0; - if (winList[type] == 0) + if (tui_win_list[type] == 0) return 0; - return winList[type]->generic.isVisible; + return tui_win_list[type]->generic.is_visible; } int tui_get_command_dimension (int *width, int *height) { - if (!tui_active || !m_winPtrNotNull (cmdWin)) + if (!tui_active || (TUI_CMD_WIN == NULL)) { return 0; } - *width = cmdWin->generic.width; - *height = cmdWin->generic.height; + *width = TUI_CMD_WIN->generic.width; + *height = TUI_CMD_WIN->generic.height; return 1; } diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h index d6221b7..9ba1a35 100644 --- a/gdb/tui/tui.h +++ b/gdb/tui/tui.h @@ -25,17 +25,6 @@ #ifndef TUI_H #define TUI_H -#include <stdarg.h> -#include <string.h> -#include "ansidecl.h" - -#if defined(reg) -#undef reg -#endif -#if defined(chtype) -#undef chtype -#endif - struct ui_file; extern void strcat_to_buf (char *, int, const char *); @@ -91,13 +80,13 @@ extern void tui_disable (void); enum tui_key_mode { /* Plain command mode to enter gdb commands. */ - tui_command_mode, + TUI_COMMAND_MODE, /* SingleKey mode with some keys bound to gdb commands. */ - tui_single_key_mode, + TUI_SINGLE_KEY_MODE, /* Read/edit one command and return to SingleKey after it's processed. */ - tui_one_command_mode + TUI_ONE_COMMAND_MODE }; extern enum tui_key_mode tui_current_key_mode; @@ -124,4 +113,5 @@ extern enum tui_status tui_set_layout_for_display_command (const char *name); /* tui-winsource.c */ extern void tui_update_all_exec_infos (void); -#endif /* TUI_H */ +#endif + |