From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13132 invoked by alias); 12 Jan 2007 21:50:46 -0000 Received: (qmail 13119 invoked by uid 22791); 12 Jan 2007 21:50:45 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Jan 2007 21:50:41 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8) with ESMTP id l0CLoRiW008727; Fri, 12 Jan 2007 22:50:27 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id l0CLoRue029795; Fri, 12 Jan 2007 22:50:27 +0100 (CET) Date: Fri, 12 Jan 2007 21:50:00 -0000 Message-Id: <200701122150.l0CLoRue029795@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org In-reply-to: <20070112201706.GA2673@nevyn.them.org> (message from Daniel Jacobowitz on Fri, 12 Jan 2007 15:17:06 -0500) Subject: Re: [ob] Adjust member pointer test for g++ 3.3 References: <20070112201706.GA2673@nevyn.them.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00322.txt.bz2 > Date: Fri, 12 Jan 2007 15:17:06 -0500 > From: Daniel Jacobowitz > > Mark noticed that this test failed on G++ 3.3 because it warns that > all of Padding's member functions are private. Easily avoided. > I imagine g++ 4.x moved or removed this warning intentionally; not > so useful here... Thanks Daniel, The test now runs for me, but I get quite a few errors. Here's the resulting bit from gdb.log. Can you spot what's going wromg here? Should we XFAIL this test for GCC 3.3? Running ../../../../src/gdb/gdb/testsuite/gdb.cp/member-ptr.exp ... get_compiler_info: gcc-3-3-5 Executing on host: g++ ../../../../src/gdb/gdb/testsuite/gdb.cp/member-ptr.cc -L/home/kettenis/obj/gdb/libiberty -g -lm -o /home/kettenis/obj/gdb/gdb/testsuite/gdb.cp/member-ptr (timeout = 300) GNU gdb 6.6.50.20070112-cvs Copyright (C) 2007 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-unknown-openbsd4.0". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir ../../../../src/gdb/gdb/testsuite/gdb.cp Source directories searched: /home/kettenis/obj/gdb/gdb/testsuite/../../../../src/gdb/gdb/testsuite/gdb.cp:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/kettenis/obj/gdb/gdb/testsuite/gdb.cp/member-ptr Reading symbols from /home/kettenis/obj/gdb/gdb/testsuite/gdb.cp/member-ptr...done. (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break main Breakpoint 1 at 0x1c000c05: file ../../../../src/gdb/gdb/testsuite/gdb.cp/member-ptr.cc, line 150. (gdb) run Starting program: /home/kettenis/obj/gdb/gdb/testsuite/gdb.cp/member-ptr Breakpoint 1, main () at ../../../../src/gdb/gdb/testsuite/gdb.cp/member-ptr.cc:150 150 A a; (gdb) break 199 Breakpoint 2 at 0x1c000cee: file ../../../../src/gdb/gdb/testsuite/gdb.cp/member-ptr.cc, line 199. (gdb) continue Continuing. Breakpoint 2, main () at ../../../../src/gdb/gdb/testsuite/gdb.cp/member-ptr.cc:199 199 pmi = NULL; /* Breakpoint 1 here. */ (gdb) PASS: gdb.cp/member-ptr.exp: continue to breakpoint: continue to pmi = NULL ptype pmi type = int A::** (gdb) FAIL: gdb.cp/member-ptr.exp: ptype pmi (A::j) print pmi $1 = (PMI) 0x8 (gdb) FAIL: gdb.cp/member-ptr.exp: print pmi (A::j) print a.*pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a.*pmi (A::j) print a_p->*pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a_p->*pmi (A::j) set var pmi = &A::jj (gdb) PASS: gdb.cp/member-ptr.exp: set var pmi = &A::jj print pmi $2 = (PMI) 0xc (gdb) FAIL: gdb.cp/member-ptr.exp: print pmi (A::jj) print a.*pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a.*pmi (A::jj) set var pmi = &A::j (gdb) PASS: gdb.cp/member-ptr.exp: set var pmi = &A::j print a.*pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a.*pmi (A::j) (again) print a.*pmi = 33 non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a.*pmi = 33 print a.*pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a.*pmi (A::j) (33) print a $3 = {_vptr$A = 0x3c000098, c = 120 'x', j = 121, jj = 1331, static s = 10} (gdb) KFAIL: gdb.cp/member-ptr.exp: print a (j = 33) (PRMS: gdb/NNNN) print a_p->*pmi = 44 non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a_p->*pmi = 44 print a_p->*pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print a_p->*pmi (44) print a $4 = {_vptr$A = 0x3c000098, c = 120 'x', j = 121, jj = 1331, static s = 10} (gdb) KFAIL: gdb.cp/member-ptr.exp: print a (j = 44) (PRMS: gdb/NNNN) ptype a.*pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: ptype a.*pmi print *pmi Cannot access memory at address 0x8 (gdb) KFAIL: gdb.cp/member-ptr.exp: print *pmi (PRMS: gdb/NNNN) ptype *pmi type = int A::* (gdb) FAIL: gdb.cp/member-ptr.exp: ptype *pmi print (int) pmi $5 = 8 (gdb) PASS: gdb.cp/member-ptr.exp: print (int) pmi print ((int) pmi) == ((char *) &a.j - (char *) & a) $6 = true (gdb) PASS: gdb.cp/member-ptr.exp: print ((int) pmi) == ((char *) &a.j - (char *) &a) ptype pmf type = int (A::*)(A *, int) (gdb) PASS: gdb.cp/member-ptr.exp: ptype pmf print pmf $7 = 0x1c000af6 (gdb) PASS: gdb.cp/member-ptr.exp: print pmf ptype pmf_p type = int (A::**)(A *, int) (gdb) PASS: gdb.cp/member-ptr.exp: ptype pmf_p print pmf_p $8 = (PMF *) 0xcf7cf2c0 (gdb) PASS: gdb.cp/member-ptr.exp: gdb/NNNN print a.*pmf $9 = {int (A *, int)} 0x1c000af6 (gdb) PASS: gdb.cp/member-ptr.exp: print a.*pmf print a_p->*pmf $10 = {int (A *, int)} 0x1c000af6 (gdb) PASS: gdb.cp/member-ptr.exp: print a_p->*pmf set var pmf = &A::foo (gdb) PASS: gdb.cp/member-ptr.exp: set var pmf = &A::foo print *pmf Attempt to dereference pointer to member without an object (gdb) PASS: gdb.cp/member-ptr.exp: print *pmf ptype *pmf Attempt to dereference pointer to member without an object (gdb) PASS: gdb.cp/member-ptr.exp: ptype *pmf print (a.*pmf)(3) $11 = 127 (gdb) FAIL: gdb.cp/member-ptr.exp: print (a.*pmf)(3) print diamond_pmi $12 = (int Diamond::**) 0xc (gdb) FAIL: gdb.cp/member-ptr.exp: print diamond_pmi print diamond.*diamond_pmi non-pointer-to-member value used in pointer-to-member construct (gdb) FAIL: gdb.cp/member-ptr.exp: print diamond.*diamond_pmi print diamond.*left_pmf $13 = {int (Diamond *)} 0x1c000b9c (gdb) PASS: gdb.cp/member-ptr.exp: print diamond.*left_pmf print diamond.*right_pmf $14 = {int (Diamond *)} 0x1c000b9c (gdb) PASS: gdb.cp/member-ptr.exp: print diamond.*right_pmf print (diamond.*left_pmf) () $15 = 77 (gdb) PASS: gdb.cp/member-ptr.exp: print (diamond.*left_pmf) () print (diamond.*right_pmf) () $16 = 88 (gdb) PASS: gdb.cp/member-ptr.exp: print (diamond.*right_pmf) () print diamond.*left_vpmf $17 = {int (Diamond *)} 0x1c000bb8 (gdb) PASS: gdb.cp/member-ptr.exp: print diamond.*left_vpmf print diamond.*right_vpmf $18 = {int (Diamond *)} 0x1c000bc6 (gdb) PASS: gdb.cp/member-ptr.exp: print diamond.*right_vpmf print (diamond.*left_vpmf) () $19 = 177 (gdb) PASS: gdb.cp/member-ptr.exp: print (diamond.*left_vpmf) () print (diamond.*left_base_vpmf) () $20 = 2077 (gdb) PASS: gdb.cp/member-ptr.exp: print (diamond.*left_base_vpmf) () print (diamond.*right_vpmf) () $21 = 288 (gdb) PASS: gdb.cp/member-ptr.exp: print (diamond.*right_vpmf) () print left_vpmf $22 = &virtual Left::vget() (gdb) PASS: gdb.cp/member-ptr.exp: print left_vpmf print right_vpmf $23 = &virtual Right::vget() (gdb) PASS: gdb.cp/member-ptr.exp: print right_vpmf print base_vpmf $24 = &virtual table offset 4, this adjustment -8 (gdb) PASS: gdb.cp/member-ptr.exp: print base_vpmf print diamond.*left_vpmf () Invalid data type for function to be called. (gdb) PASS: gdb.cp/member-ptr.exp: print diamond.*left_vpmf () print null_pmi $25 = (PMI) 0xffffffff (gdb) FAIL: gdb.cp/member-ptr.exp: print null_pmi print null_pmi = &A::j $26 = (int A::**) 0x8 (gdb) FAIL: gdb.cp/member-ptr.exp: print null_pmi = &A::j print null_pmi = 0 $27 = (int A::**) 0x0 (gdb) FAIL: gdb.cp/member-ptr.exp: print null_pmi = 0 print null_pmf $28 = NULL (gdb) PASS: gdb.cp/member-ptr.exp: print null_pmf print null_pmf = &A::foo $29 = 0x1c000ad8 (gdb) PASS: gdb.cp/member-ptr.exp: print null_pmf = &A::foo print null_pmf = 0 $30 = NULL (gdb) PASS: gdb.cp/member-ptr.exp: print null_pmf = 0 testcase ../../../../src/gdb/gdb/testsuite/gdb.cp/member-ptr.exp completed in 2 seconds