From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32301 invoked by alias); 22 Aug 2002 17:09:57 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32291 invoked from network); 22 Aug 2002 17:09:57 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 22 Aug 2002 17:09:57 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g7MH9kp10331; Thu, 22 Aug 2002 10:09:46 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com, mec@shout.net Subject: Re: [rfa/c++testsuite] (was Re: patch for PR gdb/574) References: <15676.21042.125481.349851@jackfruit.Stanford.EDU> <20020816032649.GA30528@nevyn.them.org> Cc: carlton@math.stanford.edu From: David Carlton Date: Thu, 22 Aug 2002 10:10:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2002-08/txt/msg00694.txt.bz2 --=-=-= Content-length: 754 In article , David Carlton writes: > In article <20020816032649.GA30528@nevyn.them.org>, Daniel Jacobowitz > writes: >> Also, I'd appreciate it if you would submit a testsuite patch to run >> the reduced testcase you wrote. More tests are always good. > Here it is. The bug seemed idiosyncratic enough to not really fit > into any of the files or into any other general schema that I could > think of, so I just put it in a new file named after the bug number. Here's a slightly revised version. David Carlton carlton@math.stanford.edu 2002-08-22 David Carlton * gdb.c++/pr-574.exp: New file. * gdb.c++/pr-574.cc: New file. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pr-574.exp.diff Content-Description: new file: pr-574.exp Content-length: 2107 --- /dev/null Thu Apr 11 07:25:15 2002 +++ pr-574.exp Thu Aug 22 09:34:04 2002 @@ -0,0 +1,69 @@ +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Tests for the bug mentioned in PR gdb/574. It's a bit +# idiosyncratic, so I gave it its own file. + +# 2002-08-16 David Carlton + +# This file is part of the gdb testsuite + +if $tracelevel then { + strace $tracelevel + } + +if { [skip_cplus_tests] } { continue } + +# +# test running programs +# +set prms_id 0 +set bug_id 0 + +set testfile "pr-574" +set srcfile ${testfile}.cc +set binfile ${objdir}/${subdir}/${testfile} + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +if [get_compiler_info ${binfile} "c++"] { + return -1 +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + + +if ![runto_main] then { + perror "couldn't run to breakpoint" + continue +} + +gdb_test "next" "" "next" + +# This failed, as long as the code was compiled with GCC v. 2. + +# Different compilers order the data for differently, so I'm not +# matching the result exactly. + +gdb_test "print *theB" "\\$\[0-9\]* = { = {\[^}\]*}, static b = }" "PR gdb/574" + +gdb_exit +return 0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pr-574.cc.diff Content-Description: new file: pr-574.cc Content-length: 501 --- /dev/null Thu Apr 11 07:25:15 2002 +++ pr-574.cc Tue Aug 20 16:27:07 2002 @@ -0,0 +1,22 @@ +/* + An attempt to replicate PR gdb/574 with a shorter program. + + Printing out *theB failed if the program was compiled with GCC 2.95. +*/ + +class A { +public: + virtual void foo() {}; // Stick in a virtual function. + int a; // Stick in a data member. +}; + +class B : public A { + static int b; // Stick in a static data member. +}; + +int main() +{ + B *theB = new B; + + return 0; +} --=-=-=--