This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] suppress annoying warnings about cygwin1.dbg


If you use Insight with Cygwin, you are treated to two extremely
annoying pop-up warnings every time you debug any program:

section .text not found in /bin/cygwin1.dbg
no loadable sections found in added symbol-file /bin/cygwin1.dbg

This is because the debug symbols for the Cygwin DLL itself are handled
specially.  The DLL has only a .gnu_debuglink section which points to an
external file that holds the symbols, cygwin1.dbg.  This file contains
only debug sections, no code, and thus every time gdb reads it with bfd,
it issues these warnings in symfile.c:syms_from_objfile().

When using the plain gdb front-end, stdout and stderr have been
conveniently redirected to /dev/null by
win32-nat.c:safe_symbol_file_add().  However, since Insight hooks
warning() through gdbtk_warning(), it gets all messages and doesn't know
to ignore them.  This patch just adds a regexp in gdbtk_tcl_warning to
filter these messages.  I can think of cleaner solutions to doing this,
such as having gdbtk_warning() check stdout/stderr, but it looks like
this is the established way of doing things so here it is.

Brian
2007-04-18  Brian Dessent  <brian@dessent.net>

	* library/interface.tcl (gdbtk_tcl_warning): Suppress useless warnings
	when loading symbols from cygwin1.dbg.

Index: library/interface.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
retrieving revision 1.57
diff -u -p -r1.57 interface.tcl
--- library/interface.tcl	23 Dec 2005 18:26:50 -0000	1.57
+++ library/interface.tcl	18 Apr 2007 14:24:16 -0000
@@ -365,6 +365,8 @@ proc gdbtk_tcl_warning {message} {
 
   switch -regexp $message {
         "Unable to find dynamic linker breakpoint function.*" {return}
+	"(no loadable sections|section .* not) found in .*cygwin.*\.dbg"
+	                                                      {return}
 	"Internal error.*" { gdbtk_tcl_fputs_error $message }
         "incomplete CFI.*" { gdbtk_tcl_fputs_error $message }
 	"RTTI symbol not found for class.*" { gdbtk_tcl_fputs_error $message }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]