public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Eliminate flush_hook...
@ 1999-10-13  1:47 Andrew Cagney
  1999-10-13  9:47 ` James Ingham
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 1999-10-13  1:47 UTC (permalink / raw)
  To: GDB Patches, Insight (GDB GUI)

OK?

This eliminates the flush_hook.  New code should be implementing the
``struct gdb_file'' object.  The old code never did anything useful with
flush_hook.

	Andrew


--

The patch is in three parts: gdb, tui, insight.

Wed Oct 13 17:58:20 1999  Andrew Cagney  <cagney@b1.cygnus.com>

        * gdb-events.sh: Update

        * utils.c (tui_file_flush): Don't call flush_hook.  Don't try to
        flush ``astring''.

        * top.c (flush_hook): Delete.


Wed Oct 13 18:01:52 1999  Andrew Cagney  <cagney@b1.cygnus.com>

        * tui.c (tuiInit): Don't initialize ``flush_hook''.


Wed Oct 13 17:57:17 1999  Andrew Cagney  <cagney@b1.cygnus.com>

        * gdbtk-hooks.c (gdbtk_flush): Delete.
        (gdbtk_add_hooks): Don't initialize flush_hook.

--
Wed Oct 13 17:58:20 1999  Andrew Cagney  <cagney@b1.cygnus.com>

	* gdb-events.sh: Update

	* utils.c (tui_file_flush): Don't call flush_hook.  Don't try to
 	flush ``astring''.

	* top.c (flush_hook): Delete.

Index: gdb-events.sh
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdb-events.sh,v
retrieving revision 2.1
diff -p -r2.1 gdb-events.sh
*** gdb-events.sh	1999/08/29 00:06:42	2.1
--- gdb-events.sh	1999/10/13 08:29:52
*************** f:void:breakpoint_modify:int b:b
*** 77,83 ****
  #*:void:print_frame_info_listing_hook:struct symtab *s, int line, int stopline, int noerror:s, line, stopline, noerror
  #*:int:query_hook:const char *query, va_list args:query, args
  #*:void:warning_hook:const char *string, va_list args:string, args
- #*:void:flush_hook:GDB_FILE *stream:stream
  #*:void:target_output_hook:char *b:b
  #*:void:interactive_hook:void
  #*:void:registers_changed_hook:void
--- 77,82 ----
Index: top.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/top.c,v
retrieving revision 2.164
diff -p -r2.164 top.c
*** top.c	1999/10/04 18:47:16	2.164
--- top.c	1999/10/13 08:30:05
*************** int (*query_hook) PARAMS ((const char *,
*** 397,406 ****
  
  void (*warning_hook) PARAMS ((const char *, va_list));
  
- /* Called from gdb_flush to flush output.  */
- 
- void (*flush_hook) PARAMS ((GDB_FILE * stream));
- 
  /* These three functions support getting lines of text from the user.  They
     are used in sequence.  First readline_begin_hook is called with a text
     string that might be (for example) a message for the user to type in a
--- 397,402 ----
Index: utils.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/utils.c,v
retrieving revision 1.211
diff -p -r1.211 utils.c
*** utils.c	1999/10/04 18:47:16	1.211
--- utils.c	1999/10/13 08:30:12
*************** tui_file_fputs (linebuffer, file)
*** 1875,1886 ****
  #if defined(TUI)
    extern int tui_owns_terminal;
  #endif
!   /* If anything (GUI, TUI) wants to capture GDB output, this is
!    * the place... the way to do it is to set up 
!    * fputs_unfiltered_hook.
!    * Our TUI ("gdb -tui") used to hook output, but in the
!    * new (XDB style) scheme, we do not do that anymore... - RT
!    */
    if (fputs_unfiltered_hook
        && (file == gdb_stdout
  	  || file == gdb_stderr))
--- 1875,1884 ----
  #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 gdb_file object and install that. See
!      also tui_file_flush(). */
    if (fputs_unfiltered_hook
        && (file == gdb_stdout
  	  || file == gdb_stderr))
*************** tui_file_flush (file)
*** 2028,2043 ****
  {
    struct tui_stream *stream = gdb_file_data (file);
    if (stream->ts_magic != &tui_file_magic)
!     error ("Internal error: bad magic number");
!   if (flush_hook
!       && (file == gdb_stdout
! 	  || file == gdb_stderr))
      {
!       flush_hook (file);
!       return;
      }
- 
-   fflush (stream->ts_filestream);
  }
  
  void
--- 2026,2046 ----
  {
    struct tui_stream *stream = gdb_file_data (file);
    if (stream->ts_magic != &tui_file_magic)
!     internal_error ("tui_file_flush: bad magic number");
! 
!   /* NOTE: cagney/1999-10-12: If this was hooked then don't bother
!      with flush.  */
!   if (fputs_unfiltered_hook)
!     return;
! 
!   switch (stream->ts_streamtype)
      {
!     case astring:
!       break;
!     case afile:
!       fflush (stream->ts_filestream);
!       break;
      }
  }
  
  void

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-10-13  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-13  1:47 Eliminate flush_hook Andrew Cagney
1999-10-13  9:47 ` James Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).