From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20820 invoked by alias); 21 Aug 2003 21:28:31 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 20813 invoked from network); 21 Aug 2003 21:28:30 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 21 Aug 2003 21:28:30 -0000 Received: from redhat.com (topaz.toronto.redhat.com [172.16.14.227]) by touchme.toronto.redhat.com (Postfix) with ESMTP id ED153800340 for ; Thu, 21 Aug 2003 17:28:29 -0400 (EDT) Message-ID: <3F45397D.4070508@redhat.com> Date: Thu, 21 Aug 2003 21:28:00 -0000 From: Dave Brolley Organization: Red Hat Canada, Ltd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021216 X-Accept-Language: en-us, en MIME-Version: 1.0 To: sid@sources.redhat.com Subject: cgen_bi_endian_cpu::end_trace Content-Type: multipart/mixed; boundary="------------000501020206050507090400" X-SW-Source: 2003-q3/txt/msg00016.txt.bz2 This is a multi-part message in MIME format. --------------000501020206050507090400 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 642 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 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 --------------000501020206050507090400 Content-Type: text/plain; name="sidtrace.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sidtrace.patch.txt" Content-length: 1642 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 (s) << t; return s; } --- 618,624 ---- if (LIKELY (s.cout_p)) std::cout << t; else ! static_cast (s) << t; return s; } --------------000501020206050507090400--