public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: Dave Brolley <brolley@redhat.com>
To: sid@sources.redhat.com
Subject: cgen_bi_endian_cpu::end_trace
Date: Thu, 21 Aug 2003 21:28:00 -0000	[thread overview]
Message-ID: <3F45397D.4070508@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

I've comitted the attached patch (approved by fche)  which addresses a 
problem when building sid with recent gcc compilers. The problem is that

    this->trace_stream << endl;

does not call

   template <typename T>
    basic_cpu::cpu_trace_stream& operator<< 
(basic_cpu::cpu_trace_stream& s, T t)

as expected. As a result, sid's tracing output comes out all on one line 
when tracing is to cout. The patch defines a new method of 
basic_cpu::cpu_trace_stream which can be explicitely called to avoid the 
ambiguity.

The patch also changes an unnecessary dynamic_cast to a static_cast. 
Something we noticed while investigating.

Dave


[-- Attachment #2: sidtrace.patch.txt --]
[-- Type: text/plain, Size: 1642 bytes --]

Index: sid/component/cgen-cpu/compCGEN.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/compCGEN.cxx,v
retrieving revision 1.11
diff -c -p -r1.11 compCGEN.cxx
*** sid/component/cgen-cpu/compCGEN.cxx	15 Jan 2003 20:04:57 -0000	1.11
--- sid/component/cgen-cpu/compCGEN.cxx	21 Aug 2003 21:20:25 -0000
*************** cgen_bi_endian_cpu::begin_trace (PCADDR 
*** 250,256 ****
  void
  cgen_bi_endian_cpu::end_trace ()
  {
!   this->trace_stream << endl;
  }
  
  // Counter support
--- 250,256 ----
  void
  cgen_bi_endian_cpu::end_trace ()
  {
!   trace_stream.end_line ();
  }
  
  // Counter support
Index: sid/include/sidcpuutil.h
===================================================================
RCS file: /cvs/src/src/sid/include/sidcpuutil.h,v
retrieving revision 1.25
diff -c -p -r1.25 sidcpuutil.h
*** sid/include/sidcpuutil.h	16 Apr 2003 18:15:16 -0000	1.25
--- sid/include/sidcpuutil.h	21 Aug 2003 21:20:27 -0000
*************** namespace sidutil
*** 227,232 ****
--- 227,239 ----
  	std::ofstream::open (filename.c_str (), std::ios::app);
  	cout_p = false;
        }
+       void end_line ()
+       {
+ 	if (LIKELY (cout_p))
+ 	  std::cout << std::endl;
+ 	else
+ 	  *this << std::endl;
+       }
        bool cout_p;
      };
  
*************** public:
*** 611,617 ****
        if (LIKELY (s.cout_p))
  	std::cout << t;
        else
! 	dynamic_cast <std::ofstream&> (s) << t;
        return s;
      }
    
--- 618,624 ----
        if (LIKELY (s.cout_p))
  	std::cout << t;
        else
! 	static_cast <std::ofstream&> (s) << t;
        return s;
      }
    

                 reply	other threads:[~2003-08-21 21:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F45397D.4070508@redhat.com \
    --to=brolley@redhat.com \
    --cc=sid@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).