From: Pedro Alves <pedro_alves@portugalmail.pt>
To: 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)
Date: Fri, 09 Nov 2007 01:35:00 -0000 [thread overview]
Message-ID: <4733A059.6000609@portugalmail.pt> (raw)
In-Reply-To: <4733A007.2040201@portugalmail.pt>
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
Pedro Alves wrote:
>
> Is there anything else preventing us from removing the
> stderr -> null redirection from win32-nat.c ?
>
Like so ?
--
Cheers,
Pedro Alves
[-- Attachment #2: remove_redirect_null.diff --]
[-- Type: text/x-diff, Size: 2938 bytes --]
2007-11-08 Pedro Alves <pedro_alves@portugalmail.pt>
* 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.
next prev parent reply other threads:[~2007-11-09 1:35 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <46262D3A.8B1A0D15@dessent.net>
[not found] ` <20070418150137.GA7338@trixie.casa.cgf.cx>
[not found] ` <46263710.D9755DAD@dessent.net>
[not found] ` <462639F3.FBCF4675@dessent.net>
[not found] ` <46264A56.BA86EED7@dessent.net>
2007-05-02 15:19 ` [patch ping] suppress annoying warnings about cygwin1.dbg Brian Dessent
2007-06-25 23:20 ` [patch ping^2] " Brian Dessent
2007-06-25 23:40 ` Pedro Alves
2007-06-25 23:52 ` Daniel Jacobowitz
2007-06-26 0:59 ` Brian Dessent
2007-06-26 7:37 ` Daniel Jacobowitz
2007-06-28 6:11 ` syms_from_objfile() warnings and win32-nat.c IO redirection (Was: suppress annoying warnings about cygwin1.dbg) Brian Dessent
2007-06-28 12:44 ` Daniel Jacobowitz
2007-10-11 20:26 ` Daniel Jacobowitz
2007-10-13 0:09 ` Brian Dessent
2007-10-13 1:44 ` Pedro Alves
2007-10-13 2:49 ` Brian Dessent
2007-10-13 3:33 ` Pedro Alves
2007-10-13 6:03 ` Brian Dessent
2007-10-24 19:06 ` Daniel Jacobowitz
2007-10-29 3:06 ` Pedro Alves
2007-10-29 12:33 ` Pedro Alves
2007-10-29 12:57 ` Daniel Jacobowitz
2007-10-29 22:54 ` Pedro Alves
2007-10-30 4:05 ` Christopher Faylor
2007-10-30 9:02 ` Pedro Alves
2007-10-30 1:27 ` Christopher Faylor
2007-11-08 23:56 ` Pedro Alves
2007-11-09 1:35 ` Pedro Alves [this message]
2007-11-09 13:34 ` Christopher Faylor
2007-11-09 13:59 ` Pedro Alves
2007-11-09 13:59 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4733A059.6000609@portugalmail.pt \
--to=pedro_alves@portugalmail.pt \
--cc=gdb-patches@sourceware.org \
--cc=insight@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox