From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25388 invoked by alias); 18 Apr 2007 14:37:56 -0000 Received: (qmail 25375 invoked by uid 22791); 18 Apr 2007 14:37:55 -0000 X-Spam-Check-By: sourceware.org Received: from dessent.net (HELO dessent.net) (69.60.119.225) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 18 Apr 2007 15:37:48 +0100 Received: from localhost ([127.0.0.1] helo=dessent.net) by dessent.net with esmtp (Exim 4.50) id 1HeBI3-0006pT-3l for insight@sourceware.org; Wed, 18 Apr 2007 14:37:47 +0000 Message-ID: <46262D3A.8B1A0D15@dessent.net> Date: Wed, 18 Apr 2007 14:37:00 -0000 From: Brian Dessent Reply-To: insight@sourceware.org X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: insight@sourceware.org Subject: [patch] suppress annoying warnings about cygwin1.dbg Content-Type: multipart/mixed; boundary="------------E8ACD6D855178216C75D51A6" X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2007-q2/txt/msg00016.txt.bz2 This is a multi-part message in MIME format. --------------E8ACD6D855178216C75D51A6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 1106 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 --------------E8ACD6D855178216C75D51A6 Content-Type: text/plain; charset=us-ascii; name="insight_cygwin_nags.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="insight_cygwin_nags.patch" Content-length: 965 2007-04-18 Brian Dessent * 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 } --------------E8ACD6D855178216C75D51A6--