aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-command.c7
-rw-r--r--gdb/tui/tui-data.c30
-rw-r--r--gdb/tui/tui-disasm.c15
-rw-r--r--gdb/tui/tui-layout.c79
-rw-r--r--gdb/tui/tui-regs.c24
-rw-r--r--gdb/tui/tui-win.c122
-rw-r--r--gdb/tui/tui-windata.c33
-rw-r--r--gdb/tui/tui-winsource.c6
-rw-r--r--gdb/tui/tui.c6
9 files changed, 133 insertions, 189 deletions
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index 5a776fa..5c58b11 100644
--- a/gdb/tui/tui-command.c
+++ b/gdb/tui/tui-command.c
@@ -65,10 +65,9 @@ tui_dispatch_ctrl_char (unsigned int ch)
int i;
char *term;
- /* If this is an xterm, page next/prev keys aren't returned
- ** by keypad as a single char, so we must handle them here.
- ** Seems like a bug in the curses library?
- */
+ /* If this is an xterm, page next/prev keys aren't returned by
+ keypad as a single char, so we must handle them here. Seems
+ like a bug in the curses library? */
term = (char *) getenv ("TERM");
if (term)
{
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 8da696c..9f4344d 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -474,8 +474,7 @@ tui_init_generic_part (struct tui_gen_win_info *win)
}
-/*
- ** init_content_element().
+/* init_content_element().
*/
void
init_content_element (struct tui_win_element *element, enum tui_win_type type)
@@ -814,11 +813,9 @@ tui_del_data_windows (tui_win_content content, int content_size)
{
int i;
- /*
- ** Remember that data window content elements are of type
- ** struct tui_gen_win_info *, each of which whose single
- ** element is a data element.
- */
+ /* Remember that data window content elements are of type struct
+ tui_gen_win_info *, each of which whose single element is a data
+ element. */
for (i = 0; i < content_size; i++)
{
struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window;
@@ -838,11 +835,9 @@ tui_free_data_content (tui_win_content content, int content_size)
{
int i;
- /*
- ** Remember that data window content elements are of type
- ** struct tui_gen_win_info *, each of which whose single
- ** element is a data element.
- */
+ /* Remember that data window content elements are of type struct
+ tui_gen_win_info *, each of which whose single element is a data
+ element. */
for (i = 0; i < content_size; i++)
{
struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window;
@@ -876,8 +871,7 @@ free_content (tui_win_content content, int content_size, enum tui_win_type win_t
}
-/*
- ** free_content_elements().
+/* free_content_elements().
*/
static void
free_content_elements (tui_win_content content, int content_size, enum tui_win_type type)
@@ -906,11 +900,9 @@ free_content_elements (tui_win_content content, int content_size, enum tui_win_t
xfree (element);
break;
case DATA_ITEM_WIN:
- /*
- ** Note that data elements are not allocated
- ** in a single block, but individually, as
- ** needed.
- */
+ /* Note that data elements are not allocated in
+ a single block, but individually, as
+ needed. */
if (element->which_element.data.type != TUI_REGISTER)
xfree ((void *)element->which_element.data.name);
xfree (element->which_element.data.value);
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 42975b8..8b5e17c 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -279,10 +279,9 @@ tui_show_disassem (CORE_ADDR start_addr)
val.u.addr = start_addr;
tui_add_win_to_layout (DISASSEM_WIN);
tui_update_source_window (TUI_DISASM_WIN, s, val, FALSE);
- /*
- ** If the focus was in the src win, put it in the asm win, if
- ** the source view isn't split.
- */
+
+ /* If 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 && win_with_focus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN);
@@ -301,11 +300,9 @@ tui_show_disassem_and_update_source (CORE_ADDR start_addr)
{
struct tui_line_or_address val;
- /*
- ** Update what is in the source window if it is displayed too,
- ** note that it follows what is in the disassembly window and
- ** visa-versa.
- */
+ /* Update what is in the source window if it is displayed too,
+ note that it follows what is in the disassembly window and
+ visa-versa. */
sal = find_pc_line (start_addr, 0);
val.loa = LOA_LINE;
val.u.line_no = sal.line;
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index d7cf31b..29d5869 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -81,11 +81,9 @@ show_layout (enum tui_layout_type layout)
if (layout != cur_layout)
{
- /*
- ** Since the new layout may cause changes in window size, we
- ** should free the content and reallocate on next display of
- ** source/asm.
- */
+ /* Since the new layout may cause changes in window size, we
+ should free the content and reallocate on next display of
+ source/asm. */
tui_free_all_source_wins_content ();
tui_clear_source_windows ();
if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND)
@@ -165,9 +163,8 @@ tui_set_layout (enum tui_layout_type layout_type,
if (new_layout != cur_layout)
{
show_layout (new_layout);
- /*
- ** Now determine where focus should be.
- */
+
+ /* Now determine where focus should be. */
if (win_with_focus != TUI_CMD_WIN)
{
switch (new_layout)
@@ -178,26 +175,28 @@ tui_set_layout (enum tui_layout_type layout_type,
layout_def->split = FALSE;
break;
case DISASSEM_COMMAND:
- /* The previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
+ /* The previous layout was not showing code.
+ This can happen if there is no source
+ available:
+
+ 1. if the source file is in another dir OR
+ 2. if target was compiled without -g
+ We still want to show the assembly though! */
+
addr = tui_get_begin_asm_address ();
tui_set_win_focus_to (TUI_DISASM_WIN);
layout_def->display_mode = DISASSEM_WIN;
layout_def->split = FALSE;
break;
case SRC_DISASSEM_COMMAND:
- /* The previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
+ /* The previous layout was not showing code.
+ This can happen if there is no source
+ available:
+
+ 1. if the source file is in another dir OR
+ 2. if target was compiled without -g
+ We still want to show the assembly though! */
+
addr = tui_get_begin_asm_address ();
if (win_with_focus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_SRC_WIN);
@@ -214,13 +213,14 @@ tui_set_layout (enum tui_layout_type layout_type,
layout_def->split = FALSE;
break;
case DISASSEM_DATA_COMMAND:
- /* The previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
+ /* The previous layout was not showing code.
+ This can happen if there is no source
+ available:
+
+ 1. if the source file is in another dir OR
+ 2. if target was compiled without -g
+ We still want to show the assembly though! */
+
addr = tui_get_begin_asm_address ();
if (win_with_focus != TUI_DATA_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN);
@@ -648,8 +648,7 @@ make_command_window (struct tui_win_info **win_info_ptr, int height, int origin_
}
-/*
- ** make_source_window().
+/* make_source_window().
*/
static void
make_source_window (struct tui_win_info **win_info_ptr, int height, int origin_y)
@@ -660,8 +659,7 @@ make_source_window (struct tui_win_info **win_info_ptr, int height, int origin_y
} /* make_source_window */
-/*
- ** make_disasm_window().
+/* make_disasm_window().
*/
static void
make_disasm_window (struct tui_win_info **win_info_ptr, int height, int origin_y)
@@ -878,8 +876,7 @@ show_data (enum tui_layout_type new_layout)
tui_set_current_layout_to (new_layout);
}
-/*
- ** init_gen_win_info().
+/* init_gen_win_info().
*/
static void
init_gen_win_info (struct tui_gen_win_info *win_info, enum tui_win_type type,
@@ -904,8 +901,7 @@ init_gen_win_info (struct tui_gen_win_info *win_info, enum tui_win_type type,
return;
} /* init_gen_win_info */
-/*
- ** init_and_make_win().
+/* init_and_make_win().
*/
static void *
init_and_make_win (void *opaque_win_info, enum tui_win_type win_type,
@@ -948,9 +944,7 @@ make_source_or_disasm_window (struct tui_win_info **win_info_ptr, enum tui_win_t
{
struct tui_gen_win_info *execution_info = (struct tui_gen_win_info *) NULL;
- /*
- ** Create the exeuction info window.
- */
+ /* Create the exeuction info window. */
if (type == SRC_WIN)
execution_info = tui_source_exec_info_win_ptr ();
else
@@ -962,9 +956,8 @@ make_source_or_disasm_window (struct tui_win_info **win_info_ptr, enum tui_win_t
0,
origin_y,
DONT_BOX_WINDOW);
- /*
- ** Now create the source window.
- */
+
+ /* Now create the source window. */
*win_info_ptr = init_and_make_win (*win_info_ptr,
type,
height,
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index e7056c3..00ef3c1 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -354,10 +354,8 @@ tui_display_registers_from (int start_element_no)
item_win_width =
(TUI_DATA_WIN->generic.width - 2) / display_info->regs_column_count;
- /*
- ** Now create each data "sub" window, and write the display
- ** into it.
- */
+ /* Now create each data "sub" window, and write the display into
+ it. */
cur_y = 1;
while (i < display_info->regs_content_count &&
cur_y <= TUI_DATA_WIN->generic.viewport_height)
@@ -426,12 +424,11 @@ tui_display_reg_element_at_line (int start_element_no, int start_line_no)
first_line_on_last_page = last_line_no - (TUI_DATA_WIN->generic.height - 2);
if (first_line_on_last_page < 0)
first_line_on_last_page = 0;
- /*
- ** If there is no other data displayed except registers,
- ** and the element_no causes us to scroll past the end of
- ** the registers, adjust what element to really start the
- ** display at.
- */
+
+ /* If there is no other data displayed except registers, and
+ the element_no causes us to scroll past the end of the
+ registers, adjust what element to really start the
+ display at. */
if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0 &&
start_line_no > first_line_on_last_page)
element_no = tui_first_reg_element_no_inline (first_line_on_last_page);
@@ -455,10 +452,9 @@ tui_display_registers_from_line (int line_no, int force_display)
if (line_no < 0)
line = 0;
else if (force_display)
- { /*
- ** If we must display regs (force_display is true), then make
- ** sure that we don't display off the end of the registers.
- */
+ { /* If we must display regs (force_display is true), then
+ make sure that we don't display off the end of the
+ registers. */
if (line_no >= tui_last_regs_line_no ())
{
if ((line = tui_line_from_reg_element_no (
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 7022400..3a77457 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -488,12 +488,12 @@ tui_scroll_forward (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (num_to_scroll == 0)
_num_to_scroll = win_to_scroll->generic.height - 3;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the
+ command window do nothing since the term should handle
+ it. */
if (win_to_scroll == TUI_SRC_WIN)
tui_vertical_source_scroll (FORWARD_SCROLL, _num_to_scroll);
else if (win_to_scroll == TUI_DISASM_WIN)
@@ -512,12 +512,12 @@ tui_scroll_backward (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (num_to_scroll == 0)
_num_to_scroll = win_to_scroll->generic.height - 3;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the
+ command window do nothing since the term should handle
+ it. */
if (win_to_scroll == TUI_SRC_WIN)
tui_vertical_source_scroll (BACKWARD_SCROLL, _num_to_scroll);
else if (win_to_scroll == TUI_DISASM_WIN)
@@ -537,12 +537,11 @@ tui_scroll_left (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (_num_to_scroll == 0)
_num_to_scroll = 1;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the command
+ window do nothing since the term should handle it. */
if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN)
tui_horizontal_source_scroll (win_to_scroll, LEFT_SCROLL, _num_to_scroll);
}
@@ -558,12 +557,11 @@ tui_scroll_right (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (_num_to_scroll == 0)
_num_to_scroll = 1;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the command
+ window do nothing since the term should handle it. */
if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN)
tui_horizontal_source_scroll (win_to_scroll, RIGHT_SCROLL, _num_to_scroll);
}
@@ -766,10 +764,8 @@ tui_resize_all (void)
tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
break;
}
- /*
- ** Now remove all invisible windows, and their content so that
- ** they get created again when called for with the new size.
- */
+ /* Now remove all invisible windows, and their content so that
+ they get created again when called for with the new size. */
for (win_type = SRC_WIN; (win_type < MAX_MAJOR_WINDOWS); win_type++)
{
if (win_type != CMD_WIN && (tui_win_list[win_type] != NULL)
@@ -794,10 +790,8 @@ tui_resize_all (void)
void
tui_sigwinch_handler (int signal)
{
- /*
- ** Say that a resize was done so that the readline can do it
- ** later when appropriate.
- */
+ /* Say that a resize was done so that the readline can do it later
+ when appropriate. */
tui_set_win_resized_to (TRUE);
}
@@ -984,9 +978,7 @@ tui_set_win_height (char *arg, int from_tty)
{
*buf_ptr = (char) 0;
- /*
- ** Validate the window name.
- */
+ /* Validate the window name. */
for (i = 0; i < strlen (wname); i++)
wname[i] = toupper (wname[i]);
win_info = tui_partial_win_by_name (wname);
@@ -1022,10 +1014,9 @@ The window name specified must be valid and visible.\n"));
new_height = input_no;
else
new_height = win_info->generic.height + input_no;
- /*
- ** Now change the window's height, and adjust all
- ** other windows around it.
- */
+
+ /* Now change the window's height, and adjust
+ all other windows around it. */
if (tui_adjust_win_heights (win_info,
new_height) == TUI_FAILURE)
warning (_("Invalid window height specified.\n%s"),
@@ -1153,11 +1144,10 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info, int new_height)
second_win = (tui_source_windows ())->list[0];
}
if (primary_win_info == TUI_CMD_WIN)
- { /*
- ** Split the change in height accross the 1st & 2nd
- ** windows, adjusting them as well.
- */
- int first_split_diff = diff / 2; /* Subtract the locator. */
+ { /* Split the change in height accross the 1st & 2nd
+ windows, adjusting them as well. */
+ /* Subtract the locator. */
+ int first_split_diff = diff / 2;
int second_split_diff = first_split_diff;
if (diff % 2)
@@ -1200,10 +1190,9 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info, int new_height)
else
{
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 there is no way to increase the command
+ window take real estate from the 1st or 2nd
+ window. */
if ((TUI_CMD_WIN->generic.height + diff) < 1)
{
int i;
@@ -1420,12 +1409,10 @@ new_height_ok (struct tui_win_info *primary_win_info, int new_height)
first_win = TUI_DATA_WIN;
second_win = (tui_source_windows ())->list[0];
}
- /*
- ** We could simply add all the heights to obtain the same result
- ** but below is more explicit since we subtract 1 for the
- ** line that the first and second windows share, and add one
- ** for the locator.
- */
+ /* We could simply add all the heights to obtain the same
+ result but below is more explicit since we subtract 1 for
+ the line that the first and second windows share, and add
+ one for the locator. */
total_height = cur_total_height =
(first_win->generic.height + second_win->generic.height - 1)
+ TUI_CMD_WIN->generic.height + 1; /* Locator. */
@@ -1446,17 +1433,14 @@ new_height_ok (struct tui_win_info *primary_win_info, int new_height)
else
{
min_height = MIN_WIN_HEIGHT;
- /*
- ** First see if we can increase/decrease the command
- ** window. And make sure that the command window is
- ** at least 1 line.
- */
+
+ /* First see if we can increase/decrease the command
+ window. And make sure that the command window is at
+ least 1 line. */
ok = ((TUI_CMD_WIN->generic.height + diff) > 0);
if (!ok)
- { /*
- ** Looks like we have to increase/decrease one of
- ** the other windows.
- */
+ { /* Looks like we have to increase/decrease one of
+ the other windows. */
if (primary_win_info == first_win)
ok = (second_win->generic.height + diff) >= min_height;
else
@@ -1474,10 +1458,8 @@ new_height_ok (struct tui_win_info *primary_win_info, int new_height)
TUI_CMD_WIN->generic.height + diff;
}
}
- /*
- ** Now make sure that the proposed total height doesn't exceed
- ** the old total height.
- */
+ /* Now make sure that the proposed total height doesn't
+ exceed the old total height. */
if (ok)
ok = (new_height >= min_height && total_height <= cur_total_height);
}
@@ -1495,10 +1477,8 @@ parse_scrolling_args (char *arg, struct tui_win_info **win_to_scroll,
*num_to_scroll = 0;
*win_to_scroll = tui_win_with_focus ();
- /*
- ** First set up the default window to scroll, in case there is no
- ** window name arg.
- */
+ /* First set up the default window to scroll, in case there is no
+ window name arg. */
if (arg != (char *) NULL)
{
char *buf, *buf_ptr;
diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c
index f5ffb4b..f51f2ce 100644
--- a/gdb/tui/tui-windata.c
+++ b/gdb/tui/tui-windata.c
@@ -72,14 +72,10 @@ tui_first_data_element_no_in_line (int line_no)
{
int first_element_no = (-1);
- /*
- ** First see if there is a register on line_no, and if so, set the
- ** first element number.
- */
+ /* First see if there is a register on line_no, and if so, set the
+ first element number. */
if ((first_element_no = tui_first_reg_element_no_inline (line_no)) == -1)
- { /*
- ** Looking at the general data, the 1st element on line_no.
- */
+ { /* Looking at the general data, the 1st element on line_no. */
}
return first_element_no;
@@ -141,9 +137,8 @@ tui_display_all_data (void)
tui_delete_data_content_windows ();
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
tui_display_registers_from (0);
- /*
- ** Then display the other data.
- */
+
+ /* Then display the other data. */
if (TUI_DATA_WIN->detail.data_display_info.data_content !=
(tui_win_content) NULL &&
TUI_DATA_WIN->detail.data_display_info.data_content_count > 0)
@@ -177,21 +172,17 @@ tui_display_data_from_line (int line_no)
/* Display regs if we can. */
if (tui_display_registers_from_line (_line_no, FALSE) < 0)
- { /*
- ** _line_no is past the regs display, so calc where the
- ** start data element is.
- */
+ { /* _line_no is past the regs display, so calc where the
+ start data element is. */
if (regs_last_line < _line_no)
- { /* Figure out how many lines each element is to obtain
- the start element_no. */
+ { /* Figure out how many lines each element is to obtain
+ the start element_no. */
}
}
else
- { /*
- ** Calculate the starting element of the data display,
- ** given regs_last_line and how many lines each element
- ** is, up to _line_no.
- */
+ { /* Calculate the starting element of the data display, given
+ regs_last_line and how many lines each element is, up to
+ _line_no. */
}
/* Now display the data , starting at element_no. */
}
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 66fd901..d4f77f0 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -112,10 +112,8 @@ tui_update_source_window_as_is (struct tui_win_info *win_info, struct symtab *s,
(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 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 () == TUI_DISASM_WIN &&
tui_current_layout () != SRC_DISASSEM_COMMAND)
tui_set_win_focus_to (TUI_SRC_WIN);
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 0a13148..d36ee66 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -483,10 +483,8 @@ tui_reset (void)
{
struct termio mode;
- /*
- ** Reset the teletype mode bits to a sensible state.
- ** Copied tset.c
- */
+ /* Reset the teletype mode bits to a sensible state.
+ Copied tset.c. */
#if defined (TIOCGETC)
struct tchars tbuf;
#endif /* TIOCGETC */