Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFA]: Cleanup tui/tui-file.[ch]
       [not found] <3B536421.C4F0E04D@worldnet.fr>
@ 2001-07-16 15:57 ` Andrew Cagney
  2001-07-17 10:19 ` Elena Zannoni
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2001-07-16 15:57 UTC (permalink / raw)
  To: Stephane Carrez; +Cc: gdb-patches

> Hi!
> 
> The following patch cleans up the tui/tui-file to remove the
> old and unused fputs_unfiltered_hook;  It also simplifies the
> implementation.
> 
> Can you approve this patch?


Yes fine.  Actually,


> -/* NOTE: cagney/1999-10-14: fputs_unfiltered_hook is deprecated.  Code
> -   wanting to control GDB's output should override the gdb_std...
> -   files. */

I think I'll go and get drunk. Ya, hic!

	Andrew


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

* Re: [RFA]: Cleanup tui/tui-file.[ch]
       [not found] <3B536421.C4F0E04D@worldnet.fr>
  2001-07-16 15:57 ` [RFA]: Cleanup tui/tui-file.[ch] Andrew Cagney
@ 2001-07-17 10:19 ` Elena Zannoni
       [not found]   ` <3B548825.773525AC@worldnet.fr>
  1 sibling, 1 reply; 5+ messages in thread
From: Elena Zannoni @ 2001-07-17 10:19 UTC (permalink / raw)
  To: Stephane Carrez; +Cc: gdb-patches

Stephane, 
I am getting a warning in tui-file.c (I am building with -Werror) about
tuiPuts_unfiltered being implicitly declared.
I think it is because you removed the #include "tuiIO.h".

Can I put it back?

Elena

PS. Great work, BTW!


2001-07-17  Elena Zannoni  <ezannoni@redhat.com>

	* Makefile.in (tui-file.o): Update dependencies.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.99
diff -u -p -r1.99 Makefile.in
--- Makefile.in	2001/07/16 14:46:34	1.99
+++ Makefile.in	2001/07/17 17:18:05
@@ -1995,7 +1995,8 @@ stack.o: stack.c $(defs_h) $(gdbcmd_h) $
 	language.h target.h $(gdb_string_h) $(ui_out_h)
 
 ui-file.o: ui-file.c $(defs_h) ui-file.h
-tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(srcdir)/tui/tui-file.h
+tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(srcdir)/tui/tui-file.h \
+	$(srcdir)/tui/tuiIO.h
 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c
 
 ax-general.o: ax-general.c $(ax_h) $(defs_h) $(value_h)


2001-07-17  Elena Zannoni  <ezannoni@redhat.com>

	* tui-file.c: Add include of tuiIO.h, for tuiPuts_unfiltered.

Index: tui-file.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-file.c,v
retrieving revision 1.7
diff -u -p -r1.7 tui-file.c
--- tui-file.c	2001/07/17 06:42:58	1.7
+++ tui-file.c	2001/07/17 17:11:50
@@ -21,6 +21,7 @@
 #include "defs.h"
 #include "ui-file.h"
 #include "tui/tui-file.h"
+#include "tui/tuiIO.h"
 
 #include "tui.h"
 


Stephane Carrez writes:
 > Hi!
 > 
 > The following patch cleans up the tui/tui-file to remove the
 > old and unused fputs_unfiltered_hook;  It also simplifies the
 > implementation.
 > 
 > Can you approve this patch?
 > 
 > 	Stephane
 > 
 > 2001-07-16  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; simplifyIndex: tui-file.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/tui/tui-file.c,v
 > retrieving revision 1.6
 > diff -u -p -r1.6 tui-file.c
 > --- tui-file.c	2001/02/08 06:03:54	1.6
 > +++ tui-file.c	2001/07/16 21:52:08
 > @@ -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);
 >      }
 >  }
 >  
 > @@ -286,13 +225,6 @@ tui_file_flush (struct ui_file *file)
 >    if (stream->ts_magic != &tui_file_magic)
 >      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)
 >      {
 > Index: tui-file.h
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/tui/tui-file.h,v
 > retrieving revision 1.2
 > diff -u -p -r1.2 tui-file.h
 > --- tui-file.h	2001/03/06 08:22:01	1.2
 > +++ tui-file.h	2001/07/16 21:52:08
 > @@ -26,9 +26,4 @@ extern struct ui_file *tui_sfileopen (in
 >  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


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

* Re: [RFA]: Cleanup tui/tui-file.[ch]
       [not found]   ` <3B548825.773525AC@worldnet.fr>
