From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8402 invoked by alias); 28 Jun 2007 04:53:23 -0000 Received: (qmail 8384 invoked by uid 22791); 28 Jun 2007 04:53:21 -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; Thu, 28 Jun 2007 04:53:17 +0000 Received: from localhost ([127.0.0.1] helo=dessent.net) by dessent.net with esmtp (Exim 4.50) id 1I3m09-0007kf-J9; Thu, 28 Jun 2007 04:53:05 +0000 Message-ID: <46833EB0.E8ABC8CB@dessent.net> Date: Thu, 28 Jun 2007 06:11:00 -0000 From: Brian Dessent Reply-To: gdb-patches@sourceware.org X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: Daniel Jacobowitz CC: Pedro Alves , insight@sourceware.org, gdb-patches@sourceware.org Subject: syms_from_objfile() warnings and win32-nat.c IO redirection (Was: suppress annoying warnings about cygwin1.dbg) References: <46262D3A.8B1A0D15@dessent.net> <20070418150137.GA7338@trixie.casa.cgf.cx> <46263710.D9755DAD@dessent.net> <462639F3.FBCF4675@dessent.net> <46264A56.BA86EED7@dessent.net> <4638AB6B.5AA94B26@dessent.net> <46803846.F99470AE@dessent.net> <46804DAD.4020309@portugalmail.pt> <20070625234015.GA17640@caradoc.them.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00486.txt.bz2 Daniel Jacobowitz wrote: > The redirection to /dev/null is silly and should go away, by the way, > so relying on it isn't the right fix. I don't remember if my recently > posted WIP patch removed it. I think it did for most but not all > cases. So I tried simply removing the two problematic warnings in syms_from_objfile(), and then getting rid of the hacky safe_symbol_file_add() wrapper in win32-nat.c. This obviously has the desired effect of not seeing the popups in insight, but now gdb has become much more chatty. This is what happens when you run a Hello World program: $ /build/combined/gdb/gdb --quiet hello Reading symbols from /tmp/hello.exe...done. (gdb) start Reading in symbols for /home/brian/hello.c...done. Breakpoint 1 at 0x401065: file /home/brian/hello.c, line 4. Reading symbols from /winxp/system32/ntdll.dll...Minimal symbols from ntdll.dll...done. Reading symbols from /winxp/system32/kernel32.dll...Minimal symbols from KERNEL32.dll...done. Reading symbols from /usr/bin/cygwin1.dll...Reading symbols from /usr/bin/cygwin1.dbg...done. done. Reading symbols from /winxp/system32/advapi32.dll...Minimal symbols from ADVAPI32.dll...done. Reading symbols from /winxp/system32/rpcrt4.dll...Minimal symbols from RPCRT4.dll...done. Reading symbols from /winxp/system32/shimeng.dll... Minimal symbols from ShimEng.dll...done. Reading symbols from /winxp/system32/secur32.dll...Minimal symbols from Secur32.dll...done. [New thread 1988.0xa1c] Reading symbols from /winxp/system32/user32.dll...Minimal symbols from USER32.dll...done. Reading symbols from /winxp/system32/gdi32.dll...Minimal symbols from GDI32.dll...done. main (argc=1, argv=0x662740) at /home/brian/hello.c:4 4 { (gdb) c Hello world! Reading symbols from /winxp/system32/psapi.dll...Minimal symbols from PSAPI.DLL...done. Program exited normally. (gdb) In insight, it's somewhat better because the "Reading symbols from %s" messages are suppressed due to the hooks, but not the "Minimal symbols from %s", with the result in the console of: (gdb) start Reading in symbols for /home/brian/hello.c...done. Breakpoint 1 at 0x401065: file /home/brian/hello.c, line 4. Minimal symbols from ntdll.dll...Minimal symbols from KERNEL32.dll...Minimal symbols from ADVAPI32.dll...Minimal symbols from RPCRT4.dll...Minimal symbols from ShimEng.dll...Minimal symbols from Secur32.dll...[New thread 3520.0xa5c] Minimal symbols from USER32.dll...Minimal symbols from GDI32.dll...main (argc=2, argv=0x662980) at /home/brian/hello.c:4 (gdb) c [Deleting thread 3520.0xa5c] Minimal symbols from PSAPI.DLL... Program exited normally. (gdb) For comparison, the output of current unmodified stock CVS gdb is: $ /build/combined/gdb/gdb --quiet hello Reading symbols from /tmp/hello.exe...done. (gdb) start Reading in symbols for /home/brian/hello.c...done. Breakpoint 1 at 0x401065: file /home/brian/hello.c, line 4. [New thread 3256.0xdc] main (argc=1, argv=0x662740) at /home/brian/hello.c:4 4 { (gdb) c Hello world! Program exited normally. (gdb) Obviously (?) this is way too much spew, so if we want to eliminate the hacky IO redirection, what's the way forward? It seems to me that the "Minimal symbols from %s.." (coff-pe-read.c:read_pe_exported_syms()) is pure noise, so it could just be eliminated. However, how do we gate the output of "Reading in symbols for %s" so that it shows for the user's objects but not for the dozens of system DLLs? Is there an existing API for this? I gather the answer is no, otherwise the hacky IO redirection stuff would have never been done. Or do we just say that we shouldn't try to filter these messages and let the user see them all? The result of *that* looks like this: $ /build/combined/gdb/gdb --quiet hello Reading symbols from /tmp/hello.exe...done. (gdb) start Reading in symbols for /home/brian/hello.c...done. Breakpoint 1 at 0x401065: file /home/brian/hello.c, line 4. Reading symbols from /winxp/system32/ntdll.dll...done. Reading symbols from /winxp/system32/kernel32.dll...done. Reading symbols from /usr/bin/cygwin1.dll...Reading symbols from /usr/bin/cygwin1.dbg...done. done. Reading symbols from /winxp/system32/advapi32.dll...done. Reading symbols from /winxp/system32/rpcrt4.dll...done. Reading symbols from /winxp/system32/shimeng.dll...done. Reading symbols from /winxp/system32/secur32.dll...done. [New thread 3084.0x968] Reading symbols from /winxp/system32/user32.dll...done. Reading symbols from /winxp/system32/gdi32.dll...done. main (argc=1, argv=0x662740) at /home/brian/hello.c:4 4 { (gdb) c Hello world! Reading symbols from /winxp/system32/psapi.dll...done. [Deleting thread 3084.0x968] Program exited normally. (gdb) quit Again, this is for a trivial program that contains one call to puts() and nothing else. For a less trivial example, you can get dozens of these as there are potentially many DLLs get loaded during the lifetime of the app, and so it can be somewhat spammy. Ideas? Brian