From 1c5313c5c81121a5fcec2f3344012ff5a86d8e8f Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Mon, 17 May 2010 22:21:43 +0000 Subject: [PATCH] 2010-05-17 Michael Snyder * tui/tui.c: White space. * tui/tui-data.c: White space. * tui/tui-disasm.c: White space. * tui/tui-file.c: White space. * tui/tui-interp.c: White space. * tui/tui-main.c: White space. * tui/tui-out.c: White space. * tui/tui-regs.c: White space. * tui/tui-source.c: White space. * tui/tui-stack.c: White space. * tui/tui-win.c: White space. * tui/tui-winsource.c: White space. --- gdb/ChangeLog | 13 +++++++++++++ gdb/tui/tui-data.c | 1 + gdb/tui/tui-disasm.c | 1 + gdb/tui/tui-file.c | 10 ++++++++++ gdb/tui/tui-interp.c | 1 + gdb/tui/tui-main.c | 1 + gdb/tui/tui-out.c | 6 +++++- gdb/tui/tui-regs.c | 2 +- gdb/tui/tui-source.c | 4 +++- gdb/tui/tui-stack.c | 3 +++ gdb/tui/tui-win.c | 2 ++ gdb/tui/tui-winsource.c | 4 +++- gdb/tui/tui.c | 2 ++ 13 files changed, 46 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a8224c88b2d..97675f56914 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,18 @@ 2010-05-17 Michael Snyder + * tui/tui.c: White space. + * tui/tui-data.c: White space. + * tui/tui-disasm.c: White space. + * tui/tui-file.c: White space. + * tui/tui-interp.c: White space. + * tui/tui-main.c: White space. + * tui/tui-out.c: White space. + * tui/tui-regs.c: White space. + * tui/tui-source.c: White space. + * tui/tui-stack.c: White space. + * tui/tui-win.c: White space. + * tui/tui-winsource.c: White space. + * procfs.c: White space. * python/py-auto-load.c: White space. diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index ee88cf13e4e..22c00c95340 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -402,6 +402,7 @@ tui_partial_win_by_name (char *name) if (tui_win_list[i] != 0) { char *cur_name = tui_win_name (&tui_win_list[i]->generic); + if (strlen (name) <= strlen (cur_name) && strncmp (name, cur_name, strlen (name)) == 0) win_info = tui_win_list[i]; diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index cb8358eb143..6d8aa1b023c 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -214,6 +214,7 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc) for (i = 0; i < max_lines; i++) { size_t len = strlen (asm_lines[i].addr_string); + if (len > addr_size) addr_size = len; diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c index fc26fb5bc51..2e4e821b7f0 100644 --- a/gdb/tui/tui-file.c +++ b/gdb/tui/tui-file.c @@ -60,6 +60,7 @@ tui_file_new (void) { struct tui_stream *tui = XMALLOC (struct tui_stream); struct ui_file *file = ui_file_new (); + set_ui_file_data (file, tui, tui_file_delete); set_ui_file_flush (file, tui_file_flush); set_ui_file_fputs (file, tui_file_fputs); @@ -74,6 +75,7 @@ static void tui_file_delete (struct ui_file *file) { struct tui_stream *tmpstream = ui_file_data (file); + if (tmpstream->ts_magic != &tui_file_magic) internal_error (__FILE__, __LINE__, _("tui_file_delete: bad magic number")); @@ -90,6 +92,7 @@ tui_fileopen (FILE *stream) { struct ui_file *file = tui_file_new (); struct tui_stream *tmpstream = ui_file_data (file); + tmpstream->ts_streamtype = afile; tmpstream->ts_filestream = stream; tmpstream->ts_strbuf = NULL; @@ -102,6 +105,7 @@ tui_sfileopen (int n) { struct ui_file *file = tui_file_new (); struct tui_stream *tmpstream = ui_file_data (file); + tmpstream->ts_streamtype = astring; tmpstream->ts_filestream = NULL; if (n > 0) @@ -121,6 +125,7 @@ static int tui_file_isatty (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); + if (stream->ts_magic != &tui_file_magic) internal_error (__FILE__, __LINE__, _("tui_file_isatty: bad magic number")); @@ -134,6 +139,7 @@ static void tui_file_rewind (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); + if (stream->ts_magic != &tui_file_magic) internal_error (__FILE__, __LINE__, _("tui_file_rewind: bad magic number")); @@ -146,6 +152,7 @@ tui_file_put (struct ui_file *file, void *dest) { struct tui_stream *stream = ui_file_data (file); + if (stream->ts_magic != &tui_file_magic) internal_error (__FILE__, __LINE__, _("tui_file_put: bad magic number")); @@ -182,6 +189,7 @@ char * tui_file_get_strbuf (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); + if (stream->ts_magic != &tui_file_magic) internal_error (__FILE__, __LINE__, _("tui_file_get_strbuf: bad magic number")); @@ -196,6 +204,7 @@ tui_file_adjust_strbuf (int n, struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); int non_null_chars; + if (stream->ts_magic != &tui_file_magic) internal_error (__FILE__, __LINE__, _("tui_file_adjust_strbuf: bad magic number")); @@ -223,6 +232,7 @@ static void tui_file_flush (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); + if (stream->ts_magic != &tui_file_magic) internal_error (__FILE__, __LINE__, _("tui_file_flush: bad magic number")); diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index cb8ec87a92b..ae23a6c9a43 100644 --- a/gdb/tui/tui-interp.c +++ b/gdb/tui/tui-interp.c @@ -169,6 +169,7 @@ tui_command_loop (void *data) while (1) { int result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL); + if (result < 0) break; diff --git a/gdb/tui/tui-main.c b/gdb/tui/tui-main.c index e0730963b5f..f302bd6ebb6 100644 --- a/gdb/tui/tui-main.c +++ b/gdb/tui/tui-main.c @@ -27,6 +27,7 @@ int main (int argc, char **argv) { struct captured_main_args args; + memset (&args, 0, sizeof args); args.argc = argc; args.argv = argv; diff --git a/gdb/tui/tui-out.c b/gdb/tui/tui-out.c index 0b8ad000b91..8cd6b887460 100644 --- a/gdb/tui/tui-out.c +++ b/gdb/tui/tui-out.c @@ -53,6 +53,7 @@ tui_field_int (struct ui_out *uiout, int value) { tui_out_data *data = ui_out_data (uiout); + if (data->base.suppress_output) return; @@ -80,6 +81,7 @@ tui_field_string (struct ui_out *uiout, const char *string) { tui_out_data *data = ui_out_data (uiout); + if (data->base.suppress_output) return; @@ -110,6 +112,7 @@ tui_field_fmt (struct ui_out *uiout, int fldno, va_list args) { tui_out_data *data = ui_out_data (uiout); + if (data->base.suppress_output) return; @@ -124,6 +127,7 @@ static void tui_text (struct ui_out *uiout, const char *string) { tui_out_data *data = ui_out_data (uiout); + if (data->base.suppress_output) return; data->start_of_line ++; @@ -166,7 +170,7 @@ extern void _initialize_tui_out (void); void _initialize_tui_out (void) { -/* Inherit the CLI version. */ + /* Inherit the CLI version. */ tui_ui_out_impl = cli_ui_out_impl; /* Override a few methods. */ diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 7c0ebce6654..5df09af9e5d 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -743,8 +743,8 @@ tui_get_register (struct frame_info *frame, if (target_has_registers) { gdb_byte buf[MAX_REGISTER_SIZE]; - get_frame_register (frame, regnum, buf); + get_frame_register (frame, regnum, buf); if (changedp) { struct gdbarch *gdbarch = get_frame_arch (frame); diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 8bd30556bba..ddad6a176f2 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -64,6 +64,7 @@ tui_set_source_content (struct symtab *s, if (!noerror) { char *name = alloca (strlen (s->filename) + 100); + sprintf (name, "%s:%d", s->filename, line_no); print_sys_errmsg (name, errno); } @@ -116,7 +117,7 @@ tui_set_source_content (struct symtab *s, while (cur_line < nlines) { struct tui_win_element *element = (struct tui_win_element *) - TUI_SRC_WIN->generic.content[cur_line]; + TUI_SRC_WIN->generic.content[cur_line]; /* Get the first character in the line. */ c = fgetc (stream); @@ -263,6 +264,7 @@ tui_set_source_content_nil (struct tui_win_info *win_info, struct tui_win_element *element = (struct tui_win_element *) win_info->generic.content[curr_line]; + element->which_element.source.line_or_addr.loa = LOA_LINE; element->which_element.source.line_or_addr.u.line_no = 0; element->which_element.source.is_exec_point = FALSE; diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index d6b514d1d28..7aaf54444f3 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -355,6 +355,7 @@ tui_show_frame_info (struct frame_info *fi) for (i = 0; i < (tui_source_windows ())->count; i++) { union tui_which_element *item; + win_info = (tui_source_windows ())->list[i]; item = &((struct tui_win_element *) locator->content[0])->which_element; @@ -378,6 +379,7 @@ tui_show_frame_info (struct frame_info *fi) if (win_info == TUI_SRC_WIN) { struct tui_line_or_address l; + l.loa = LOA_LINE; l.u.line_no = start_line; if (!(source_already_displayed @@ -395,6 +397,7 @@ tui_show_frame_info (struct frame_info *fi) if (win_info == TUI_DISASM_WIN) { struct tui_line_or_address a; + a.loa = LOA_ADDRESS; a.u.addr = low; if (!tui_addr_is_displayed (item->locator.addr, win_info, TRUE)) diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 50e054e6f2e..d7d5e3934e3 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -827,6 +827,7 @@ tui_initialize_win (void) #ifdef SIGWINCH #ifdef HAVE_SIGACTION struct sigaction old_winch; + memset (&old_winch, 0, sizeof (old_winch)); old_winch.sa_handler = &tui_sigwinch_handler; sigaction (SIGWINCH, &old_winch, NULL); @@ -1241,6 +1242,7 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info, if ((TUI_CMD_WIN->generic.height + diff) < 1) { int i; + for (i = TUI_CMD_WIN->generic.height + diff; (i < 1); i++) if (primary_win_info == first_win) diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index d6f83e83c3c..2e07fc84043 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -221,7 +221,8 @@ tui_clear_source_content (struct tui_win_info *win_info, for (i = 0; i < win_info->generic.content_size; i++) { struct tui_win_element *element = - (struct tui_win_element *) win_info->generic.content[i]; + (struct tui_win_element *) win_info->generic.content[i]; + element->which_element.source.has_break = FALSE; element->which_element.source.is_exec_point = FALSE; } @@ -328,6 +329,7 @@ tui_horizontal_source_scroll (struct tui_win_info *win_info, if (win_info->generic.type == SRC_WIN) { struct symtab_and_line cursal = get_current_source_symtab_and_line (); + if (cursal.symtab == NULL) s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL))); else diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index e126d813609..fb736a991af 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -244,6 +244,7 @@ tui_rl_command_key (int count, int key) /* Must save the command because it can be modified by execute_command. */ char *cmd = alloca (strlen (tui_commands[i].cmd) + 1); + strcpy (cmd, tui_commands[i].cmd); execute_command (cmd, TRUE); return 0; @@ -530,6 +531,7 @@ void tui_show_source (const char *file, int line) { struct symtab_and_line cursal = get_current_source_symtab_and_line (); + /* Make sure that the source window is displayed. */ tui_add_win_to_layout (SRC_WIN); -- 2.30.2