From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18987 invoked by alias); 5 Dec 2001 19:49:20 -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 15794 invoked from network); 5 Dec 2001 19:48:00 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 5 Dec 2001 19:48:00 -0000 Received: from drow by nevyn.them.org with local (Exim 3.33 #1 (Debian)) id 16Bi23-0004DU-00 for ; Wed, 05 Dec 2001 14:48:39 -0500 Date: Wed, 05 Dec 2001 11:49:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: [rfa/c++testsuite] Add (failing) static member function test to classes.exp Message-ID: <20011205144839.A15989@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i X-SW-Source: 2001-12/txt/msg00142.txt.bz2 In trying to fix some v3 fails, I found an incredibly bogus line in the stabs reader; search for the third occurance of is_stub. "ii" can be the name of a function, or the mangling of its parameters. The fix is trivial, and will be attached to another one of my v3 patches once the current batch are approved (I see no good reason to send two separate patches for the same line). Here's a testcase. OK? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2001-12-05 Daniel Jacobowitz * gdb.c++/classes.exp: Add test for static member function. * gdb.c++/misc.cc: Add class with static member function. Index: classes.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/classes.exp,v retrieving revision 1.8 diff -u -r1.8 classes.exp --- classes.exp 2001/07/03 19:52:46 1.8 +++ classes.exp 2001/12/05 19:38:51 @@ -308,5 +308,21 @@ } } + # With g++ 2.x and stabs debug info, we misinterpret static methods + # whose name matches their argument mangling. + send_gdb "ptype class Static\n" + gdb_expect { + -re "type = (class|struct) Static \{(${ws}public:|)${ws}Static & operator=\\(Static const ?&\\);${ws}Static\\(Static const ?&\\);${ws}Static\\((void|)\\);${ws}static void ii\\(int, int\\);${ws}\}$nl$gdb_prompt $" { + pass "ptype class Static" + } + -re ".*$gdb_prompt $" { + fail "ptype class Static" + } + timeout { + fail "ptype class Static (timeout)" + return + } + } + send_gdb "ptype class vA\n" gdb_expect { Index: misc.cc =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/misc.cc,v retrieving revision 1.4 diff -u -r1.4 misc.cc --- misc.cc 2000/07/09 05:16:11 1.4 +++ misc.cc 2001/12/05 19:40:04 @@ -269,6 +269,14 @@ inheritance2 (); } +// ======================== static member functions ===================== + +class Static { +public: + static void ii(int, int); +}; +void Static::ii (int, int) { } + // ======================== virtual base classes========================= class vA {