aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2001-07-17 06:42:58 +0000
committerStephane Carrez <stcarrez@nerim.fr>2001-07-17 06:42:58 +0000
commite42acc6bba327bf99ac7c21dd3ab836495e18bcf (patch)
tree605abd20f2c470e21d936e31670398a2a0a5dfdc
parent063190b6cbf154dd0eff78d07991b6a527441b92 (diff)
downloadgdb-e42acc6bba327bf99ac7c21dd3ab836495e18bcf.zip
gdb-e42acc6bba327bf99ac7c21dd3ab836495e18bcf.tar.gz
gdb-e42acc6bba327bf99ac7c21dd3ab836495e18bcf.tar.bz2
* tui-file.h (fputs_unfiltered_hook): Remove.
* tui-file.c (tui_file_flush): Remove fputs_unfiltered_hook. (tui_file_fputs): Likewise; simplify
-rw-r--r--gdb/tui/ChangeLog6
-rw-r--r--gdb/tui/tui-file.c82
-rw-r--r--gdb/tui/tui-file.h5
3 files changed, 13 insertions, 80 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 4d66f34..8d92af0 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-17 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * tui-file.h (fputs_unfiltered_hook): Remove.
+ * tui-file.c (tui_file_flush): Remove fputs_unfiltered_hook.
+ (tui_file_fputs): Likewise; simplify
+
2001-07-16 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* tuiStack.c: Add missing includes.
diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c
index 29f84f4..7e6f8ab 100644
--- a/gdb/tui/tui-file.c
+++ b/gdb/tui/tui-file.c
@@ -22,20 +22,10 @@
#include "ui-file.h"
#include "tui/tui-file.h"
-#ifdef TUI
#include "tui.h"
-#include "tuiData.h"
-#include "tuiIO.h"
-#include "tuiCommand.h"
-#endif
#include <string.h>
-/* Called instead of fputs for all TUI_FILE output. */
-
-void (*fputs_unfiltered_hook) (const char *linebuffer,
- struct ui_file * stream);
-
/* A ``struct ui_file'' that is compatible with all the legacy
code. */
@@ -176,66 +166,15 @@ void
tui_file_fputs (const char *linebuffer, struct ui_file *file)
{
struct tui_stream *stream = ui_file_data (file);
-#if defined(TUI)
- extern int tui_owns_terminal;
-#endif
- /* NOTE: cagney/1999-10-13: The use of fputs_unfiltered_hook is
- seriously discouraged. Those wanting to hook output should
- instead implement their own ui_file object and install that. See
- also tui_file_flush(). */
- if (fputs_unfiltered_hook
- && (file == gdb_stdout
- || file == gdb_stderr))
- fputs_unfiltered_hook (linebuffer, file);
+
+ if (stream->ts_streamtype == astring)
+ {
+ tui_file_adjust_strbuf (strlen (linebuffer), file);
+ strcat (stream->ts_strbuf, linebuffer);
+ }
else
{
-#if defined(TUI)
- if (tui_version && tui_owns_terminal)
- {
- /* If we get here somehow while updating the TUI (from
- * within a tuiDo(), then we need to temporarily
- * set up the terminal for GDB output. This probably just
- * happens on error output.
- */
-
- if (stream->ts_streamtype == astring)
- {
- tui_file_adjust_strbuf (strlen (linebuffer), file);
- strcat (stream->ts_strbuf, linebuffer);
- }
- else
- {
- tuiTermUnsetup (0, (tui_version) ? cmdWin->detail.commandInfo.curch : 0);
- fputs (linebuffer, stream->ts_filestream);
- tuiTermSetup (0);
- if (linebuffer[strlen (linebuffer) - 1] == '\n')
- tuiClearCommandCharCount ();
- else
- tuiIncrCommandCharCountBy (strlen (linebuffer));
- }
- }
- else
- {
- /* The normal case - just do a fputs() */
- if (stream->ts_streamtype == astring)
- {
- tui_file_adjust_strbuf (strlen (linebuffer), file);
- strcat (stream->ts_strbuf, linebuffer);
- }
- else
- fputs (linebuffer, stream->ts_filestream);
- }
-
-
-#else
- if (stream->ts_streamtype == astring)
- {
- tui_file_adjust_strbuf (strlen (linebuffer), file);
- strcat (stream->ts_strbuf, linebuffer);
- }
- else
- fputs (linebuffer, stream->ts_filestream);
-#endif
+ tuiPuts_unfiltered (linebuffer, file);
}
}
@@ -287,13 +226,6 @@ tui_file_flush (struct ui_file *file)
internal_error (__FILE__, __LINE__,
"tui_file_flush: bad magic number");
- /* NOTE: cagney/1999-10-12: If we've been linked with code that uses
- fputs_unfiltered_hook then we assume that it doesn't need to know
- about flushes. Code that does need to know about flushes can
- implement a proper ui_file object. */
- if (fputs_unfiltered_hook)
- return;
-
switch (stream->ts_streamtype)
{
case astring:
diff --git a/gdb/tui/tui-file.h b/gdb/tui/tui-file.h
index 8c43645..ea07297 100644
--- a/gdb/tui/tui-file.h
+++ b/gdb/tui/tui-file.h
@@ -26,9 +26,4 @@ extern struct ui_file *tui_sfileopen (int);
extern char *tui_file_get_strbuf (struct ui_file *);
extern void tui_file_adjust_strbuf (int, struct ui_file *);
-/* NOTE: cagney/1999-10-14: fputs_unfiltered_hook is deprecated. Code
- wanting to control GDB's output should override the gdb_std...
- files. */
-extern void (*fputs_unfiltered_hook) (const char *linebuffer,
- struct ui_file * stream);
#endif