diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index dd61d1e77c9..5640a4aa27d 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -272,7 +272,7 @@ tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr) val.loa = LOA_ADDRESS; val.u.addr = start_addr; tui_add_win_to_layout (DISASSEM_WIN); - tui_update_source_window (TUI_DISASM_WIN, gdbarch, s, val, FALSE); + tui_update_source_window (TUI_DISASM_WIN, gdbarch, s, val); /* If the focus was in the src win, put it in the asm win, if the source view isn't split. */ @@ -302,7 +302,7 @@ tui_show_disassem_and_update_source (struct gdbarch *gdbarch, sal = find_pc_line (start_addr, 0); val.loa = LOA_LINE; val.u.line_no = sal.line; - tui_update_source_window (TUI_SRC_WIN, gdbarch, sal.symtab, val, TRUE); + tui_update_source_window (TUI_SRC_WIN, gdbarch, sal.symtab, val); if (sal.symtab) { set_current_source_symtab_and_line (sal); @@ -394,6 +394,6 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction, val.loa = LOA_ADDRESS; val.u.addr = tui_find_disassembly_address (gdbarch, pc, dir); tui_update_source_window_as_is (TUI_DISASM_WIN, gdbarch, - NULL, val, FALSE); + NULL, val); } } diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index a0285582bb2..251befc5e60 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -583,8 +583,7 @@ tui_syntax_highlight (enum language lang, /* Function to display source in the source window. */ enum tui_status tui_set_source_content (struct symtab *s, - int line_no, - int noerror) + int line_no) { enum tui_status ret = TUI_FAILURE; @@ -606,14 +605,6 @@ tui_set_source_content (struct symtab *s, desc = open_source_file (s); if (desc < 0) { - if (!noerror) - { - const char *filename = symtab_to_filename_for_display (s); - char *name = (char *) alloca (strlen (filename) + 100); - - sprintf (name, "%s:%d", filename, line_no); - print_sys_errmsg (name, errno); - } ret = TUI_FAILURE; } else @@ -918,11 +909,10 @@ tui_set_source_content_nil (struct tui_win_info *win_info, initializes the horizontal scroll to 0. */ void tui_show_symtab_source (struct gdbarch *gdbarch, struct symtab *s, - struct tui_line_or_address line, - int noerror) + struct tui_line_or_address line) { TUI_SRC_WIN->detail.source_info.horizontal_offset = 0; - tui_update_source_window_as_is (TUI_SRC_WIN, gdbarch, s, line, noerror); + tui_update_source_window_as_is (TUI_SRC_WIN, gdbarch, s, line); } @@ -971,9 +961,9 @@ tui_vertical_source_scroll (enum tui_scroll_direction scroll_direction, { l.u.line_no = content[0]->which_element.source.line_or_addr.u.line_no - num_to_scroll; - if (l.u.line_no <= 0) - l.u.line_no = 1; } + if (l.u.line_no <= 0) + l.u.line_no = 1; print_source_lines (s, l.u.line_no, l.u.line_no + 1, 0); } diff --git a/gdb/tui/tui-source.h b/gdb/tui/tui-source.h index 164dbbe8db1..a7907d09d50 100644 --- a/gdb/tui/tui-source.h +++ b/gdb/tui/tui-source.h @@ -31,10 +31,9 @@ extern void tui_set_source_content_nil (struct tui_win_info *, const char *); extern enum tui_status tui_set_source_content (struct symtab *, - int, int); + int); extern void tui_show_symtab_source (struct gdbarch *, struct symtab *, - struct tui_line_or_address, - int); + struct tui_line_or_address); extern int tui_source_is_displayed (const char *); extern void tui_vertical_source_scroll (enum tui_scroll_direction, int); diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index f26fe1e6c4b..b23a2851e14 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -432,7 +432,7 @@ tui_show_frame_info (struct frame_info *fi) && tui_line_is_displayed (item->locator.line_no, win_info, TRUE))) tui_update_source_window (win_info, get_frame_arch (fi), - sal.symtab, l, TRUE); + sal.symtab, l); else { l.u.line_no = item->locator.line_no; @@ -450,7 +450,7 @@ tui_show_frame_info (struct frame_info *fi) if (!tui_addr_is_displayed (item->locator.addr, win_info, TRUE)) tui_update_source_window (win_info, get_frame_arch (fi), - sal.symtab, a, TRUE); + sal.symtab, a); else { a.u.addr = item->locator.addr; diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 6f7e12714e8..5ae6175e0e9 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -1479,7 +1479,7 @@ make_visible_with_new_height (struct tui_win_info *win_info) line_or_addr = win_info->detail.source_info.start_line_or_addr; tui_free_win_content (&win_info->generic); tui_update_source_window (win_info, gdbarch, - cursal.symtab, line_or_addr, TRUE); + cursal.symtab, line_or_addr); } else if (deprecated_safe_get_selected_frame () != NULL) { @@ -1500,7 +1500,7 @@ make_visible_with_new_height (struct tui_win_info *win_info) line.loa = LOA_ADDRESS; find_line_pc (s, cursal.line, &line.u.addr); } - tui_update_source_window (win_info, gdbarch, s, line, TRUE); + tui_update_source_window (win_info, gdbarch, s, line); } if (tui_win_has_locator (win_info)) { diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 5b175177f00..346e2ea417f 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -71,11 +71,10 @@ void tui_update_source_window (struct tui_win_info *win_info, struct gdbarch *gdbarch, struct symtab *s, - struct tui_line_or_address line_or_addr, - int noerror) + struct tui_line_or_address line_or_addr) { win_info->detail.source_info.horizontal_offset = 0; - tui_update_source_window_as_is (win_info, gdbarch, s, line_or_addr, noerror); + tui_update_source_window_as_is (win_info, gdbarch, s, line_or_addr); return; } @@ -87,13 +86,12 @@ void tui_update_source_window_as_is (struct tui_win_info *win_info, struct gdbarch *gdbarch, struct symtab *s, - struct tui_line_or_address line_or_addr, - int noerror) + struct tui_line_or_address line_or_addr) { enum tui_status ret; if (win_info->generic.type == SRC_WIN) - ret = tui_set_source_content (s, line_or_addr.u.line_no, noerror); + ret = tui_set_source_content (s, line_or_addr.u.line_no); else ret = tui_set_disassem_content (gdbarch, line_or_addr.u.addr); @@ -152,7 +150,7 @@ tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr) sal = find_pc_line (addr, 0); l.loa = LOA_LINE; l.u.line_no = sal.line; - tui_show_symtab_source (gdbarch, sal.symtab, l, FALSE); + tui_show_symtab_source (gdbarch, sal.symtab, l); break; } } @@ -194,7 +192,7 @@ tui_update_source_windows_with_line (struct symtab *s, int line) default: l.loa = LOA_LINE; l.u.line_no = line; - tui_show_symtab_source (gdbarch, s, l, FALSE); + tui_show_symtab_source (gdbarch, s, l); if (tui_current_layout () == SRC_DISASSEM_COMMAND) { find_line_pc (s, line, &pc); @@ -400,8 +398,7 @@ tui_horizontal_source_scroll (struct tui_win_info *win_info, win_info->detail.source_info.horizontal_offset = offset; tui_update_source_window_as_is (win_info, gdbarch, s, win_info->generic.content[0] - ->which_element.source.line_or_addr, - FALSE); + ->which_element.source.line_or_addr); } return; diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 6da44b09e32..53705c50a9d 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -41,12 +41,10 @@ extern int tui_update_breakpoint_info (struct tui_win_info *win, extern void tui_display_main (void); extern void tui_update_source_window (struct tui_win_info *, struct gdbarch *, struct symtab *, - struct tui_line_or_address, - int); + struct tui_line_or_address); extern void tui_update_source_window_as_is (struct tui_win_info *, struct gdbarch *, struct symtab *, - struct tui_line_or_address, - int); + struct tui_line_or_address); extern void tui_update_source_windows_with_addr (struct gdbarch *, CORE_ADDR); extern void tui_update_source_windows_with_line (struct symtab *, int);