diff options
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-disasm.c | 20 | ||||
-rw-r--r-- | gdb/tui/tui-io.c | 42 | ||||
-rw-r--r-- | gdb/tui/tui-regs.c | 6 | ||||
-rw-r--r-- | gdb/tui/tui-stack.c | 52 | ||||
-rw-r--r-- | gdb/tui/tui-win.c | 6 | ||||
-rw-r--r-- | gdb/tui/tui-winsource.c | 30 | ||||
-rw-r--r-- | gdb/tui/tui.c | 40 |
7 files changed, 98 insertions, 98 deletions
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 0b7980ee80b..44a49041f81 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -278,22 +278,22 @@ tui_find_disassembly_address (struct gdbarch *gdbarch, CORE_ADDR pc, int from) } /* Scan forward disassembling one instruction at a time until - the last visible instruction of the window matches the pc. - We keep the disassembled instructions in the 'lines' window - and shift it downward (increasing its addresses). */ + the last visible instruction of the window matches the pc. + We keep the disassembled instructions in the 'lines' window + and shift it downward (increasing its addresses). */ int pos = max_lines - 1; if (last_addr < pc) - do - { - pos++; - if (pos >= max_lines) - pos = 0; + do + { + pos++; + if (pos >= max_lines) + pos = 0; CORE_ADDR old_next_addr = next_addr; std::vector<tui_asm_line> single_asm_line; next_addr = tui_disassemble (gdbarch, single_asm_line, next_addr, 1); - /* If there are some problems while disassembling exit. */ + /* If there are some problems while disassembling exit. */ if (next_addr <= old_next_addr) return pc; gdb_assert (single_asm_line.size () == 1); @@ -301,7 +301,7 @@ tui_find_disassembly_address (struct gdbarch *gdbarch, CORE_ADDR pc, int from) } while (next_addr <= pc); pos++; if (pos >= max_lines) - pos = 0; + pos = 0; new_low = asm_lines[pos].addr; /* When scrolling backward the addresses should move backward, or at diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index a4f93178416..01e104488ca 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -590,17 +590,17 @@ tui_redisplay_readline (void) if (in == rl_point) { - getyx (w, c_line, c_pos); + getyx (w, c_line, c_pos); } if (in == rl_end) - break; + break; c = (unsigned char) rl_line_buffer[in]; if (CTRL_CHAR (c) || c == RUBOUT) { - waddch (w, '^'); - waddch (w, CTRL_CHAR (c) ? UNCTRL (c) : '?'); + waddch (w, '^'); + waddch (w, CTRL_CHAR (c) ? UNCTRL (c) : '?'); } else if (c == '\t') { @@ -614,13 +614,13 @@ tui_redisplay_readline (void) } else { - waddch (w, c); + waddch (w, c); } if (c == '\n') TUI_CMD_WIN->start_line = getcury (w); col = getcurx (w); if (col < prev_col) - height++; + height++; prev_col = col; } wclrtobot (w); @@ -875,7 +875,7 @@ tui_cont_sig (int sig) if (tui_active) { /* Restore the terminal setting because another process (shell) - might have changed it. */ + might have changed it. */ resetty (); /* Force a refresh of the screen. */ @@ -982,7 +982,7 @@ tui_dispatch_ctrl_char (unsigned int ch) break; default: /* We didn't recognize the character as a control character, so pass it - through. */ + through. */ return ch; } @@ -1015,22 +1015,22 @@ tui_getc_1 (FILE *fp) if (ch == '\n' || ch == '\r') { /* When hitting return with an empty input, gdb executes the last - command. If we emit a newline, this fills up the command window - with empty lines with gdb prompt at beginning. Instead of that, - stay on the same line but provide a visual effect to show the - user we recognized the command. */ + command. If we emit a newline, this fills up the command window + with empty lines with gdb prompt at beginning. Instead of that, + stay on the same line but provide a visual effect to show the + user we recognized the command. */ if (rl_end == 0 && !gdb_in_secondary_prompt_p (current_ui)) - { + { wmove (w, getcury (w), 0); - /* Clear the line. This will blink the gdb prompt since - it will be redrawn at the same line. */ - wclrtoeol (w); - wrefresh (w); - napms (20); - } + /* Clear the line. This will blink the gdb prompt since + it will be redrawn at the same line. */ + wclrtoeol (w); + wrefresh (w); + napms (20); + } else - { + { /* Move cursor to the end of the command line before emitting the newline. We need to do so because when ncurses outputs a newline it truncates any text that appears past the end of the cursor. */ @@ -1041,7 +1041,7 @@ tui_getc_1 (FILE *fp) px %= TUI_CMD_WIN->width; wmove (w, py, px); tui_putc ('\n'); - } + } } /* Handle prev/next/up/down here. */ diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 4ba81b6f112..a3db2ef30e0 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -112,7 +112,7 @@ tui_register_format (struct frame_info *frame, int regnum) changed with respect to the previous call. */ static void tui_get_register (struct frame_info *frame, - struct tui_data_item_window *data, + struct tui_data_item_window *data, int regnum, bool *changedp) { if (changedp) @@ -436,7 +436,7 @@ tui_data_window::do_scroll_vertical (int num_to_scroll) first_line = line_from_reg_element_no (first_element_no); else { /* Calculate the first line from the element number which is in - the general data content. */ + the general data content. */ } if (first_line >= 0) @@ -514,7 +514,7 @@ tui_reg_next (struct reggroup *current_group, struct gdbarch *gdbarch) { group = reggroup_next (gdbarch, current_group); if (group == NULL) - group = reggroup_next (gdbarch, NULL); + group = reggroup_next (gdbarch, NULL); } return group; } diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 8bd7880f89a..5d3aaf99854 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -116,14 +116,14 @@ tui_locator_window::make_status_line () const The +1 are for a space separator between fields. The -1 are to take into account the \0 counted by sizeof. */ proc_width = (status_size - - (target_width + 1) - - (pid_width + 1) - - (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 - ? (sizeof (SINGLE_KEY) - 1 + 1) - : 0)); + - (target_width + 1) + - (pid_width + 1) + - (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 + ? (sizeof (SINGLE_KEY) - 1 + 1) + : 0)); /* If there is no room to print the function name, try by removing some fields. */ @@ -132,22 +132,22 @@ tui_locator_window::make_status_line () const proc_width += target_width + 1; target_width = 0; if (proc_width < MIN_PROC_WIDTH) - { - proc_width += pid_width + 1; - pid_width = 0; - if (proc_width <= MIN_PROC_WIDTH) - { - proc_width += pc_width + sizeof (PC_PREFIX) - 1 + 1; - pc_width = 0; - if (proc_width < 0) - { - proc_width += line_width + sizeof (LINE_PREFIX) - 1 + 1; - line_width = 0; - if (proc_width < 0) - proc_width = 0; - } - } - } + { + proc_width += pid_width + 1; + pid_width = 0; + if (proc_width <= MIN_PROC_WIDTH) + { + proc_width += pc_width + sizeof (PC_PREFIX) - 1 + 1; + pc_width = 0; + if (proc_width < 0) + { + proc_width += line_width + sizeof (LINE_PREFIX) - 1 + 1; + line_width = 0; + if (proc_width < 0) + proc_width = 0; + } + } + } } /* Now create the locator line from the string version of the @@ -170,10 +170,10 @@ tui_locator_window::make_status_line () const if (proc_width > 0) { if (proc_name.size () > proc_width) - string.printf ("%s%*.*s* ", PROC_PREFIX, + string.printf ("%s%*.*s* ", PROC_PREFIX, 1 - proc_width, proc_width - 1, proc_name.c_str ()); else - string.printf ("%s%*.*s ", PROC_PREFIX, + string.printf ("%s%*.*s ", PROC_PREFIX, -proc_width, proc_width, proc_name.c_str ()); } diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 86c0fdba2bc..b83c3e61467 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -240,7 +240,7 @@ translate (const char *name, struct tui_translate *table) while (table->name) { if (name && strcmp (table->name, name) == 0) - return table; + return table; table++; } @@ -511,7 +511,7 @@ tui_resize_all (void) tui_set_term_width_to (screenwidth); /* erase + clearok are used instead of a straightforward clear as - AIX 5.3 does not define clear. */ + AIX 5.3 does not define clear. */ erase (); clearok (curscr, TRUE); tui_apply_current_layout (); @@ -1004,7 +1004,7 @@ _initialize_tui_win () 0 /* allow-unknown */, &showlist); add_com ("refresh", class_tui, tui_refresh_all_command, - _("Refresh the terminal display.")); + _("Refresh the terminal display.")); cmd = add_com ("tabset", class_tui, tui_set_tab_width_command, _("\ Set the width (in characters) of tab stops.\n\ diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 957d9310f7a..b371e624593 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -400,15 +400,15 @@ tui_source_window_base::set_is_exec_point_at (struct tui_line_or_address l) if (content_loa.loa == l.loa && ((l.loa == LOA_LINE && content_loa.u.line_no == l.u.line_no) - || (l.loa == LOA_ADDRESS && content_loa.u.addr == l.u.addr))) - new_state = true; + || (l.loa == LOA_ADDRESS && content_loa.u.addr == l.u.addr))) + new_state = true; else new_state = false; if (new_state != m_content[i].is_exec_point) - { - changed = true; - m_content[i].is_exec_point = new_state; - } + { + changed = true; + m_content[i].is_exec_point = new_state; + } i++; } if (changed) @@ -447,14 +447,14 @@ tui_source_window_base::update_breakpoint_info line = &m_content[i]; if (current_only && !line->is_exec_point) - continue; + continue; /* Scan each breakpoint to see if the current line has something to - do with it. Identify enable/disabled breakpoints as well as - those that we already hit. */ + do with it. Identify enable/disabled breakpoints as well as + those that we already hit. */ tui_bp_flags mode = 0; iterate_over_breakpoints ([&] (breakpoint *bp) -> bool - { + { struct bp_location *loc; if (bp == being_deleted) @@ -477,12 +477,12 @@ tui_source_window_base::update_breakpoint_info } } return false; - }); + }); if (line->break_mode != mode) - { - line->break_mode = mode; - need_refresh = true; - } + { + line->break_mode = mode; + need_refresh = true; + } } return need_refresh; } diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 828e42bccf7..d25c53e6c93 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -197,20 +197,20 @@ tui_rl_command_key (int count, int key) for (i = 0; tui_commands[i].cmd; i++) { if (tui_commands[i].key == key) - { - /* Insert the command in the readline buffer. - Avoid calling the gdb command here since it creates - a possible recursion on readline if prompt_for_continue - is called (See PR 9584). The command will also appear - in the readline history which turns out to be better. */ - rl_insert_text (tui_commands[i].cmd); - rl_newline (1, '\n'); - - /* Switch to gdb command mode while executing the command. - This way the gdb's continue prompty will be displayed. */ - tui_set_key_mode (TUI_ONE_COMMAND_MODE); - return 0; - } + { + /* Insert the command in the readline buffer. + Avoid calling the gdb command here since it creates + a possible recursion on readline if prompt_for_continue + is called (See PR 9584). The command will also appear + in the readline history which turns out to be better. */ + rl_insert_text (tui_commands[i].cmd); + rl_newline (1, '\n'); + + /* Switch to gdb command mode while executing the command. + This way the gdb's continue prompty will be displayed. */ + tui_set_key_mode (TUI_ONE_COMMAND_MODE); + return 0; + } } return 0; } @@ -235,7 +235,7 @@ tui_rl_next_keymap (int notused1, int notused2) 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_SINGLE_KEY_MODE : TUI_COMMAND_MODE); return 0; } @@ -261,7 +261,7 @@ tui_set_key_mode (enum tui_key_mode mode) { tui_current_key_mode = mode; rl_set_keymap (mode == TUI_SINGLE_KEY_MODE - ? tui_keymap : tui_readline_standard_keymap); + ? tui_keymap : tui_readline_standard_keymap); tui_show_locator_content (); } @@ -307,11 +307,11 @@ tui_ensure_readline_initialized () int j; for (j = 0; tui_commands[j].cmd; j++) - if (tui_commands[j].key == i) - break; + if (tui_commands[j].key == i) + break; if (tui_commands[j].cmd) - continue; + continue; rl_bind_key_in_map (i, tui_rl_command_mode, tui_keymap); } @@ -440,7 +440,7 @@ tui_enable (void) else { /* Save the current gdb setting of the terminal. - Curses will restore this state when endwin() is called. */ + Curses will restore this state when endwin() is called. */ def_shell_mode (); clearok (stdscr, TRUE); } |