From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5383 invoked by alias); 31 Aug 2006 13:02:59 -0000 Received: (qmail 5327 invoked by uid 22791); 31 Aug 2006 13:02:57 -0000 X-Spam-Check-By: sourceware.org Received: from mailgw2.technion.ac.il (HELO mailgw2.technion.ac.il) (132.68.238.33) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 Aug 2006 13:02:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgw2.technion.ac.il (Postfix) with ESMTP id 3C5A9390405; Thu, 31 Aug 2006 16:02:50 +0300 (IDT) Received: from mailgw2.technion.ac.il ([127.0.0.1]) by localhost (mailgw2.technion.ac.il [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3KrNxaXDteap; Thu, 31 Aug 2006 16:02:50 +0300 (IDT) Received: from techunix.technion.ac.il (techunix.technion.ac.il [132.68.1.28]) by mailgw2.technion.ac.il (Postfix) with ESMTP id 704793904AC; Thu, 31 Aug 2006 16:02:49 +0300 (IDT) Received: from [127.0.0.1] (techunix.technion.ac.il [132.68.1.28]) by techunix.technion.ac.il (Postfix) with ESMTP id 2F78714991; Thu, 31 Aug 2006 16:02:49 +0300 (IDT) (envelope-from mveksler@tx.technion.ac.il) Message-ID: <44F6DDF8.9000703@tx.technion.ac.il> Date: Thu, 31 Aug 2006 13:02:00 -0000 From: Michael Veksler User-Agent: Thunderbird 1.5.0.5 (X11/20060726) MIME-Version: 1.0 To: Frederic RISS Cc: gdb@sourceware.org Subject: Re: Get versioned minsyms from dynamic symtab (Was: Re: How to call operator<< functions?) References: <44F5645F.4000301@tx.technion.ac.il> <1156936373.3429.250.camel@crx549.cro.st.com> <1156944608.3429.275.camel@crx549.cro.st.com> <1157024034.3429.303.camel@crx549.cro.st.com> <44F6D16B.7090001@tx.technion.ac.il> <1157027172.3429.309.camel@crx549.cro.st.com> In-Reply-To: <1157027172.3429.309.camel@crx549.cro.st.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00275.txt.bz2 Frederic RISS wrote: > On Thu, 2006-08-31 at 15:09 +0300, Michael Veksler wrote: > > >> Great, now std::cout does not cause crashes. Still there is the problem of >> >> (gdb) p std::cout >> $1 = >> >> But that's unrelated, right? >> > > Yes, unrelated. > This should work if you've got a version of libstdc++ compiled with > debug info. If you don't, then GDB can't find std::cout's type. This > works for me once the library is loaded (i.e. once the inferior is > running): > > Sounds reasonable, however look at the end for my test. > (gdb) ptype std::cout > type = struct std::basic_ostream > { > > } > (gdb) start > ... > (gdb) ptype std::cout > type = class std::basic_ostream > > : public virtual std::basic_ios > { > Take the two files from my test case in: http://sources.redhat.com/ml/gdb/2006-08/msg00271.html => gdb-6.5 -silent a.out Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) b 30 Breakpoint 1 at 0x8048a62: file cout-gdb.cpp, line 30. (gdb) r Starting program: /home/veksler/a.out Enter B::Print() this=0xbfffec00 Breakpoint 1, main () at cout-gdb.cpp:30 warning: Source file is more recent than executable. 30 return forceLink; (gdb) p x.Print(std::cout) Enter B::Print() this=0xbfffec00 $1 = void (gdb) p x.Print(myCout) Cannot resolve method B::Print to any overloaded instance (gdb) p x.Print(std::cout) Cannot resolve method B::Print to any overloaded instance (gdb) ============== What is going on here. Why the second Print(std::cout) no longer works? Let's try to rerun without exiting GDB: ============= (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /home/veksler/a.out Enter B::Print() this=0xbfffec00 Breakpoint 1, main () at cout-gdb.cpp:30 30 return forceLink; (gdb) p x.Print(std::cout) Cannot resolve method B::Print to any overloaded instance (gdb) =========== Still does not work!? Is it related to your patch? Michael