From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1513 invoked by alias); 9 Nov 2007 13:34:18 -0000 Received: (qmail 1307 invoked by uid 22791); 9 Nov 2007 13:34:15 -0000 X-Spam-Check-By: sourceware.org Received: from pool-70-20-17-24.bstnma.fios.verizon.net (HELO ednor.cgf.cx) (70.20.17.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Nov 2007 13:34:11 +0000 Received: by ednor.cgf.cx (Postfix, from userid 201) id 4E0852B353; Fri, 9 Nov 2007 08:34:09 -0500 (EST) Date: Fri, 09 Nov 2007 13:34:00 -0000 From: Christopher Faylor To: Pedro Alves , gdb-patches@sourceware.org, insight@sourceware.org Subject: Re: syms_from_objfile() warnings and win32-nat.c IO redirection (Was: suppress annoying warnings about cygwin1.dbg) Message-ID: <20071109133408.GA15911@ednor.casa.cgf.cx> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org, insight@sourceware.org References: <20071011195327.GB8200@caradoc.them.org> <470FFB00.9909C731@dessent.net> <47101DB4.6010204@portugalmail.pt> <20071024184207.GA10943@caradoc.them.org> <4725378D.5010800@portugalmail.pt> <4053daab0710290203q5aa79bam6a8e87e5c6a837ba@mail.gmail.com> <20071029123318.GA16009@caradoc.them.org> <20071030011953.GA28693@ednor.casa.cgf.cx> <4733A007.2040201@portugalmail.pt> <4733A059.6000609@portugalmail.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4733A059.6000609@portugalmail.pt> User-Agent: Mutt/1.5.16 (2007-06-09) 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-11/txt/msg00199.txt.bz2 On Thu, Nov 08, 2007 at 11:48:41PM +0000, Pedro Alves wrote: > Pedro Alves wrote: >> Is there anything else preventing us from removing the >> stderr -> null redirection from win32-nat.c ? > > Like so ? > > -- > Cheers, > Pedro Alves > >2007-11-08 Pedro Alves > > * win32-nat.c (safe_symbol_file_add_args, > safe_symbol_file_add_stub, safe_symbol_file_add_cleanup) > (safe_symbol_file_add): Remove. > (dll_symbol_command): Call symbol_file_add directly. > >--- > gdb/win32-nat.c | 70 -------------------------------------------------------- > 1 file changed, 1 insertion(+), 69 deletions(-) > >Index: src/gdb/win32-nat.c >=================================================================== >--- src.orig/gdb/win32-nat.c 2007-11-08 23:12:36.000000000 +0000 >+++ src/gdb/win32-nat.c 2007-11-08 23:12:40.000000000 +0000 >@@ -527,19 +527,6 @@ failed: > return 0; > } > >-/* Encapsulate the information required in a call to >- symbol_file_add_args */ >-struct safe_symbol_file_add_args >-{ >- char *name; >- int from_tty; >- struct section_addr_info *addrs; >- int mainline; >- int flags; >- struct ui_file *err, *out; >- struct objfile *ret; >-}; >- > /* Maintain a linked list of "so" information. */ > struct lm_info > { >@@ -548,61 +535,6 @@ struct lm_info > > static struct so_list solib_start, *solib_end; > >-/* Call symbol_file_add with stderr redirected. We don't care if there >- are errors. */ >-static int >-safe_symbol_file_add_stub (void *argv) >-{ >-#define p ((struct safe_symbol_file_add_args *) argv) >- struct so_list *so = &solib_start; >- >- p->ret = symbol_file_add (p->name, p->from_tty, p->addrs, p->mainline, p->flags); >- return !!p->ret; >-#undef p >-} >- >-/* Restore gdb's stderr after calling symbol_file_add */ >-static void >-safe_symbol_file_add_cleanup (void *p) >-{ >-#define sp ((struct safe_symbol_file_add_args *)p) >- gdb_flush (gdb_stderr); >- gdb_flush (gdb_stdout); >- ui_file_delete (gdb_stderr); >- ui_file_delete (gdb_stdout); >- gdb_stderr = sp->err; >- gdb_stdout = sp->out; >-#undef sp >-} >- >-/* symbol_file_add wrapper that prevents errors from being displayed. */ >-static struct objfile * >-safe_symbol_file_add (char *name, int from_tty, >- struct section_addr_info *addrs, >- int mainline, int flags) >-{ >- struct safe_symbol_file_add_args p; >- struct cleanup *cleanup; >- >- cleanup = make_cleanup (safe_symbol_file_add_cleanup, &p); >- >- p.err = gdb_stderr; >- p.out = gdb_stdout; >- gdb_flush (gdb_stderr); >- gdb_flush (gdb_stdout); >- gdb_stderr = ui_file_new (); >- gdb_stdout = ui_file_new (); >- p.name = name; >- p.from_tty = from_tty; >- p.addrs = addrs; >- p.mainline = mainline; >- p.flags = flags; >- catch_errors (safe_symbol_file_add_stub, &p, "", RETURN_MASK_ERROR); >- >- do_cleanups (cleanup); >- return p.ret; >-} >- > static struct so_list * > win32_make_so (const char *name, DWORD load_addr) > { >@@ -806,7 +738,7 @@ dll_symbol_command (char *args, int from > args = newargs; > } > >- safe_symbol_file_add (args, from_tty, NULL, 0, OBJF_SHARED | OBJF_USERLOADED); >+ symbol_file_add (args, from_tty, NULL, 0, OBJF_SHARED | OBJF_USERLOADED); > } > > /* Handle DEBUG_STRING output from child process. That would do it but removing that code would mean lots of console chatter unless you're debugging with the most recent, unreleased version of the DLL. I think we need to keep that code in gdb until the next version of cygwin is released - and that is not even on the horizon yet. cgf