@ 2001-07-17 11:52     ` Andrew Cagney
  2001-07-17 13:40       ` Elena Zannoni
  2001-07-17 13:23     ` Elena Zannoni
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2001-07-17 11:52 UTC (permalink / raw)
  To: Stephane Carrez; +Cc: Elena Zannoni, gdb-patches

> Ah!!!  The marvellous -Werror that I'm currently figthing with in ChorusOS
> to remove all our warnings..... ... ...
> 
> 
>> I think it is because you removed the #include "tuiIO.h".
>> 
>> Can I put it back?
> 
> 
> Sure!


Hmm, is tui-file now only needed when the TUI is included?

	Andrew


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

* Re: [RFA]: Cleanup tui/tui-file.[ch]
       [not found]   ` <3B548825.773525AC@worldnet.fr>
  2001-07-17 11:52     ` Andrew Cagney
@ 2001-07-17 13:23     ` Elena Zannoni
  1 sibling, 0 replies; 5+ messages in thread
From: Elena Zannoni @ 2001-07-17 13:23 UTC (permalink / raw)
  To: Stephane Carrez; +Cc: Elena Zannoni, gdb-patches

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

Stephane Carrez writes:
 > Hi!
 > 
 > Elena Zannoni a écrit :
 > > 
 > > Stephane,
 > > I am getting a warning in tui-file.c (I am building with -Werror) about
 > > tuiPuts_unfiltered being implicitly declared.
 > 
 > Ah!!!  The marvellous -Werror that I'm currently figthing with in ChorusOS
 > to remove all our warnings..... ... ...
 > 
 > > I think it is because you removed the #include "tuiIO.h".
 > > 
 > > Can I put it back?
 > 
 > Sure!
 > 
 > 	Stephane

It's in.
Thanks
Elena


 > 
 > -----------------------------------------------------------------------
 >          Home                               Office
 > E-mail: stcarrez@worldnet.fr               Stephane.Carrez@sun.com
 > WWW:    http://home.worldnet.fr/stcarrez   http://www.sun.com
 > Mail:   17, rue Foucher Lepelletier        6, avenue Gustave Eiffel
 >         92130 Issy Les Moulineaux          78182 Saint Quentin en Yvelines
 >         France


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

* Re: [RFA]: Cleanup tui/tui-file.[ch]
  2001-07-17 11:52     ` Andrew Cagney
@ 2001-07-17 13:40       ` Elena Zannoni
  0 siblings, 0 replies; 5+ messages in thread
From: Elena Zannoni @ 2001-07-17 13:40 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Stephane Carrez, Elena Zannoni, gdb-patches

Andrew Cagney writes:
 > 
 > > Ah!!!  The marvellous -Werror that I'm currently figthing with in ChorusOS
 > > to remove all our warnings..... ... ...
 > > 
 > > 
 > >> I think it is because you removed the #include "tuiIO.h".
 > >> 
 > >> Can I put it back?
 > > 
 > > 
 > > Sure!
 > 
 > 
 > Hmm, is tui-file now only needed when the TUI is included?
 > 
 > 	Andrew


Looks that way. Another thought is that now we can get rid
of some the *_base_* functions that were added for the TUI. For
instance, print_frame_info_base and print_frame_info.

From the HP merge changelog (1998), just random grepping for _base:

	* source.c :(print_source_lines): Rename to
	print_source_lines_base and make static; formatting.
	(print_source_lines): New function.

	* stack.c (down_silently_base, up_silently_base,
 	args_plus_locals_info, print_frame_info_base,
 	print_stack_frame_base, print_stack_frame_base_stub): Declare.
	(print_stack_frame_stub): New version created, old version renamed
 	to show_and_print_stack_frame_base_stub.
	(print_stack_frame_base_stub, print_only_stack_frame_stub,
 	show_and_print_stack_frame, print_only_stack_frame,
 	stack_publish_stopped_with_no_frame, print_frame_info,
 	show_stack_frame, backtrace_full_command, args_plus_locals_info,
	select_and_print_frame, select_and_maybe_print_frame,
	current_frame_command, func_command): New functions.
	(backtrace_command): New function, old renamed to
	backtrace_command_1.
	(print_block_frame_locals, print_frame_local_vars): Additional
	parameter, number of tabs.
	(up_silently_command): New function, old renamed to
	up_silently_command_base.
	(down_silently_command): New function, old renamed to
	down_silently_base.

Elena


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

end of thread, other threads:[~2001-07-17 13:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3B536421.C4F0E04D@worldnet.fr>
2001-07-16 15:57 ` [RFA]: Cleanup tui/tui-file.[ch] Andrew Cagney
2001-07-17 10:19 ` Elena Zannoni
     [not found]   ` <3B548825.773525AC@worldnet.fr>
2001-07-17 11:52     ` Andrew Cagney
2001-07-17 13:40       ` Elena Zannoni
2001-07-17 13:23     ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox