This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
target_output_hook -> gdb_stdtarg
- To: gdb-patches@sourceware.cygnus.com
- Subject: target_output_hook -> gdb_stdtarg
- From: Andrew Cagney <ac131313@cygnus.com>
- Date: Mon, 05 Jul 1999 11:03:11 +1000
- DJ-Gateway: from newsgroup cygnus.patches.gdb
- Newsgroups: cygnus.patches.gdb
- Organization: Cygnus Solutions
FYI,
I've checked in the attached. If anyone knows of other ways that GDB
can display target output then please let me know. At least target.c
and remote-sim.c are now consistent.
enjoy,
Andrew
Fri Jul 2 19:38:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
* top.c (target_output_hook): Delete definition.
* defs.h (target_output_hook): Delete declaration.
* remote.c (remote_console_output): Delete call to
target_output_hook(). Send target output to gdb_stdtarg using
an
unfiltered write. Make more robust.
* remote-sim.c (gdb_os_write_stdout, gdb_os_write_stderr):
Ditto. For moment, do not try to separate target stdout and
stderr
streams.
* defs.h (gdb_stdtarg): New global. Output from target and
simulators.
Index: defs.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/defs.h,v
retrieving revision 1.236
diff -p -r1.236 defs.h
*** defs.h 1999/07/02 17:02:53 1.236
--- defs.h 1999/07/05 00:54:25
*************** extern GDB_FILE *gdb_stderr;
*** 371,376 ****
--- 371,381 ----
*_unfiltered. In the very near future that restriction shall be
removed - either call shall be unfiltered. (cagney 1999-06-13). */
extern GDB_FILE *gdb_stdlog;
+ /* Target output that should bypass normal stdout/stderr filtering.
+ For momement, always call this stream using *_unfiltered. In the
+ very near future that restriction shall be removed - either call
+ shall be unfiltered. (cagney 1999-07-02). */
+ extern GDB_FILE *gdb_stdtarg;
#if defined(TUI)
#include "tui.h"
*************** extern void (*flush_hook) PARAMS ((GDB_F
*** 1153,1159 ****
extern void (*create_breakpoint_hook) PARAMS ((struct breakpoint *b));
extern void (*delete_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
extern void (*modify_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
- extern void (*target_output_hook) PARAMS ((char *));
extern void (*interactive_hook) PARAMS ((void));
extern void (*registers_changed_hook) PARAMS ((void));
extern void (*readline_begin_hook) PARAMS ((char *, ...));
--- 1158,1163 ----
Index: main.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/main.c,v
retrieving revision 1.184
diff -p -r1.184 main.c
*** main.c 1999/06/25 22:43:17 1.184
--- main.c 1999/07/05 00:54:27
*************** int dbx_commands = 0;
*** 70,75 ****
--- 70,76 ----
GDB_FILE *gdb_stdout;
GDB_FILE *gdb_stderr;
GDB_FILE *gdb_stdlog;
+ GDB_FILE *gdb_stdtarg;
/* Whether to enable writing into executable and core files */
extern int write_files;
*************** main (argc, argv)
*** 171,180 ****
--- 172,183 ----
gdb_stdout = stdio_fileopen (stdout);
gdb_stderr = stdio_fileopen (stderr);
gdb_stdlog = gdb_stderr; /* for moment */
+ gdb_stdtarg = gdb_stderr; /* for moment */
#else
gdb_stdout = tui_fileopen (stdout);
gdb_stderr = tui_fileopen (stderr);
gdb_stdlog = gdb_stdout; /* for moment */
+ gdb_stdtarg = gdb_stderr; /* for moment */
#endif
/* Parse arguments and options. */
Index: remote-sim.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/remote-sim.c,v
retrieving revision 2.83
diff -p -r2.83 remote-sim.c
*** remote-sim.c 1999/05/25 06:28:15 2.83
--- remote-sim.c 1999/07/05 00:54:30
*************** gdb_os_write_stdout (p, buf, len)
*** 197,206 ****
{
b[0] = buf[i];
b[1] = 0;
! if (target_output_hook)
! target_output_hook (b);
! else
! fputs_filtered (b, gdb_stdout);
}
return len;
}
--- 197,203 ----
{
b[0] = buf[i];
b[1] = 0;
! fputs_unfiltered (b, gdb_stdtarg);
}
return len;
}
*************** gdb_os_write_stderr (p, buf, len)
*** 229,238 ****
{
b[0] = buf[i];
b[1] = 0;
! if (target_output_hook)
! target_output_hook (b);
! else
! fputs_filtered (b, gdb_stderr);
}
return len;
}
--- 226,232 ----
{
b[0] = buf[i];
b[1] = 0;
! fputs_unfiltered (b, gdb_stdtarg);
}
return len;
}
Index: remote.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/remote.c,v
retrieving revision 1.198
diff -p -r1.198 remote.c
*** remote.c 1999/07/02 17:02:53 1.198
--- remote.c 1999/07/05 00:54:40
*************** remote_console_output (msg)
*** 2187,2202 ****
{
char *p;
! for (p = msg; *p; p +=2)
{
char tb[2];
char c = fromhex (p[0]) * 16 + fromhex (p[1]);
tb[0] = c;
tb[1] = 0;
! if (target_output_hook)
! target_output_hook (tb);
! else
! fputs_filtered (tb, gdb_stdout);
}
}
--- 2187,2199 ----
{
char *p;
! for (p = msg; p[0] && p[1]; p +=2)
{
char tb[2];
char c = fromhex (p[0]) * 16 + fromhex (p[1]);
tb[0] = c;
tb[1] = 0;
! fputs_unfiltered (tb, gdb_stdtarg);
}
}
Index: top.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/top.c,v
retrieving revision 2.142
diff -p -r2.142 top.c
*** top.c 1999/07/02 17:02:53 2.142
--- top.c 1999/07/05 00:54:48
*************** void (*command_loop_hook) PARAMS ((void)
*** 394,404 ****
void (*fputs_unfiltered_hook) PARAMS ((const char *linebuffer, GDB_FILE *stream));
- /* Called when the target says something to the host, which may
- want to appear in a different window. */
-
- void (*target_output_hook) PARAMS ((char *));
-
/* Called from print_frame_info to list the line we stopped in. */
void (*print_frame_info_listing_hook) PARAMS ((struct symtab *s, int line,
--- 394,399 ----