This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[ob] tui/*.c white space
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 17 May 2010 15:22:54 -0700
- Subject: [ob] tui/*.c white space
add blank line between decls and statements
2010-05-17 Michael Snyder <msnyder@vmware.com>
* 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.
Index: tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.67
diff -u -p -r1.67 tui.c
--- tui.c 30 Mar 2010 22:21:34 -0000 1.67
+++ tui.c 17 May 2010 22:20:45 -0000
@@ -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);
Index: tui-data.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-data.c,v
retrieving revision 1.28
diff -u -p -r1.28 tui-data.c
--- tui-data.c 1 Jan 2010 07:32:07 -0000 1.28
+++ tui-data.c 17 May 2010 22:20:45 -0000
@@ -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];
Index: tui-disasm.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-disasm.c,v
retrieving revision 1.34
diff -u -p -r1.34 tui-disasm.c
--- tui-disasm.c 20 Mar 2010 05:17:10 -0000 1.34
+++ tui-disasm.c 17 May 2010 22:20:45 -0000
@@ -214,6 +214,7 @@ tui_set_disassem_content (struct gdbarch
for (i = 0; i < max_lines; i++)
{
size_t len = strlen (asm_lines[i].addr_string);
+
if (len > addr_size)
addr_size = len;
Index: tui-file.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-file.c,v
retrieving revision 1.21
diff -u -p -r1.21 tui-file.c
--- tui-file.c 1 Jan 2010 07:32:07 -0000 1.21
+++ tui-file.c 17 May 2010 22:20:45 -0000
@@ -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
{
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"));
Index: tui-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-interp.c,v
retrieving revision 1.26
diff -u -p -r1.26 tui-interp.c
--- tui-interp.c 5 May 2010 22:53:53 -0000 1.26
+++ tui-interp.c 17 May 2010 22:20:45 -0000
@@ -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;
Index: tui-main.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-main.c,v
retrieving revision 1.7
diff -u -p -r1.7 tui-main.c
--- tui-main.c 1 Jan 2010 07:32:07 -0000 1.7
+++ tui-main.c 17 May 2010 22:20:45 -0000
@@ -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;
Index: tui-out.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-out.c,v
retrieving revision 1.17
diff -u -p -r1.17 tui-out.c
--- tui-out.c 18 Apr 2010 00:11:55 -0000 1.17
+++ tui-out.c 17 May 2010 22:20:45 -0000
@@ -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
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. */
Index: tui-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-regs.c,v
retrieving revision 1.39
diff -u -p -r1.39 tui-regs.c
--- tui-regs.c 5 May 2010 22:53:54 -0000 1.39
+++ tui-regs.c 17 May 2010 22:20:45 -0000
@@ -743,8 +743,8 @@ tui_get_register (struct frame_info *fra
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);
Index: tui-source.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-source.c,v
retrieving revision 1.25
diff -u -p -r1.25 tui-source.c
--- tui-source.c 1 Jan 2010 07:32:07 -0000 1.25
+++ tui-source.c 17 May 2010 22:20:45 -0000
@@ -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_w
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;
Index: tui-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-stack.c,v
retrieving revision 1.36
diff -u -p -r1.36 tui-stack.c
--- tui-stack.c 16 Apr 2010 04:34:31 -0000 1.36
+++ tui-stack.c 17 May 2010 22:20:45 -0000
@@ -355,6 +355,7 @@ tui_show_frame_info (struct frame_info *
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 *
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 *
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))
Index: tui-win.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-win.c,v
retrieving revision 1.46
diff -u -p -r1.46 tui-win.c
--- tui-win.c 5 May 2010 22:53:54 -0000 1.46
+++ tui-win.c 17 May 2010 22:20:45 -0000
@@ -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_i
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)
Index: tui-winsource.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-winsource.c,v
retrieving revision 1.35
diff -u -p -r1.35 tui-winsource.c
--- tui-winsource.c 1 Jan 2010 07:32:07 -0000 1.35
+++ tui-winsource.c 17 May 2010 22:20:45 -0000
@@ -221,7 +221,8 @@ tui_clear_source_content (struct tui_win
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
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