From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa/c++testsuite] Add (failing) static member function test to classes.exp
Date: Wed, 05 Dec 2001 11:49:00 -0000 [thread overview]
Message-ID: <20011205144839.A15989@nevyn.them.org> (raw)
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 {
next reply other threads:[~2001-12-05 19:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-05 11:49 Daniel Jacobowitz [this message]
2001-12-07 13:46 ` Jim Blandy
2001-12-07 13:59 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011205144839.A15989@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox