From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15654 invoked by alias); 3 Apr 2009 07:55:47 -0000 Received: (qmail 15564 invoked by uid 22791); 3 Apr 2009 07:55:46 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_83,J_CHICKENPOX_93,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: sourceware.org Received: from relay-pt2.poste.it (HELO relay-pt2.poste.it) (62.241.5.253) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Apr 2009 07:55:44 +0000 Received: from geppetto.reilabs.com (212.123.91.176) by relay-pt2.poste.it (7.3.122) (authenticated as stefano.sabatini-lala@poste.it) id 49D543F100002FA4; Fri, 3 Apr 2009 09:55:33 +0200 Received: from stefano by geppetto.reilabs.com with local (Exim 4.67) (envelope-from ) id 1LpeFC-0000lQ-J2; Fri, 03 Apr 2009 09:55:18 +0200 Date: Fri, 03 Apr 2009 10:04:00 -0000 From: Stefano Sabatini To: gdb@sourceware.org, gdb Mailing List Subject: Re: C++ and "no data fields" when printing objects Message-ID: <20090403075518.GA993@geppetto> Mail-Followup-To: gdb@sourceware.org, gdb Mailing List References: <20090402132811.GA9472@geppetto> <20090402185220.GA8273@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090402185220.GA8273@caradoc.them.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00035.txt.bz2 On date Thursday 2009-04-02 14:52:20 -0400, Daniel Jacobowitz wrote: > On Thu, Apr 02, 2009 at 03:28:11PM +0200, Stefano Sabatini wrote: > > 1) which are the conditions under which the abovementioned problem > > occurrs (e.g. with shared/static lib, with some arch, only with some > > compiler+flags/binary format)? > > I have no idea; it doesn't happen to me. In your searching did you > find any bugs in bugzilla describing this problem? If not, do you > have any test where you can demonstrate it? OK I found #9222. And here is how I can reproduce it, I'll try to work out a more minimal issue case. ---------------8<------------------------------------------------ #include #include #include #include class Test : public PProcess { PCLASSINFO(Test, PProcess) public: void Main(void); }; class SafeThing : public PSafeObject { public: SafeThing(int bar, int foo) : m_Bar(bar), m_Foo(foo) { } virtual void PrintOn(ostream &strm) const { strm << "foo(" << m_Foo << ") " << "bar(" << m_Bar << ") "; } private: int m_Bar; int m_Foo; }; PCREATE_PROCESS(Test) void Test::Main(void) { PSafePtr ptr; cout << "ptr: " << ptr << endl; if (!!ptr) cout << *ptr << endl; return; } ------------------------------8<------------------------------- Informations on the system: stefano@geppetto ~/s/ptlib> uname -a Linux geppetto 2.6.26-1-686 #1 SMP Sat Oct 18 16:22:25 UTC 2008 i686 GNU/Linux stefano@geppetto ~/s/ptlib> g++ --version g++ (Debian 4.3.2-1) 4.3.2 Compilation command performed: g++ -DPTRACING=1 -D_REENTRANT -D_GNU_SOURCE=1 -fno-exceptions -I/home/stefano/include -I/usr/include/SDL -g -O0 -ggdb -L/home/stefano/lib -lpt -lpthread -lsasl2 -lldap -llber -lldap_r -lssl -lcrypto -lexpat -lSDL -lresolv -ldl psafeptr.cxx -o psafeptr And here it is my gdb output: (gdb) show version GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". (gdb) file psafeptr (gdb) b Test::Main Breakpoint 9 at 0x8049886: file psafeptr.cxx, line 35. (gdb) r [Thread debugging using libthread_db enabled] [New Thread 0xb74236c0 (LWP 2490)] [Switching to Thread 0xb74236c0 (LWP 2490)] Breakpoint 7, main (argc=1, argv=0xbfc45474, envp=0xbfc4547c) at psafeptr.cxx:31 warning: Source file is more recent than executable. (gdb) n Breakpoint 8, Test::Main (this=0x9f4f000) at psafeptr.cxx:35 (gdb) p ptr $15 = { <> = {}, } (gdb) I'm using the latest SVN libpt (but I don't think it depends on the version used, since it shows up also with a very ancient version of it), and yes I compiled the lib with -ggdb -00 (compiled with make debugshared). Regards. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15123 invoked by alias); 3 Apr 2009 07:55:43 -0000 Received: (qmail 15113 invoked by uid 22791); 3 Apr 2009 07:55:42 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_83,J_CHICKENPOX_93,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: sourceware.org Received: from relay-pt2.poste.it (HELO relay-pt2.poste.it) (62.241.5.253) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Apr 2009 07:55:37 +0000 Received: from geppetto.reilabs.com (212.123.91.176) by relay-pt2.poste.it (7.3.122) (authenticated as stefano.sabatini-lala@poste.it) id 49D543F100002FA4; Fri, 3 Apr 2009 09:55:33 +0200 Received: from stefano by geppetto.reilabs.com with local (Exim 4.67) (envelope-from ) id 1LpeFC-0000lQ-J2; Fri, 03 Apr 2009 09:55:18 +0200 Date: Fri, 03 Apr 2009 07:55:00 -0000 From: Stefano Sabatini To: gdb@sourceware.org, gdb Mailing List Subject: Re: C++ and "no data fields" when printing objects Message-ID: <20090403075518.GA993@geppetto> Mail-Followup-To: gdb@sourceware.org, gdb Mailing List References: <20090402132811.GA9472@geppetto> <20090402185220.GA8273@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090402185220.GA8273@caradoc.them.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00034.txt.bz2 Message-ID: <20090403075500.6EG0Hkp_CtBvV5UYoqo6EfQfzvU9udE27o8Cfl7wRvk@z> On date Thursday 2009-04-02 14:52:20 -0400, Daniel Jacobowitz wrote: > On Thu, Apr 02, 2009 at 03:28:11PM +0200, Stefano Sabatini wrote: > > 1) which are the conditions under which the abovementioned problem > > occurrs (e.g. with shared/static lib, with some arch, only with some > > compiler+flags/binary format)? > > I have no idea; it doesn't happen to me. In your searching did you > find any bugs in bugzilla describing this problem? If not, do you > have any test where you can demonstrate it? OK I found #9222. And here is how I can reproduce it, I'll try to work out a more minimal issue case. ---------------8<------------------------------------------------ #include #include #include #include class Test : public PProcess { PCLASSINFO(Test, PProcess) public: void Main(void); }; class SafeThing : public PSafeObject { public: SafeThing(int bar, int foo) : m_Bar(bar), m_Foo(foo) { } virtual void PrintOn(ostream &strm) const { strm << "foo(" << m_Foo << ") " << "bar(" << m_Bar << ") "; } private: int m_Bar; int m_Foo; }; PCREATE_PROCESS(Test) void Test::Main(void) { PSafePtr ptr; cout << "ptr: " << ptr << endl; if (!!ptr) cout << *ptr << endl; return; } ------------------------------8<------------------------------- Informations on the system: stefano@geppetto ~/s/ptlib> uname -a Linux geppetto 2.6.26-1-686 #1 SMP Sat Oct 18 16:22:25 UTC 2008 i686 GNU/Linux stefano@geppetto ~/s/ptlib> g++ --version g++ (Debian 4.3.2-1) 4.3.2 Compilation command performed: g++ -DPTRACING=1 -D_REENTRANT -D_GNU_SOURCE=1 -fno-exceptions -I/home/stefano/include -I/usr/include/SDL -g -O0 -ggdb -L/home/stefano/lib -lpt -lpthread -lsasl2 -lldap -llber -lldap_r -lssl -lcrypto -lexpat -lSDL -lresolv -ldl psafeptr.cxx -o psafeptr And here it is my gdb output: (gdb) show version GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". (gdb) file psafeptr (gdb) b Test::Main Breakpoint 9 at 0x8049886: file psafeptr.cxx, line 35. (gdb) r [Thread debugging using libthread_db enabled] [New Thread 0xb74236c0 (LWP 2490)] [Switching to Thread 0xb74236c0 (LWP 2490)] Breakpoint 7, main (argc=1, argv=0xbfc45474, envp=0xbfc4547c) at psafeptr.cxx:31 warning: Source file is more recent than executable. (gdb) n Breakpoint 8, Test::Main (this=0x9f4f000) at psafeptr.cxx:35 (gdb) p ptr $15 = { <> = {}, } (gdb) I'm using the latest SVN libpt (but I don't think it depends on the version used, since it shows up also with a very ancient version of it), and yes I compiled the lib with -ggdb -00 (compiled with make debugshared). Regards.