From: Fred Fish <fnf@ninemoons.com>
To: gdb-patches@sources.redhat.com
Cc: fnf@ninemoons.com
Subject: [PATCH] Fix remote simulator stdio/stderr callbacks
Date: Fri, 30 Jan 2004 04:59:00 -0000 [thread overview]
Message-ID: <200401292158.35875.fnf@ninemoons.com> (raw)
There seems to be two problems with the current callbacks in remote-sim.c:
(1) The callback to write out the target stderr data writes to the stdtarg
(stdout) stream instead of the stdtargerr (stderr) stream.
(2) The callback to flush the target stderr data actually flushes a completely
different stream that the one that the stderr data was written to.
Am I missing something obvious? I think the problem was masked by the
fact that normally gdb_stdtarg and gdb_stdtargerr are the same as
gdb_stderr.
Also included is a minor tweak to group the gdb_stdtarg declaration
with the other gdb_stdtarg* declarations.
Not included in the patch is an update to the file copyright years,
which I will include when the changes are checked in, if approved.
-Fred
2004-01-29 Fred Fish <fnf@redhat.com>
* main.c (gdb_stdtarg): Move definition to group with other gdb_stdtarg
definitions.
* remote-sim.c (gdb_os_write_stderr): Write output to gdb_stdtargerr
stream instead of gdb_stdtarg stream.
(gdb_os_flush_stderr): Flush gdb_stdtargerr steam instead of
gdb_stderr stream.
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.37
diff -c -p -r1.37 main.c
*** main.c 19 Jan 2004 19:56:01 -0000 1.37
--- main.c 30 Jan 2004 04:44:02 -0000
*************** char *gdb_sysroot = 0;
*** 72,81 ****
struct ui_file *gdb_stdout;
struct ui_file *gdb_stderr;
struct ui_file *gdb_stdlog;
- struct ui_file *gdb_stdtarg;
struct ui_file *gdb_stdin;
/* target IO streams */
struct ui_file *gdb_stdtargin;
struct ui_file *gdb_stdtargerr;
/* Whether to enable writing into executable and core files */
--- 72,81 ----
struct ui_file *gdb_stdout;
struct ui_file *gdb_stderr;
struct ui_file *gdb_stdlog;
struct ui_file *gdb_stdin;
/* target IO streams */
struct ui_file *gdb_stdtargin;
+ struct ui_file *gdb_stdtarg;
struct ui_file *gdb_stdtargerr;
/* Whether to enable writing into executable and core files */
Index: remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.33
diff -c -p -r1.33 remote-sim.c
*** remote-sim.c 13 Nov 2003 19:06:26 -0000 1.33
--- remote-sim.c 30 Jan 2004 04:44:03 -0000
*************** gdb_os_write_stderr (host_callback *p, c
*** 221,227 ****
{
b[0] = buf[i];
b[1] = 0;
! fputs_unfiltered (b, gdb_stdtarg);
}
return len;
}
--- 221,227 ----
{
b[0] = buf[i];
b[1] = 0;
! fputs_unfiltered (b, gdb_stdtargerr);
}
return len;
}
*************** gdb_os_write_stderr (host_callback *p, c
*** 231,237 ****
static void
gdb_os_flush_stderr (host_callback *p)
{
! gdb_flush (gdb_stderr);
}
/* GDB version of printf_filtered callback. */
--- 231,237 ----
static void
gdb_os_flush_stderr (host_callback *p)
{
! gdb_flush (gdb_stdtargerr);
}
/* GDB version of printf_filtered callback. */
next reply other threads:[~2004-01-30 4:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-30 4:59 Fred Fish [this message]
2004-01-30 23:18 ` Andrew Cagney
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=200401292158.35875.fnf@ninemoons.com \
--to=fnf@ninemoons.com \
--cc=gdb-patches@sources.redhat.com \
/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