This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
Re: [patch] suppress annoying warnings about cygwin1.dbg
Brian Dessent wrote:
> How about a patch that modifies gdbtk-hooks.c:gdbtk_warning() such that
> instead of just blindly punting everything to gdbtk_tcl_warning(), it
> first tries to check if stdout has been redirected to a null handle, and
> just skip the warning if so? That would let the exiting stuff in
> win32-nat.c take care of suppressing these without any regexps.
See attached.
Brian
2007-04-18 Brian Dessent <brian@dessent.net>
* generic/gdbtk-hooks.c (gdbtk_warning): Do not display warnings
when output is currently suppressed.
Index: generic/gdbtk-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
retrieving revision 1.41
diff -u -p -r1.41 gdbtk-hooks.c
--- generic/gdbtk-hooks.c 23 Dec 2005 18:23:16 -0000 1.41
+++ generic/gdbtk-hooks.c 18 Apr 2007 15:29:25 -0000
@@ -347,9 +347,15 @@ static void
gdbtk_warning (const char *warning, va_list args)
{
char *buf;
- xvasprintf (&buf, warning, args);
- gdbtk_two_elem_cmd ("gdbtk_tcl_warning", buf);
- free(buf);
+
+ /* If gdb_stdout is currently attached to a null handle, do not display
+ the warning. */
+ if (ui_file_data (gdb_stdout) != NULL)
+ {
+ xvasprintf (&buf, warning, args);
+ gdbtk_two_elem_cmd ("gdbtk_tcl_warning", buf);
+ free (buf);
+ }
}