* [patch/cp/testsuite] local.exp: update "ptype Local", is now "ptype l"
@ 2004-01-24 7:27 Michael Elizabeth Chastain
2004-01-24 14:53 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-24 7:27 UTC (permalink / raw)
To: gdb-patches
[Sorry David C, I sent this to "redha.com" the first time.]
This patch updates the "ptype Local" test in gdb.cp/local.exp.
First, I changed the test from "ptype Local" (a type) to
"ptype l" (a variable of that type). This gives more informative
test output when gdb says that the type of "l" is "Foobar__fi.0::Local".
"ptype Local" just complains about a nonexistent type, but
"ptype l" outputs something specific that I can KFAIL on.
Next, I ran the "ptype l" through a test matrix with 12 configurations:
gdb 6.0, gdb HEAD
gcc 2.95.3, gcc 3.3.2, gcc HEAD
gdwarf-2, -gstabs+
I looked at all the output and wrote nice patterns for all of them.
There are three arms with two KFAIL's, gdb/1516 and gdb/483. The
comments in the test suite explain the bad output that triggers the
KFAIL's. Basically, gdb/1516 is for "Foobar__Fi.0::Local",
and gdb/483 is for duplication of "char loc_foo(char)".
Also, with gcc 2.95.3 -gstabs+, the pesky "Foobar__Fi.0::Local" pops up
in a different place8: inside the arguments of the synthetic copy ctor
and the synthetic assignment operator. This happens with both gdb 6.0
and gdb HEAD, so it's not a regression. The old script accepted those,
but I KFAIL'ed them to gdb/1516 as well.
I am going to wait 24 hours for comments, and then commit this
if there are no issues.
Also, overall, I really like my new way of writing these tests, with
re_class, re_fields, re_methods, re_synth. The new code is clear to me.
But I dunno if it's clear to other people or just to me. Thoughts?
Michael C
2004-01-23 Michael Chastain <mec.gnu@mindspring.com>
* gdb.cp/local.exp: Change "ptype Local" to "ptype l".
Provide arms for current output in all my configurations.
Index: local.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/local.exp,v
retrieving revision 1.3
diff -c -3 -p -r1.3 local.exp
*** local.exp 19 Jan 2004 04:06:42 -0000 1.3
--- local.exp 24 Jan 2004 07:10:41 -0000
*************** if ![runto 'marker1'] then {
*** 73,125 ****
gdb_test "up" ".*foobar.*" "up from marker1"
! # Local classes in g++ get names like "main.1::InnerLocal", just like local
! # static variables. Some targets use "___" instead of ".".
! # ---
! # Pattern 1:
! # PASS
! # dwarf-2
! # gcc 2.95.3
#
! # Pattern 2:
! # FAIL
! # This has a duplicate "char loc_foo" line. This is a bug.
! # Historically this has been an XFAIL.
! # dwarf-2
! # gcc 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
#
! # Pattern 3:
! # PASS
! # stabs+
! # gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
#
! # Pattern 4:
! # This an old pattern from the hppa aCC version of this file.
! # I left it alone.
#
! # chastain 2002-04-08
! # pattern #5
! # PASS
! # stabs+
! # gcc HEAD abi-2
! #
! # chastain 2004-01-02
! set sep "(\[.\]|___)\[0-9\]"
! send_gdb "ptype Local\n"
! gdb_expect {
! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" {
! kfail "gdb/483" "ptype Local"
! }
! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
! -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\)\r\n\}.*$gdb_prompt $" { xpass "ptype Local (old aCC)" }
! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
! -re ".*$gdb_prompt $" { fail "ptype Local" }
! timeout { fail "(timeout) ptype Local" }
}
gdb_test "break marker2"
--- 73,137 ----
gdb_test "up" ".*foobar.*" "up from marker1"
! set sep "(\[.\]|___)\[0-9\]"
! # ptype on a local variable.
#
! # This test has six arms. The first three arms accept normal output:
! # no synthetic methods; synthetic methods before user methods;
! # synthetic methods after user methods.
#
! # The next two arms accept "foobar__Fi.0::Local" instead of "Local".
! # This is a bug. It happens in various places with various versions of
! # gcc and gdb and various debugging types.
#
! # The last arm accepts the user methods in duplicate. This bug happens
! # with gcc 3.3.2 -gdwarf-2, and has been fixed in gcc HEAD 2004-01-22.
#
! # -- chastain 2004-01-24
! set re_class "((struct|class) Local \{${ws}public:|struct Local \{)"
! set re_fields "int loc1;"
! set re_methods "char loc_foo\\(char\\);"
! set re_synth_gcc_23 "Local & operator=\\(Local const ?&\\);${ws}Local\\(Local const ?&\\);${ws}Local\\((void|)\\);"
! set XX_class "((struct|class) foobar__Fi.0::Local \{${ws}public:|struct foobar__Fi.0:Local \{)"
! set XX_synth_gcc_2 "Local & operator=\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\((void|)\\);"
! set YY_methods "$re_methods${ws}$re_methods"
! set name "ptype l"
! gdb_test_multiple "ptype l" "ptype l" {
! -re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! # gdb 6.0, gcc 2.95.3, dwarf-2
! # gdb 6.0, gcc HEAD 2004-01-22, dwarf-2
! # gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, dwarf-2
! # gdb HEAD 2004-01-23, gcc HEAD 2004-01,22, dwarf-2
! pass "$name"
! }
! -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! # gdb 6.0, gcc 3.3.2, stabs+
! # gdb HEAD 2004-01-23, gcc 3.3.2, stabs+
! pass "$name"
! }
! -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" {
! # gdb 6.0, gcc HEAD 2004-01-22, stabs+
! # gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, stabs+
! pass "$name"
! }
! -re "type = $XX_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! # gdb HEAD 2004-01-23, gcc 2.95.3, dwarf-2
! kfail "gdb/1516" "$name"
! }
! -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}($re_synth_gcc_23|$XX_synth_gcc_2)${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! # gdb 6.0, gcc 2.95.3, stabs+
! # gdb HEAD 2004-01-23, gcc 2.95.3, stabs+
! kfail "gdb/1516" "$name"
! }
! -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}$YY_methods$nl\}$nl$gdb_prompt $" {
! # gdb 6.0, gcc 3.3.2, dwarf-2
! # gdb HEAD 2004-01-23, gcc 3.2.2, dwarf-2
! kfail "gdb/483" "$name"
! }
}
gdb_test "break marker2"
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch/cp/testsuite] local.exp: update "ptype Local", is now "ptype l"
2004-01-24 7:27 [patch/cp/testsuite] local.exp: update "ptype Local", is now "ptype l" Michael Elizabeth Chastain
@ 2004-01-24 14:53 ` Daniel Jacobowitz
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-01-24 14:53 UTC (permalink / raw)
To: gdb-patches
On Sat, Jan 24, 2004 at 02:27:16AM -0500, Michael Chastain wrote:
> [Sorry David C, I sent this to "redha.com" the first time.]
>
> This patch updates the "ptype Local" test in gdb.cp/local.exp.
>
> First, I changed the test from "ptype Local" (a type) to
> "ptype l" (a variable of that type). This gives more informative
> test output when gdb says that the type of "l" is "Foobar__fi.0::Local".
> "ptype Local" just complains about a nonexistent type, but
> "ptype l" outputs something specific that I can KFAIL on.
I would prefer that you not do this. "ptype l" does give more
informative output, precisely because it is an easier problem to solve.
By all means add the new "ptype l" test, but please don't remove the
existing "ptype Local" test.
> Also, overall, I really like my new way of writing these tests, with
> re_class, re_fields, re_methods, re_synth. The new code is clear to me.
> But I dunno if it's clear to other people or just to me. Thoughts?
I rather like it also.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch/cp/testsuite] local.exp: update "ptype Local", is now "ptype l"
@ 2004-01-24 21:53 Michael Elizabeth Chastain
0 siblings, 0 replies; 3+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-24 21:53 UTC (permalink / raw)
To: drow, gdb-patches
> I would prefer that you not do this. "ptype l" does give more
> informative output, precisely because it is an easier problem to solve.
> By all means add the new "ptype l" test, but please don't remove the
> existing "ptype Local" test.
I think that is redundant, but redundancy does not hurt.
Okay, I'll add back in "ptype Local". It will have to FAIL, though,
I'm not going to write a KFAIL for a generic message.
Michael C
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-01-24 21:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-24 7:27 [patch/cp/testsuite] local.exp: update "ptype Local", is now "ptype l" Michael Elizabeth Chastain
2004-01-24 14:53 ` Daniel Jacobowitz
2004-01-24 21:53 Michael Elizabeth Chastain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox