From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3170 invoked by alias); 3 Feb 2009 01:10:13 -0000 Received: (qmail 3156 invoked by uid 22791); 3 Feb 2009 01:10:12 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Feb 2009 01:10:06 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n13182M9012561; Mon, 2 Feb 2009 20:08:02 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n13181mP032092; Mon, 2 Feb 2009 20:08:01 -0500 Received: from opsy.redhat.com (vpn-12-182.rdu.redhat.com [10.11.12.182]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n13180lW016409; Mon, 2 Feb 2009 20:08:01 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 0129C5080FB; Mon, 2 Feb 2009 18:07:58 -0700 (MST) To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix PR gdb/2489 References: <200810212324.38183.pedro@codesourcery.com> From: Tom Tromey Reply-To: Tom Tromey Date: Tue, 03 Feb 2009 01:10:00 -0000 In-Reply-To: (Tom Tromey's message of "Mon\, 02 Feb 2009 17\:59\:46 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-02/txt/msg00047.txt.bz2 >>>>> "Tom" == Tom Tromey writes: Tom> 2009-02-02 Tom Tromey Tom> PR gdb/2489: Tom> * completer.c (count_struct_fields): Count method names. Tom> (add_struct_fields): Add matching method names. Whoops! After committing, I remembered that this patch predates the Bugzilla move. I am checking in this patch to rename the test case. I'm also going to fix gdb/ChangeLog to point to the correct bug. Tom 2009-02-02 Tom Tromey * gdb.cp/cpcompletion.exp: Name the test "pr9594". * gdb.cp/pr2489.cc: Rename... * gdb.cp/pr9594.cc: ... to this. Index: testsuite/gdb.cp/Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/Makefile.in,v retrieving revision 1.4 diff -u -r1.4 Makefile.in --- testsuite/gdb.cp/Makefile.in 3 Feb 2009 01:00:40 -0000 1.4 +++ testsuite/gdb.cp/Makefile.in 3 Feb 2009 01:06:12 -0000 @@ -4,7 +4,7 @@ EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \ derivation inherit local member-ptr method misc \ overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace \ - ref-types ref-params method2 pr2489 + ref-types ref-params method2 pr9594 all info install-info dvi install uninstall installcheck check: @echo "Nothing to be done for $@..." Index: testsuite/gdb.cp/cpcompletion.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/cpcompletion.exp,v retrieving revision 1.1 diff -u -r1.1 cpcompletion.exp --- testsuite/gdb.cp/cpcompletion.exp 3 Feb 2009 01:00:40 -0000 1.1 +++ testsuite/gdb.cp/cpcompletion.exp 3 Feb 2009 01:06:13 -0000 @@ -21,7 +21,7 @@ if { [skip_cplus_tests] } { continue } -set testfile pr2489 +set testfile pr9594 set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile "${srcdir}/${subdir}/${testfile}.cc" "${testfile}.o" object {c++ debug}] != ""} { Index: testsuite/gdb.cp/pr2489.cc =================================================================== RCS file: testsuite/gdb.cp/pr2489.cc diff -N testsuite/gdb.cp/pr2489.cc --- testsuite/gdb.cp/pr2489.cc 3 Feb 2009 01:00:40 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,51 +0,0 @@ - -class Base -{ -public: - virtual int get_foo () { return 1; } - int base_function_only () { return 2; } -}; - -class Foo : public Base -{ - -private: - int foo_value; - -public: - Foo () { foo_value = 0;} - Foo (int i) { foo_value = i;} - ~Foo () { } - void set_foo (int value); - int get_foo (); - - // Something similar to a constructor name. - void Foofoo (); - - bool operator== (const Foo &other) { return foo_value == other.foo_value; } -}; - -void Foo::set_foo (int value) -{ - foo_value = value; -} - -int Foo::get_foo () -{ - return foo_value; -} - -void Foo::Foofoo () -{ -} - -int main () -{ - // Anonymous struct with method. - struct { - int get() { return 5; } - } a; - Foo foo1; - foo1.set_foo (42); // Set breakpoint here. - return 0; -} Index: testsuite/gdb.cp/pr9594.cc =================================================================== RCS file: testsuite/gdb.cp/pr9594.cc diff -N testsuite/gdb.cp/pr9594.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/gdb.cp/pr9594.cc 3 Feb 2009 01:06:13 -0000 @@ -0,0 +1,51 @@ + +class Base +{ +public: + virtual int get_foo () { return 1; } + int base_function_only () { return 2; } +}; + +class Foo : public Base +{ + +private: + int foo_value; + +public: + Foo () { foo_value = 0;} + Foo (int i) { foo_value = i;} + ~Foo () { } + void set_foo (int value); + int get_foo (); + + // Something similar to a constructor name. + void Foofoo (); + + bool operator== (const Foo &other) { return foo_value == other.foo_value; } +}; + +void Foo::set_foo (int value) +{ + foo_value = value; +} + +int Foo::get_foo () +{ + return foo_value; +} + +void Foo::Foofoo () +{ +} + +int main () +{ + // Anonymous struct with method. + struct { + int get() { return 5; } + } a; + Foo foo1; + foo1.set_foo (42); // Set breakpoint here. + return 0; +}