From: Michael Elizabeth Chastain <mec@shout.net>
To: carlton@kealia.com, gdb-patches@sources.redhat.com
Subject: [patch/testsuite] gdb.c++/classes.exp: add another ptype pattern
Date: Wed, 02 Jul 2003 15:39:00 -0000 [thread overview]
Message-ID: <200307021539.h62FdJWR025063@duracef.shout.net> (raw)
This patch adds a pattern to a ptype test in classes.exp.
Here is the story. The class is:
class ClassWithEnum {
public:
enum PrivEnum { red, green, blue, yellow = 42 };
PrivEnum priv_enum;
int x;
};
The ptype output depends on the compiler version and the debugging
format. Here are all ten of them:
# gcc 2.95.3 -gdwarf-2
# gcc 3.2.3 -gdwarf-2
# gcc 3.3 -gdwarf-2
# gcc gcc-3_3-branch -gdwarf-2
ptype obj_with_enum
type = class ClassWithEnum {
public:
PrivEnum priv_enum;
int x;
}
(gdb) KFAIL: gdb.c++/classes.exp: ptype obj_with_enum (PRMS: gdb/57)
# gdb HEAD -gdwarf-2
ptype obj_with_enum
No symbol "obj_with_enum" in current context.
(gdb) FAIL: gdb.c++/classes.exp: ptype obj_with_enum
# gcc 2.95.3 -gstabs+
# gcc 3.2.3 -gstabs+
ptype obj_with_enum
type = class ClassWithEnum {
public:
PrivEnum priv_enum;
int x;
ClassWithEnum & operator=(ClassWithEnum const &);
ClassWithEnum(ClassWithEnum const &);
ClassWithEnum(void);
}
(gdb) KFAIL: gdb.c++/classes.exp: ptype obj_with_enum (PRMS: gdb/57)
# gcc 3.3 -gstabs+
# gcc gcc-3_3-branch -gstabs+
# gcc HEAD -gstabs+
ptype obj_with_enum
type = class ClassWithEnum {
public:
ClassWithEnum::PrivEnum priv_enum;
int x;
ClassWithEnum & operator=(ClassWithEnum const&);
ClassWithEnum(ClassWithEnum const&);
ClassWithEnum();
}
(gdb) FAIL: gdb.c++/classes.exp: ptype obj_with_enum
Grubbing through all these configurations fatigues the brain!
So ... the configurations with KFAIL are cool. David C left a comment
in the test script indicating that naked 'PrivEnum' is a symptomm of a
gdb bug.
The configuration gcc HEAD -gdwarf-2 points to a real bug which needs
investigation.
My concern is gcc 3.3 -gstabs+. gdb is printing the right output, but
there is no arm in the test case for it, so it FAILed. This patch adds
an arm so that this output will now PASS.
Testing: tested on HEAD with all the compilers and debug formats shown,
native i686-pc-linux-gnu.
I will apply this tomorrow to HEAD if nobody has an objection, and
backport it to gdb_6_0-branch some time after that.
(This is item #2 on my three item list to fix all the places where
gcc 3.3 has regressions versus gcc 3.2.3).
Michael C
2003-07-02 Michael Chastain <mec@shout.net>
* gdb.c++/classes.exp (test_enums): Accept ptype output that
shows compiler-generated functions.
Index: classes.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/classes.exp,v
retrieving revision 1.17
diff -u -r1.17 classes.exp
--- classes.exp 3 Mar 2003 18:48:31 -0000 1.17
+++ classes.exp 2 Jul 2003 15:20:43 -0000
@@ -659,7 +659,12 @@
# ptype on the object
send_gdb "ptype obj_with_enum\n"
gdb_expect {
- -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { pass "ptype obj_with_enum" }
+ -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype obj_with_enum"
+ }
+ -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\[\r\n\]+\[ \t\]*ClassWithEnum *& *operator *=\\(ClassWithEnum const *&\\);\r\n\[ \t\]*ClassWithEnum\\(ClassWithEnum const *&\\);\r\n\[ \t\]*ClassWithEnum\\( *\\);\r\n\\}\r\n$gdb_prompt $" {
+ pass "ptype obj_with_enum"
+ }
-re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)PrivEnum priv_enum;\r\n\[ \t\]*int x;.*\\}\r\n$gdb_prompt $"
{
# NOTE: carlton/2003-02-28: One could certainly argue that
next reply other threads:[~2003-07-02 15:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-02 15:39 Michael Elizabeth Chastain [this message]
2003-07-02 15:51 ` Daniel Jacobowitz
2003-07-02 15:52 ` David Carlton
2003-07-02 16:01 Michael Elizabeth Chastain
2003-07-02 16:09 Michael Elizabeth Chastain
2003-07-02 16:29 ` David Carlton
2003-07-02 16:38 ` Daniel Jacobowitz
2003-07-02 16:49 Michael Elizabeth Chastain
2003-07-02 17:07 ` David Carlton
2003-07-02 18:33 ` Daniel Jacobowitz
2003-07-02 19:02 ` Kevin Buettner
2003-07-02 19:19 ` David Carlton
2003-07-02 20:47 ` Kevin Buettner
2003-07-02 17:28 Michael Elizabeth Chastain
2003-07-02 19:11 Michael Elizabeth Chastain
2003-07-02 20:58 Michael Elizabeth Chastain
2003-07-02 21:33 Michael Elizabeth Chastain
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=200307021539.h62FdJWR025063@duracef.shout.net \
--to=mec@shout.net \
--cc=carlton@kealia.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