Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures
@ 2015-07-30 19:04 Sandra Loosemore
  2015-07-30 20:56 ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Sandra Loosemore @ 2015-07-30 19:04 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

I have reapplied this patch from last year;

https://sourceware.org/ml/gdb-patches/2014-05/msg00480.html

This fix was lost when the change that added the gdb.cp/var-tag.exp 
testcase was reverted and then restored again a few months ago.  In the 
restored version of the testcase, there were 12 FAILs fixed by this 
patch, rather than 9 as previously reported in the original version:

FAIL: gdb.cp/var-tag.exp: before start: c++: ptype E
FAIL: gdb.cp/var-tag.exp: before start: c++: ptype ee
FAIL: gdb.cp/var-tag.exp: before start: c++: ptype EE
FAIL: gdb.cp/var-tag.exp: before start: c++: ptype E2
FAIL: gdb.cp/var-tag.exp: in main: c++: ptype E
FAIL: gdb.cp/var-tag.exp: in main: c++: ptype ee
FAIL: gdb.cp/var-tag.exp: in main: c++: ptype EE
FAIL: gdb.cp/var-tag.exp: in main: c++: ptype E2
FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype E
FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype ee
FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype EE
FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype E2

-Sandra


[-- Attachment #2: gdb-tag.log --]
[-- Type: text/x-log, Size: 195 bytes --]

2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>

	gdb/testsuite/

	Reapply:
	2014-05-21  Mark Wielaard  <mjw@redhat.com>

	* gdb.cp/var-tag.exp (do_global_tests): Handle underlying type.

[-- Attachment #3: gdb-tag.patch --]
[-- Type: text/x-patch, Size: 1422 bytes --]

diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
index 30aab99..60379e9 100644
--- a/gdb/testsuite/gdb.cp/var-tag.exp
+++ b/gdb/testsuite/gdb.cp/var-tag.exp
@@ -28,13 +28,18 @@ if {[prepare_for_testing $testfile.exp $testfile \
 
 proc do_global_tests {lang} {
     set invalid_print "Attempt to use a type name as an expression"
-    set ptypefmt "type = (class|enum|union|struct) %s {.*}"
+
+    if {$lang == "c++"} {
+	set opt_underlying "(: unsigned int )?"
+    } else {
+	set opt_underlying ""
+    set ptypefmt "type = (class|enum|union|struct) %s $opt_underlying{.*}"
 
     with_test_prefix $lang {
     gdb_test_no_output "set language $lang"
     gdb_test "ptype C" "type = class C {.*}"
     gdb_test "print E" "= a"
-    gdb_test "ptype E" "type = enum E {.*}"
+    gdb_test "ptype E" "type = enum E $opt_underlying{.*}"
     gdb_test "print S" "= {<No data fields>}"
     gdb_test "ptype S" "type = struct S {.*}"
     gdb_test "print U" "= {.*}"
@@ -48,7 +53,7 @@ proc do_global_tests {lang} {
     gdb_test "print SS" [format $invalid_print "SS"]
     gdb_test "ptype SS" [format $ptypefmt "SS"]
     gdb_test "print ee" "= .*"
-    gdb_test "ptype ee" "type = enum EE {.*}"
+    gdb_test "ptype ee" "type = enum EE $opt_underlying{.*}"
     gdb_test "print EE" [format $invalid_print "EE"]
     gdb_test "ptype EE" [format $ptypefmt "EE"]
     gdb_test "print uu" "= {.*}"

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

* Re: [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures
  2015-07-30 19:04 [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures Sandra Loosemore
@ 2015-07-30 20:56 ` Keith Seitz
  2015-07-30 21:26   ` Sandra Loosemore
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2015-07-30 20:56 UTC (permalink / raw)
  To: Sandra Loosemore, gdb-patches

On 07/30/2015 12:02 PM, Sandra Loosemore wrote:
> FAIL: gdb.cp/var-tag.exp: before start: c++: ptype E
> FAIL: gdb.cp/var-tag.exp: before start: c++: ptype ee
> FAIL: gdb.cp/var-tag.exp: before start: c++: ptype EE
> FAIL: gdb.cp/var-tag.exp: before start: c++: ptype E2
> FAIL: gdb.cp/var-tag.exp: in main: c++: ptype E
> FAIL: gdb.cp/var-tag.exp: in main: c++: ptype ee
> FAIL: gdb.cp/var-tag.exp: in main: c++: ptype EE
> FAIL: gdb.cp/var-tag.exp: in main: c++: ptype E2
> FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype E
> FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype ee
> FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype EE
> FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype E2

Yeah, GCC5 is now outputting (into DWARF) the underlying types used to
implement the enum. I had a patch lying around, but I forgot about it.
Thank you for doing this.

> diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
> index 30aab99..60379e9 100644
> --- a/gdb/testsuite/gdb.cp/var-tag.exp
> +++ b/gdb/testsuite/gdb.cp/var-tag.exp
> @@ -28,13 +28,18 @@ if {[prepare_for_testing $testfile.exp $testfile \
>  
>  proc do_global_tests {lang} {
>      set invalid_print "Attempt to use a type name as an expression"
> -    set ptypefmt "type = (class|enum|union|struct) %s {.*}"
> +
> +    if {$lang == "c++"} {
> +	set opt_underlying "(: unsigned int )?"
> +    } else {
> +	set opt_underlying ""

Missing '}' ?

> +    set ptypefmt "type = (class|enum|union|struct) %s $opt_underlying{.*}"

Keith


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

* Re: [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures
  2015-07-30 20:56 ` Keith Seitz
@ 2015-07-30 21:26   ` Sandra Loosemore
  2015-07-30 21:32     ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Sandra Loosemore @ 2015-07-30 21:26 UTC (permalink / raw)
  To: Keith Seitz; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

On 07/30/2015 02:56 PM, Keith Seitz wrote:
> On 07/30/2015 12:02 PM, Sandra Loosemore wrote:
>
>> diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
>> index 30aab99..60379e9 100644
>> --- a/gdb/testsuite/gdb.cp/var-tag.exp
>> +++ b/gdb/testsuite/gdb.cp/var-tag.exp
>> @@ -28,13 +28,18 @@ if {[prepare_for_testing $testfile.exp $testfile \
>>
>>   proc do_global_tests {lang} {
>>       set invalid_print "Attempt to use a type name as an expression"
>> -    set ptypefmt "type = (class|enum|union|struct) %s {.*}"
>> +
>> +    if {$lang == "c++"} {
>> +	set opt_underlying "(: unsigned int )?"
>> +    } else {
>> +	set opt_underlying ""
>
> Missing '}' ?

Oh, argh.  I had fixed this in the local GIT branch I'm using for 
testing, and then applied the wrong version of the patch to the master 
branch to check in.  Here is the correct patch; I hope I've fixed this 
up correctly on master now.

-Sandra


[-- Attachment #2: gdb-tag-new.patch --]
[-- Type: text/x-patch, Size: 1865 bytes --]

diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
index 30aab99..71d9237 100644
--- a/gdb/testsuite/gdb.cp/var-tag.exp
+++ b/gdb/testsuite/gdb.cp/var-tag.exp
@@ -28,13 +28,19 @@ if {[prepare_for_testing $testfile.exp $testfile \
 
 proc do_global_tests {lang} {
     set invalid_print "Attempt to use a type name as an expression"
-    set ptypefmt "type = (class|enum|union|struct) %s {.*}"
+
+    if {$lang == "c++"} {
+	set opt_underlying "(: unsigned int )?"
+    } else {
+	set opt_underlying ""
+    }
+    set ptypefmt "type = (class|enum|union|struct) %s $opt_underlying{.*}"
 
     with_test_prefix $lang {
     gdb_test_no_output "set language $lang"
     gdb_test "ptype C" "type = class C {.*}"
     gdb_test "print E" "= a"
-    gdb_test "ptype E" "type = enum E {.*}"
+    gdb_test "ptype E" "type = enum E $opt_underlying{.*}"
     gdb_test "print S" "= {<No data fields>}"
     gdb_test "ptype S" "type = struct S {.*}"
     gdb_test "print U" "= {.*}"
@@ -48,7 +54,7 @@ proc do_global_tests {lang} {
     gdb_test "print SS" [format $invalid_print "SS"]
     gdb_test "ptype SS" [format $ptypefmt "SS"]
     gdb_test "print ee" "= .*"
-    gdb_test "ptype ee" "type = enum EE {.*}"
+    gdb_test "ptype ee" "type = enum EE $opt_underlying{.*}"
     gdb_test "print EE" [format $invalid_print "EE"]
     gdb_test "ptype EE" [format $ptypefmt "EE"]
     gdb_test "print uu" "= {.*}"
@@ -60,7 +66,7 @@ proc do_global_tests {lang} {
     # Each of them is in a separate CU as once its CU is expanded,
     # we're no longer using the quick fns API.
     gdb_test "print E2" "= a2"
-    gdb_test "ptype E2" "type = enum E2 {.*}"
+    gdb_test "ptype E2" "type = enum E2 $opt_underlying{.*}"
     gdb_test "print S2" "= {<No data fields>}"
     gdb_test "ptype S2" "type = struct S2 {.*}"
     gdb_test "print U2" "= {.*}"

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

* Re: [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures
  2015-07-30 21:26   ` Sandra Loosemore
@ 2015-07-30 21:32     ` Keith Seitz
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2015-07-30 21:32 UTC (permalink / raw)
  To: Sandra Loosemore; +Cc: gdb-patches

On 07/30/2015 02:24 PM, Sandra Loosemore wrote:
> Oh, argh.  I had fixed this in the local GIT branch I'm using for
> testing, and then applied the wrong version of the patch to the master
> branch to check in.  Here is the correct patch; I hope I've fixed this
> up correctly on master now.

Everything looks good.

/me happy it wasn't him this time! :-)

Keith


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

end of thread, other threads:[~2015-07-30 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 19:04 [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures Sandra Loosemore
2015-07-30 20:56 ` Keith Seitz
2015-07-30 21:26   ` Sandra Loosemore
2015-07-30 21:32     ` Keith Seitz

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