summaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-06-01 15:44:41 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-06-01 15:44:41 +0000
commit32cdd960534de92805b882f7cfa863064f7f6b31 (patch)
treecfa1f6ad34289dd35cdca07c7a23fd030c67385d /gdb/main.c
parentbd93f96afc89b3f880ed08004bea39c2c49bbc41 (diff)
downloadgdb-32cdd960534de92805b882f7cfa863064f7f6b31.tar.gz
import gdb-1999-06-01 snapshot
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 9d85aaba9a0..594ca9ef25d 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -157,19 +157,14 @@ main (argc, argv)
getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
current_directory = gdb_dirbuf;
- gdb_file_size = sizeof(GDB_FILE);
-
- gdb_stdout = (GDB_FILE *)xmalloc (gdb_file_size);
- gdb_stdout->ts_streamtype = afile;
- gdb_stdout->ts_filestream = stdout;
- gdb_stdout->ts_strbuf = NULL;
- gdb_stdout->ts_buflen = 0;
-
- gdb_stderr = (GDB_FILE *)xmalloc (gdb_file_size);
- gdb_stderr->ts_streamtype = afile;
- gdb_stderr->ts_filestream = stderr;
- gdb_stderr->ts_strbuf = NULL;
- gdb_stderr->ts_buflen = 0;
+#if 0
+ /* not yet */
+ gdb_stdout = stdio_fileopen (stdout);
+ gdb_stderr = stdio_fileopen (stderr);
+#else
+ gdb_stdout = tui_fileopen (stdout);
+ gdb_stderr = tui_fileopen (stderr);
+#endif
/* Parse arguments and options. */
{
@@ -715,17 +710,21 @@ Report bugs to \"bug-gdb@prep.ai.mit.edu\".\
}
-/* All I/O sent to the *_filtered and *_unfiltered functions eventually ends up
- here. The fputs_unfiltered_hook is primarily used by GUIs to collect all
- output and send it to the GUI, instead of the controlling terminal. Only
- output to gdb_stdout and gdb_stderr are sent to the hook. Everything else
- is sent on to fputs to allow file I/O to be handled appropriately. */
+/* All TUI I/O sent to the *_filtered and *_unfiltered functions
+ eventually ends up here. The fputs_unfiltered_hook is primarily
+ used by GUIs to collect all output and send it to the GUI, instead
+ of the controlling terminal. Only output to gdb_stdout and
+ gdb_stderr are sent to the hook. Everything else is sent on to
+ fputs to allow file I/O to be handled appropriately. */
+
+/* FIXME: Should be broken up and moved to a TUI specific file. */
void
-fputs_unfiltered (linebuffer, stream)
+tui_file_fputs (linebuffer, file)
const char *linebuffer;
- GDB_FILE *stream;
+ GDB_FILE *file;
{
+ struct tui_stream *stream = gdb_file_data (file);
#if defined(TUI)
extern int tui_owns_terminal;
#endif
@@ -736,9 +735,9 @@ fputs_unfiltered (linebuffer, stream)
* new (XDB style) scheme, we do not do that anymore... - RT
*/
if (fputs_unfiltered_hook
- && (stream == gdb_stdout
- || stream == gdb_stderr))
- fputs_unfiltered_hook (linebuffer, stream);
+ && (file == gdb_stdout
+ || file == gdb_stderr))
+ fputs_unfiltered_hook (linebuffer, file);
else
{
#if defined(TUI)
@@ -772,7 +771,7 @@ fputs_unfiltered (linebuffer, stream)
#else
if (stream->ts_streamtype == astring) {
- gdb_file_adjust_strbuf(strlen(linebuffer), stream);
+ gdb_file_adjust_strbuf(strlen(linebuffer), file);
strcat(stream->ts_strbuf, linebuffer);
} else fputs (linebuffer, stream->ts_filestream);
#endif