Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa/c++testsuite] Add (failing) static member function test to classes.exp
@ 2001-12-05 11:49 Daniel Jacobowitz
  2001-12-07 13:46 ` Jim Blandy
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2001-12-05 11:49 UTC (permalink / raw)
  To: gdb-patches

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  <drow@mvista.com>

	* 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 {


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-07 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-05 11:49 [rfa/c++testsuite] Add (failing) static member function test to classes.exp Daniel Jacobowitz
2001-12-07 13:46 ` Jim Blandy
2001-12-07 13:59   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox