From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9117 invoked by alias); 30 Aug 2006 11:13:44 -0000 Received: (qmail 9108 invoked by uid 22791); 30 Aug 2006 11:13:44 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-02.spheriq.net (HELO fra-del-02.spheriq.net) (195.46.51.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Aug 2006 11:13:41 +0000 Received: from fra-out-02.spheriq.net (fra-out-02.spheriq.net [195.46.51.130]) by fra-del-02.spheriq.net with ESMTP id k7UBDa64018136 for ; Wed, 30 Aug 2006 11:13:36 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-02.spheriq.net with ESMTP id k7UBDYOV029578 for ; Wed, 30 Aug 2006 11:13:34 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id k7UBDUVK021029 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 30 Aug 2006 11:13:34 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 41123DA53; Wed, 30 Aug 2006 11:13:23 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DA182473C9; Wed, 30 Aug 2006 11:12:54 +0000 (GMT) Received: from crx549.cro.st.com (crx549.cro.st.com [164.129.44.49]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CIH89364 (AUTH "frederic riss"); Wed, 30 Aug 2006 13:12:54 +0200 (CEST) Subject: Re: How to call operator<< functions? From: Frederic RISS To: Michael Veksler Cc: gdb@sourceware.org In-Reply-To: <44F5645F.4000301@tx.technion.ac.il> References: <44F5645F.4000301@tx.technion.ac.il> Content-Type: text/plain Date: Wed, 30 Aug 2006 11:13:00 -0000 Message-Id: <1156936373.3429.250.camel@crx549.cro.st.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00238.txt.bz2 On Wed, 2006-08-30 at 13:11 +0300, Michael Veksler wrote: > Passing 'std::cout' seems impossible. Any attempt to pass std::cout > crashes. To overcome this I define my own global > ostream gecLog(cout.rdbuf()); > (or something similar) and recompile the code. This lets me pass gecLog > instead of cout, and it _sometimes_ works: Just to reply to this little part. I've already encountered the issue with cout. In my case the _ZSt4cout symbol was present in the debugged binary and (obviously) in libstdc++. I _think_ that GDB resolved _ZSt4cout as if the symbol in the library was used whereas the one in the executable was the right one. I can't remember the reasons for this right now. As a workaround, I passed '*(ostream*)' in place of std::cout. I found using nm on my binary. This seemed to work if I remember well. It's been a while though... Hope this helps, Fred.