public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
@ 2013-01-26 20:27 Jan Kratochvil
  2013-01-28 19:57 ` Yao Qi
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2013-01-26 20:27 UTC (permalink / raw)
  To: gdb-patches

Hi,

one PASS->FAIL is:
	[4.8 Regression] -O0 -g missing location for register double var
	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55056

So I have put "volatile" there which is indicated by XFAIL:
	+PASS: gdb.base/restore.exp: caller3: continue to breakpoint: caller3
	+XFAIL: gdb.base/restore.exp: caller3: l1: info addr l1 (register variable has no location)
	[...]
	+XFAIL: gdb.base/restore.exp: caller5: l3: info addr l3 (register variable has no location)

This GCC PR debug/55056 could be handled for example by pre-compiled DWARF .S
files.  Also the specific tests could be skipped instead of currently doing in
fact false PASS - it still tests something but probably nothing useful.


Then there is in gdbserver mode:
	-PASS: gdb.trace/collection.exp: collect register locals collectively: start trace experiment
	+FAIL: gdb.trace/collection.exp: collect register locals collectively: start trace experiment
->
	+KFAIL: gdb.trace/collection.exp: info addr locar (GDB cannot handle >64-bit trace data)) (PRMS: gdb/9999)
due to:
  register int         locar[4];
  locar[0] = 121;
  locar[1] = 122;
  locar[2] = 123;
  locar[3] = 124;
producing with gcc-4.8.0pre:
    <2f0>   DW_AT_location    : 6 byte block: 5c 93 8 5d 93 8   (DW_OP_reg12 (r12); DW_OP_piece: 8; DW_OP_reg13 (r13); DW_OP_piece: 8)
which cannot be handled by current AX:
            if (bits_collected + size > 8 * sizeof (LONGEST))
              error (_("Expression pieces exceed word size"));
as it is 128-bit variable (from two 64-bit registers).  I will file it as
a new GDB KFAIL PR.


There still remains:
	-PASS: gdb.cp/temargs.exp: test type of T in inner_m
	+FAIL: gdb.cp/temargs.exp: test type of T in inner_m
	-PASS: gdb.cp/temargs.exp: test value of I in inner_m
	+FAIL: gdb.cp/temargs.exp: test value of I in inner_m
	-PASS: gdb.cp/temargs.exp: test value of P in inner_m
	+FAIL: gdb.cp/temargs.exp: test value of P in inner_m
	-PASS: gdb.cp/temargs.exp: test value of MP in inner_m
	+FAIL: gdb.cp/temargs.exp: test value of MP in inner_m
currently tracked as:
	[4.8 Regression] DWARF missing concrete class definition
	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55059


Thanks,
Jan


gdb/testsuite/
2013-01-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Workaround GCC PR debug/55056 and GDB PR server/9999.
	* gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef.
	(caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef.
	(caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef.
	* gdb.base/restore.exp: New variable opts.  Test caller3, caller4 and
	caller5 for l1, l2 and l3.  New prepare_for_testing.
	* gdb.base/store.c (wack_longest, wack_float, wack_double)
	(wack_doublest): Protect l and r by GCC_PR_55056 #ifdef.
	* gdb.base/store.exp: New variable opts.  Test longest, float, double
	and doublest functions for l and r.  New prepare_for_testing.
	* gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by
	GCC_PR_55056 #ifdef.  Protect locar by GDB_PR_9999 #ifdef.
	* gdb.trace/collection.exp: New variable opts.  Test reglocal_test_func
	for locf, locd and locar.  New prepare_for_testing.
	(gdb_collect_locals_test): Increase list size to 43.

diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c
index 526be5f..a9b6d28 100644
--- a/gdb/testsuite/gdb.base/restore.c
+++ b/gdb/testsuite/gdb.base/restore.c
@@ -206,6 +206,10 @@ caller2 (void)
 int
 caller3 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller3 prologue */
   register int l2 = increment (l1);
   register int l3 = increment (l2);
@@ -222,7 +226,15 @@ caller3 (void)
 int
 caller4 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller4 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
   register int l3 = increment (l2);
   register int l4 = increment (l3);
@@ -239,8 +251,20 @@ caller4 (void)
 int
 caller5 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller5 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l3 = increment (l2);
   register int l4 = increment (l3);
   register int l5 = increment (l4);
diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp
index dbe01dc..a7fa91b 100644
--- a/gdb/testsuite/gdb.base/restore.exp
+++ b/gdb/testsuite/gdb.base/restore.exp
@@ -24,7 +24,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach caller { caller3 caller4 caller5 } { with_test_prefix $caller {
+    gdb_breakpoint $caller
+    gdb_continue_to_breakpoint $caller
+
+    foreach l { l1 l2 l3 } { with_test_prefix $l {
+	set test "info addr $l"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$l\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$l\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/store.c b/gdb/testsuite/gdb.base/store.c
index 545515d..3ac4a1a 100644
--- a/gdb/testsuite/gdb.base/store.c
+++ b/gdb/testsuite/gdb.base/store.c
@@ -98,6 +98,10 @@ wack_long (register long u, register long v)
 long
 wack_longest (register longest u, register longest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register longest l = u, r = v;
   l = add_longest (l, r);
   return l + r;
@@ -106,6 +110,10 @@ wack_longest (register longest u, register longest v)
 float
 wack_float (register float u, register float v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float l = u, r = v;
   l = add_float (l, r);
   return l + r;
@@ -114,6 +122,10 @@ wack_float (register float u, register float v)
 double
 wack_double (register double u, register double v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double l = u, r = v;
   l = add_double (l, r);
   return l + r;
@@ -122,6 +134,10 @@ wack_double (register double u, register double v)
 doublest
 wack_doublest (register doublest u, register doublest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register doublest l = u, r = v;
   l = add_doublest (l, r);
   return l + r;
diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp
index 292a319..e977f5e 100644
--- a/gdb/testsuite/gdb.base/store.exp
+++ b/gdb/testsuite/gdb.base/store.exp
@@ -18,7 +18,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach func { longest float double doublest } { with_test_prefix $func {
+    gdb_breakpoint wack_$func
+    gdb_continue_to_breakpoint wack_$func
+
+    foreach var { l r } { with_test_prefix $var {
+	set test "info addr $var"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c
index 3eac221..172d6c4 100644
--- a/gdb/testsuite/gdb.trace/collection.c
+++ b/gdb/testsuite/gdb.trace/collection.c
@@ -124,10 +124,23 @@ int reglocal_test_func ()		/* test collecting register locals */
 {
   register char        locc = 11;
   register int         loci = 12;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float       locf = 13.3;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double      locd = 14.4;
   register test_struct locst;
-  register int         locar[4];
+  /* The "register" removal is a GDB PR server/9999 workaround as it cannot
+     handle DW_OP_piece variables occupying more than 64 bits on gcc-4.8.0.  */
+#ifndef GDB_PR_9999
+  register
+#endif
+  int                  locar[4];
   int                  i;
 
   locst.memberc  = 15;
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index ed7149d..c2ea712 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -19,7 +19,43 @@ load_lib "trace-support.exp"
 standard_testfile
 set executable $testfile
 
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+set opts {debug nowarnings}
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
+    return -1
+}
+
+if {![runto reglocal_test_func]} {
+    return -1
+}
+
+foreach var { locf locd } { with_test_prefix $var {
+    set test "info addr $var"
+    gdb_test_multiple $test $test {
+	-re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+	    lappend opts additional_flags=-DGCC_PR_55056
+	    xfail "$test (register variable has no location)"
+	}
+	-re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+	    pass $test
+	}
+    }
+}}
+
+set test "info addr locar"
+gdb_test_multiple $test $test {
+    -re "\r\nSymbol \"locar\" is a variable \[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\.\r\n$gdb_prompt $" {
+	lappend opts additional_flags=-DGDB_PR_9999
+	kfail gdb/9999 "$test (GDB cannot handle >64-bit trace data))"
+    }
+    -re "\r\nSymbol \"locar\" is .*\r\n$gdb_prompt $" {
+	pass $test
+    }
+}
+
+set executable ${testfile}opts
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
     return -1
 }
 
@@ -284,7 +320,7 @@ proc gdb_collect_locals_test { func mylocs msg } {
 
     # Find the comment-identified line for setting this tracepoint.
     set testline 0
-    gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
+    gdb_test_multiple "list $func, +43" "collect $msg: find tracepoint line" {
 	-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
 	    set testline $expect_out(1,string)
 	    pass "collect $msg: find tracepoint line"

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

* Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
  2013-01-26 20:27 [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL Jan Kratochvil
@ 2013-01-28 19:57 ` Yao Qi
  2013-01-29 18:16   ` Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Yao Qi @ 2013-01-28 19:57 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On 01/27/2013 04:26 AM, Jan Kratochvil wrote:
> gdb/testsuite/
> 2013-01-26  Jan Kratochvil<jan.kratochvil@redhat.com>
>
> 	Workaround GCC PR debug/55056 and GDB PR server/9999.

I don't have comment for this patch, but it would be more clear if you 
post the patch after the PR is reported and put the actual PR number in 
the patch.

-- 
Yao (齐尧)

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

* Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
  2013-01-28 19:57 ` Yao Qi
@ 2013-01-29 18:16   ` Jan Kratochvil
       [not found]     ` <20130202092240.GA24458@host2.jankratochvil.net>
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2013-01-29 18:16 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On Mon, 28 Jan 2013 20:56:17 +0100, Yao Qi wrote:
> On 01/27/2013 04:26 AM, Jan Kratochvil wrote:
> >gdb/testsuite/
> >2013-01-26  Jan Kratochvil<jan.kratochvil@redhat.com>
> >
> >	Workaround GCC PR debug/55056 and GDB PR server/9999.
> 
> I don't have comment for this patch, but it would be more clear if
> you post the patch after the PR is reported and put the actual PR
> number in the patch.

updated:

One PASS->FAIL is:
	[4.8 Regression] -O0 -g missing location for register double var
	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55056

So I have put "volatile" there which is indicated by XFAIL:
	+PASS: gdb.base/restore.exp: caller3: continue to breakpoint: caller3
	+XFAIL: gdb.base/restore.exp: caller3: l1: info addr l1 (register variable has no location)
	[...]
	+XFAIL: gdb.base/restore.exp: caller5: l3: info addr l3 (register variable has no location)

This GCC PR debug/55056 could be handled for example by pre-compiled DWARF .S
files.  Also the specific tests could be skipped instead of currently doing in
fact false PASS - it still tests something but probably nothing useful.


Then there is in gdbserver mode:
	-PASS: gdb.trace/collection.exp: collect register locals collectively: start trace experiment
	+FAIL: gdb.trace/collection.exp: collect register locals collectively: start trace experiment
->
	+KFAIL: gdb.trace/collection.exp: info addr locar (GDB cannot handle >64-bit trace data)) (PRMS: server/15081)
due to:
  register int         locar[4];
  locar[0] = 121;
  locar[1] = 122;
  locar[2] = 123;
  locar[3] = 124;
producing with gcc-4.8.0pre:
    <2f0>   DW_AT_location    : 6 byte block: 5c 93 8 5d 93 8   (DW_OP_reg12 (r12); DW_OP_piece: 8; DW_OP_reg13 (r13); DW_OP_piece: 8)
which cannot be handled by current AX:
            if (bits_collected + size > 8 * sizeof (LONGEST))
              error (_("Expression pieces exceed word size"));
as it is 128-bit variable (from two 64-bit registers).  I will file it as
a new GDB KFAIL PR.


There still remains:
	-PASS: gdb.cp/temargs.exp: test type of T in inner_m
	+FAIL: gdb.cp/temargs.exp: test type of T in inner_m
	-PASS: gdb.cp/temargs.exp: test value of I in inner_m
	+FAIL: gdb.cp/temargs.exp: test value of I in inner_m
	-PASS: gdb.cp/temargs.exp: test value of P in inner_m
	+FAIL: gdb.cp/temargs.exp: test value of P in inner_m
	-PASS: gdb.cp/temargs.exp: test value of MP in inner_m
	+FAIL: gdb.cp/temargs.exp: test value of MP in inner_m
currently tracked as:
	[4.8 Regression] DWARF missing concrete class definition
	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55059


Thanks,
Jan


gdb/testsuite/
2013-01-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Workaround GCC PR debug/55056 and GDB PR server/15081.
	* gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef.
	(caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef.
	(caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef.
	* gdb.base/restore.exp: New variable opts.  Test caller3, caller4 and
	caller5 for l1, l2 and l3.  New prepare_for_testing.
	* gdb.base/store.c (wack_longest, wack_float, wack_double)
	(wack_doublest): Protect l and r by GCC_PR_55056 #ifdef.
	* gdb.base/store.exp: New variable opts.  Test longest, float, double
	and doublest functions for l and r.  New prepare_for_testing.
	* gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by
	GCC_PR_55056 #ifdef.  Protect locar by GDB_PR_15081 #ifdef.
	* gdb.trace/collection.exp: New variable opts.  Test reglocal_test_func
	for locf, locd and locar.  New prepare_for_testing.
	(gdb_collect_locals_test): Increase list size to 43.

diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c
index 526be5f..a9b6d28 100644
--- a/gdb/testsuite/gdb.base/restore.c
+++ b/gdb/testsuite/gdb.base/restore.c
@@ -206,6 +206,10 @@ caller2 (void)
 int
 caller3 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller3 prologue */
   register int l2 = increment (l1);
   register int l3 = increment (l2);
@@ -222,7 +226,15 @@ caller3 (void)
 int
 caller4 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller4 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
   register int l3 = increment (l2);
   register int l4 = increment (l3);
@@ -239,8 +251,20 @@ caller4 (void)
 int
 caller5 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller5 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l3 = increment (l2);
   register int l4 = increment (l3);
   register int l5 = increment (l4);
diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp
index dbe01dc..a7fa91b 100644
--- a/gdb/testsuite/gdb.base/restore.exp
+++ b/gdb/testsuite/gdb.base/restore.exp
@@ -24,7 +24,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach caller { caller3 caller4 caller5 } { with_test_prefix $caller {
+    gdb_breakpoint $caller
+    gdb_continue_to_breakpoint $caller
+
+    foreach l { l1 l2 l3 } { with_test_prefix $l {
+	set test "info addr $l"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$l\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$l\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/store.c b/gdb/testsuite/gdb.base/store.c
index 545515d..3ac4a1a 100644
--- a/gdb/testsuite/gdb.base/store.c
+++ b/gdb/testsuite/gdb.base/store.c
@@ -98,6 +98,10 @@ wack_long (register long u, register long v)
 long
 wack_longest (register longest u, register longest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register longest l = u, r = v;
   l = add_longest (l, r);
   return l + r;
@@ -106,6 +110,10 @@ wack_longest (register longest u, register longest v)
 float
 wack_float (register float u, register float v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float l = u, r = v;
   l = add_float (l, r);
   return l + r;
@@ -114,6 +122,10 @@ wack_float (register float u, register float v)
 double
 wack_double (register double u, register double v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double l = u, r = v;
   l = add_double (l, r);
   return l + r;
@@ -122,6 +134,10 @@ wack_double (register double u, register double v)
 doublest
 wack_doublest (register doublest u, register doublest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register doublest l = u, r = v;
   l = add_doublest (l, r);
   return l + r;
diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp
index 292a319..e977f5e 100644
--- a/gdb/testsuite/gdb.base/store.exp
+++ b/gdb/testsuite/gdb.base/store.exp
@@ -18,7 +18,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach func { longest float double doublest } { with_test_prefix $func {
+    gdb_breakpoint wack_$func
+    gdb_continue_to_breakpoint wack_$func
+
+    foreach var { l r } { with_test_prefix $var {
+	set test "info addr $var"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c
index 3eac221..6e7bee5 100644
--- a/gdb/testsuite/gdb.trace/collection.c
+++ b/gdb/testsuite/gdb.trace/collection.c
@@ -124,10 +124,23 @@ int reglocal_test_func ()		/* test collecting register locals */
 {
   register char        locc = 11;
   register int         loci = 12;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float       locf = 13.3;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double      locd = 14.4;
   register test_struct locst;
-  register int         locar[4];
+  /* The "register" removal is a GDB PR server/15081 workaround as it cannot
+     handle DW_OP_piece variables occupying more than 64 bits on gcc-4.8.0.  */
+#ifndef GDB_PR_15081
+  register
+#endif
+  int                  locar[4];
   int                  i;
 
   locst.memberc  = 15;
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index ed7149d..e1526e6 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -19,7 +19,43 @@ load_lib "trace-support.exp"
 standard_testfile
 set executable $testfile
 
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+set opts {debug nowarnings}
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
+    return -1
+}
+
+if {![runto reglocal_test_func]} {
+    return -1
+}
+
+foreach var { locf locd } { with_test_prefix $var {
+    set test "info addr $var"
+    gdb_test_multiple $test $test {
+	-re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+	    lappend opts additional_flags=-DGCC_PR_55056
+	    xfail "$test (register variable has no location)"
+	}
+	-re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+	    pass $test
+	}
+    }
+}}
+
+set test "info addr locar"
+gdb_test_multiple $test $test {
+    -re "\r\nSymbol \"locar\" is a variable \[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\.\r\n$gdb_prompt $" {
+	lappend opts additional_flags=-DGDB_PR_15081
+	kfail gdb/15081 "$test (GDB cannot handle >64-bit trace data))"
+    }
+    -re "\r\nSymbol \"locar\" is .*\r\n$gdb_prompt $" {
+	pass $test
+    }
+}
+
+set executable ${testfile}opts
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
     return -1
 }
 
@@ -284,7 +320,7 @@ proc gdb_collect_locals_test { func mylocs msg } {
 
     # Find the comment-identified line for setting this tracepoint.
     set testline 0
-    gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
+    gdb_test_multiple "list $func, +43" "collect $msg: find tracepoint line" {
 	-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
 	    set testline $expect_out(1,string)
 	    pass "collect $msg: find tracepoint line"

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

* Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
       [not found]     ` <20130202092240.GA24458@host2.jankratochvil.net>
@ 2013-02-03 17:27       ` Jan Kratochvil
  2013-06-14 13:39         ` [GCC PR55056] " Thomas Schwinge
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2013-02-03 17:27 UTC (permalink / raw)
  To: gdb-patches

It was sent to gcc-patches before by a mistake.

On Sat, 02 Feb 2013 10:22:40 +0100, Jan Kratochvil wrote:
Hi,

just forgot also about gdb.trace/unavailable.exp, equivalent to previous
gdb.trace/collection.exp workarounds.


Jan


gdb/testsuite/
2013-02-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Workaround GCC PR debug/55056 and GDB PR server/15081.
	* gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef.
	(caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef.
	(caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef.
	* gdb.base/restore.exp: New variable opts.  Test caller3, caller4 and
	caller5 for l1, l2 and l3.  New prepare_for_testing.
	* gdb.base/store.c (wack_longest, wack_float, wack_double)
	(wack_doublest): Protect l and r by GCC_PR_55056 #ifdef.
	* gdb.base/store.exp: New variable opts.  Test longest, float, double
	and doublest functions for l and r.  New prepare_for_testing.
	* gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by
	GCC_PR_55056 #ifdef.  Protect locar by GDB_PR_15081 #ifdef.
	* gdb.trace/unavailable.c: Likewise.
	* gdb.trace/collection.exp: New variable opts.  Test reglocal_test_func
	for locf, locd and locar.  New prepare_for_testing.
	(gdb_collect_locals_test): Increase list size to 43.
	* gdb.trace/unavailable.exp: Likewise.

diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c
index 526be5f..a9b6d28 100644
--- a/gdb/testsuite/gdb.base/restore.c
+++ b/gdb/testsuite/gdb.base/restore.c
@@ -206,6 +206,10 @@ caller2 (void)
 int
 caller3 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller3 prologue */
   register int l2 = increment (l1);
   register int l3 = increment (l2);
@@ -222,7 +226,15 @@ caller3 (void)
 int
 caller4 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller4 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
   register int l3 = increment (l2);
   register int l4 = increment (l3);
@@ -239,8 +251,20 @@ caller4 (void)
 int
 caller5 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller5 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l3 = increment (l2);
   register int l4 = increment (l3);
   register int l5 = increment (l4);
diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp
index dbe01dc..a7fa91b 100644
--- a/gdb/testsuite/gdb.base/restore.exp
+++ b/gdb/testsuite/gdb.base/restore.exp
@@ -24,7 +24,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach caller { caller3 caller4 caller5 } { with_test_prefix $caller {
+    gdb_breakpoint $caller
+    gdb_continue_to_breakpoint $caller
+
+    foreach l { l1 l2 l3 } { with_test_prefix $l {
+	set test "info addr $l"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$l\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$l\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/store.c b/gdb/testsuite/gdb.base/store.c
index 545515d..3ac4a1a 100644
--- a/gdb/testsuite/gdb.base/store.c
+++ b/gdb/testsuite/gdb.base/store.c
@@ -98,6 +98,10 @@ wack_long (register long u, register long v)
 long
 wack_longest (register longest u, register longest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register longest l = u, r = v;
   l = add_longest (l, r);
   return l + r;
@@ -106,6 +110,10 @@ wack_longest (register longest u, register longest v)
 float
 wack_float (register float u, register float v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float l = u, r = v;
   l = add_float (l, r);
   return l + r;
@@ -114,6 +122,10 @@ wack_float (register float u, register float v)
 double
 wack_double (register double u, register double v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double l = u, r = v;
   l = add_double (l, r);
   return l + r;
@@ -122,6 +134,10 @@ wack_double (register double u, register double v)
 doublest
 wack_doublest (register doublest u, register doublest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register doublest l = u, r = v;
   l = add_doublest (l, r);
   return l + r;
diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp
index 292a319..e977f5e 100644
--- a/gdb/testsuite/gdb.base/store.exp
+++ b/gdb/testsuite/gdb.base/store.exp
@@ -18,7 +18,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach func { longest float double doublest } { with_test_prefix $func {
+    gdb_breakpoint wack_$func
+    gdb_continue_to_breakpoint wack_$func
+
+    foreach var { l r } { with_test_prefix $var {
+	set test "info addr $var"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c
index 3eac221..6e7bee5 100644
--- a/gdb/testsuite/gdb.trace/collection.c
+++ b/gdb/testsuite/gdb.trace/collection.c
@@ -124,10 +124,23 @@ int reglocal_test_func ()		/* test collecting register locals */
 {
   register char        locc = 11;
   register int         loci = 12;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float       locf = 13.3;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double      locd = 14.4;
   register test_struct locst;
-  register int         locar[4];
+  /* The "register" removal is a GDB PR server/15081 workaround as it cannot
+     handle DW_OP_piece variables occupying more than 64 bits on gcc-4.8.0.  */
+#ifndef GDB_PR_15081
+  register
+#endif
+  int                  locar[4];
   int                  i;
 
   locst.memberc  = 15;
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index ed7149d..e1526e6 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -19,7 +19,43 @@ load_lib "trace-support.exp"
 standard_testfile
 set executable $testfile
 
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+set opts {debug nowarnings}
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
+    return -1
+}
+
+if {![runto reglocal_test_func]} {
+    return -1
+}
+
+foreach var { locf locd } { with_test_prefix $var {
+    set test "info addr $var"
+    gdb_test_multiple $test $test {
+	-re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+	    lappend opts additional_flags=-DGCC_PR_55056
+	    xfail "$test (register variable has no location)"
+	}
+	-re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+	    pass $test
+	}
+    }
+}}
+
+set test "info addr locar"
+gdb_test_multiple $test $test {
+    -re "\r\nSymbol \"locar\" is a variable \[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\.\r\n$gdb_prompt $" {
+	lappend opts additional_flags=-DGDB_PR_15081
+	kfail gdb/15081 "$test (GDB cannot handle >64-bit trace data))"
+    }
+    -re "\r\nSymbol \"locar\" is .*\r\n$gdb_prompt $" {
+	pass $test
+    }
+}
+
+set executable ${testfile}opts
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
     return -1
 }
 
@@ -284,7 +320,7 @@ proc gdb_collect_locals_test { func mylocs msg } {
 
     # Find the comment-identified line for setting this tracepoint.
     set testline 0
-    gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
+    gdb_test_multiple "list $func, +43" "collect $msg: find tracepoint line" {
 	-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
 	    set testline $expect_out(1,string)
 	    pass "collect $msg: find tracepoint line"
diff --git a/gdb/testsuite/gdb.trace/unavailable.cc b/gdb/testsuite/gdb.trace/unavailable.cc
index 77fa01d..7cf1641 100644
--- a/gdb/testsuite/gdb.trace/unavailable.cc
+++ b/gdb/testsuite/gdb.trace/unavailable.cc
@@ -238,10 +238,23 @@ reglocal_test_func ()
 {
   register char        locc = 11;
   register int         loci = 12;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float       locf = 13.3;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double      locd = 14.4;
   register test_struct locst;
-  register int         locar[4];
+  /* The "register" removal is a GDB PR server/15081 workaround as it cannot
+     handle DW_OP_piece variables occupying more than 64 bits on gcc-4.8.0.  */
+#ifndef GDB_PR_15081
+  register
+#endif
+  int                  locar[4];
   int                  i;
 
   locst.memberc  = 15;
diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp
index b776dd3..02a9bc8 100644
--- a/gdb/testsuite/gdb.trace/unavailable.exp
+++ b/gdb/testsuite/gdb.trace/unavailable.exp
@@ -17,9 +17,43 @@ load_lib "trace-support.exp"
 
 standard_testfile unavailable.cc
 set executable $testfile
+set opts {debug nowarnings c++}
 
-if {[prepare_for_testing $testfile.exp $testfile $srcfile \
-	 {debug nowarnings c++}]} {
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
+    return -1
+}
+
+if {![runto reglocal_test_func]} {
+    return -1
+}
+
+foreach var { locf locd } { with_test_prefix $var {
+    set test "info addr $var"
+    gdb_test_multiple $test $test {
+	-re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+	    lappend opts additional_flags=-DGCC_PR_55056
+	    xfail "$test (register variable has no location)"
+	}
+	-re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+	    pass $test
+	}
+    }
+}}
+
+set test "info addr locar"
+gdb_test_multiple $test $test {
+    -re "\r\nSymbol \"locar\" is a variable \[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\.\r\n$gdb_prompt $" {
+	lappend opts additional_flags=-DGDB_PR_15081
+	kfail gdb/15081 "$test (GDB cannot handle >64-bit trace data))"
+    }
+    -re "\r\nSymbol \"locar\" is .*\r\n$gdb_prompt $" {
+	pass $test
+    }
+}
+
+set executable ${testfile}opts
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
     return -1
 }
 

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

* [GCC PR55056] Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
  2013-02-03 17:27       ` Jan Kratochvil
@ 2013-06-14 13:39         ` Thomas Schwinge
  2013-06-14 14:24           ` Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Schwinge @ 2013-06-14 13:39 UTC (permalink / raw)
  To: Jan Kratochvil, gdb-patches, gcc

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

Hi!

To highlight this issue again, <http://gcc.gnu.org/PR55056>, now that
Debian testing has switched to GCC 4.8:

On Sun, 3 Feb 2013 18:27:21 +0100, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> gdb/testsuite/
> 2013-02-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	Workaround GCC PR debug/55056 and GDB PR server/15081.
> 	* gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef.
> 	(caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef.
> 	(caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef.
> 	* gdb.base/restore.exp: New variable opts.  Test caller3, caller4 and
> 	caller5 for l1, l2 and l3.  New prepare_for_testing.
> 	* gdb.base/store.c (wack_longest, wack_float, wack_double)
> 	(wack_doublest): Protect l and r by GCC_PR_55056 #ifdef.
> 	* gdb.base/store.exp: New variable opts.  Test longest, float, double
> 	and doublest functions for l and r.  New prepare_for_testing.
> 	* gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by
> 	GCC_PR_55056 #ifdef.  Protect locar by GDB_PR_15081 #ifdef.
> 	* gdb.trace/unavailable.c: Likewise.
> 	* gdb.trace/collection.exp: New variable opts.  Test reglocal_test_func
> 	for locf, locd and locar.  New prepare_for_testing.
> 	(gdb_collect_locals_test): Increase list size to 43.
> 	* gdb.trace/unavailable.exp: Likewise.

As far as I can tell, no consensus has yet been reached about the
approach to fix this issue discussed in this thread.  (I have not looked
at the proposed patch in detail.)

I had already been configuring my native GDB builds with CC=gcc-4.8
CXX=g++-4.8, and naively assumed the same compiler as specified on the
configure command-line would be used for the GDB testsuite -- which is
not true, as it now turns out.  Is this to be considered a bug in the GDB
build/test harness?

Anyway, upon Debian testing/unstable just switching the default system
compiler from 4.7 to 4.8, the following new FAILs appear in my native x86
GNU/Linux and GNU/Hurd testing:

    --- [...]/gdb.base2/gdb.sum
    +++ [...]/gdb.base2/gdb.sum
    @@ -1395,31 +1395,31 @@ PASS: gdb.base/restore.exp: run to caller3
     PASS: gdb.base/restore.exp: caller3 calls callee1; tbreak callee
     PASS: gdb.base/restore.exp: caller3 calls callee1; continue to callee
     PASS: gdb.base/restore.exp: caller3 calls callee1; return callee now
    -PASS: gdb.base/restore.exp: caller3 calls callee1; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller3 calls callee1; return restored l1 to 32492
     PASS: gdb.base/restore.exp: caller3 calls callee1; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller3 calls callee1; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller3 calls callee2; tbreak callee
     PASS: gdb.base/restore.exp: caller3 calls callee2; continue to callee
     PASS: gdb.base/restore.exp: caller3 calls callee2; return callee now
    -PASS: gdb.base/restore.exp: caller3 calls callee2; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller3 calls callee2; return restored l1 to 32492
     PASS: gdb.base/restore.exp: caller3 calls callee2; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller3 calls callee2; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller3 calls callee3; tbreak callee
     PASS: gdb.base/restore.exp: caller3 calls callee3; continue to callee
     PASS: gdb.base/restore.exp: caller3 calls callee3; return callee now
    -PASS: gdb.base/restore.exp: caller3 calls callee3; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller3 calls callee3; return restored l1 to 32492
     PASS: gdb.base/restore.exp: caller3 calls callee3; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller3 calls callee3; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller3 calls callee4; tbreak callee
     PASS: gdb.base/restore.exp: caller3 calls callee4; continue to callee
     PASS: gdb.base/restore.exp: caller3 calls callee4; return callee now
    -PASS: gdb.base/restore.exp: caller3 calls callee4; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller3 calls callee4; return restored l1 to 32492
     PASS: gdb.base/restore.exp: caller3 calls callee4; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller3 calls callee4; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller3 calls callee5; tbreak callee
     PASS: gdb.base/restore.exp: caller3 calls callee5; continue to callee
     PASS: gdb.base/restore.exp: caller3 calls callee5; return callee now
    -PASS: gdb.base/restore.exp: caller3 calls callee5; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller3 calls callee5; return restored l1 to 32492
     PASS: gdb.base/restore.exp: caller3 calls callee5; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller3 calls callee5; return restored l3 to 32494
     PASS: gdb.base/restore.exp: tbreak caller4
    @@ -1427,36 +1427,36 @@ PASS: gdb.base/restore.exp: run to caller4
     PASS: gdb.base/restore.exp: caller4 calls callee1; tbreak callee
     PASS: gdb.base/restore.exp: caller4 calls callee1; continue to callee
     PASS: gdb.base/restore.exp: caller4 calls callee1; return callee now
    -PASS: gdb.base/restore.exp: caller4 calls callee1; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller4 calls callee1; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller4 calls callee1; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller4 calls callee1; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller4 calls callee1; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller4 calls callee1; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller4 calls callee2; tbreak callee
     PASS: gdb.base/restore.exp: caller4 calls callee2; continue to callee
     PASS: gdb.base/restore.exp: caller4 calls callee2; return callee now
    -PASS: gdb.base/restore.exp: caller4 calls callee2; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller4 calls callee2; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller4 calls callee2; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller4 calls callee2; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller4 calls callee2; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller4 calls callee2; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller4 calls callee3; tbreak callee
     PASS: gdb.base/restore.exp: caller4 calls callee3; continue to callee
     PASS: gdb.base/restore.exp: caller4 calls callee3; return callee now
    -PASS: gdb.base/restore.exp: caller4 calls callee3; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller4 calls callee3; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller4 calls callee3; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller4 calls callee3; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller4 calls callee3; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller4 calls callee3; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller4 calls callee4; tbreak callee
     PASS: gdb.base/restore.exp: caller4 calls callee4; continue to callee
     PASS: gdb.base/restore.exp: caller4 calls callee4; return callee now
    -PASS: gdb.base/restore.exp: caller4 calls callee4; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller4 calls callee4; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller4 calls callee4; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller4 calls callee4; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller4 calls callee4; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller4 calls callee4; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller4 calls callee5; tbreak callee
     PASS: gdb.base/restore.exp: caller4 calls callee5; continue to callee
     PASS: gdb.base/restore.exp: caller4 calls callee5; return callee now
    -PASS: gdb.base/restore.exp: caller4 calls callee5; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller4 calls callee5; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller4 calls callee5; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller4 calls callee5; return restored l2 to 32493
     PASS: gdb.base/restore.exp: caller4 calls callee5; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller4 calls callee5; return restored l4 to 32495
     PASS: gdb.base/restore.exp: tbreak caller5
    @@ -1464,41 +1464,41 @@ PASS: gdb.base/restore.exp: run to caller5
     PASS: gdb.base/restore.exp: caller5 calls callee1; tbreak callee
     PASS: gdb.base/restore.exp: caller5 calls callee1; continue to callee
     PASS: gdb.base/restore.exp: caller5 calls callee1; return callee now
    -PASS: gdb.base/restore.exp: caller5 calls callee1; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller5 calls callee1; return restored l2 to 32493
    -PASS: gdb.base/restore.exp: caller5 calls callee1; return restored l3 to 32494
    +FAIL: gdb.base/restore.exp: caller5 calls callee1; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller5 calls callee1; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller5 calls callee1; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller5 calls callee1; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller5 calls callee1; return restored l5 to 32496
     PASS: gdb.base/restore.exp: caller5 calls callee2; tbreak callee
     PASS: gdb.base/restore.exp: caller5 calls callee2; continue to callee
     PASS: gdb.base/restore.exp: caller5 calls callee2; return callee now
    -PASS: gdb.base/restore.exp: caller5 calls callee2; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller5 calls callee2; return restored l2 to 32493
    -PASS: gdb.base/restore.exp: caller5 calls callee2; return restored l3 to 32494
    +FAIL: gdb.base/restore.exp: caller5 calls callee2; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller5 calls callee2; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller5 calls callee2; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller5 calls callee2; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller5 calls callee2; return restored l5 to 32496
     PASS: gdb.base/restore.exp: caller5 calls callee3; tbreak callee
     PASS: gdb.base/restore.exp: caller5 calls callee3; continue to callee
     PASS: gdb.base/restore.exp: caller5 calls callee3; return callee now
    -PASS: gdb.base/restore.exp: caller5 calls callee3; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller5 calls callee3; return restored l2 to 32493
    -PASS: gdb.base/restore.exp: caller5 calls callee3; return restored l3 to 32494
    +FAIL: gdb.base/restore.exp: caller5 calls callee3; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller5 calls callee3; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller5 calls callee3; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller5 calls callee3; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller5 calls callee3; return restored l5 to 32496
     PASS: gdb.base/restore.exp: caller5 calls callee4; tbreak callee
     PASS: gdb.base/restore.exp: caller5 calls callee4; continue to callee
     PASS: gdb.base/restore.exp: caller5 calls callee4; return callee now
    -PASS: gdb.base/restore.exp: caller5 calls callee4; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller5 calls callee4; return restored l2 to 32493
    -PASS: gdb.base/restore.exp: caller5 calls callee4; return restored l3 to 32494
    +FAIL: gdb.base/restore.exp: caller5 calls callee4; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller5 calls callee4; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller5 calls callee4; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller5 calls callee4; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller5 calls callee4; return restored l5 to 32496
     PASS: gdb.base/restore.exp: caller5 calls callee5; tbreak callee
     PASS: gdb.base/restore.exp: caller5 calls callee5; continue to callee
     PASS: gdb.base/restore.exp: caller5 calls callee5; return callee now
    -PASS: gdb.base/restore.exp: caller5 calls callee5; return restored l1 to 32492
    -PASS: gdb.base/restore.exp: caller5 calls callee5; return restored l2 to 32493
    -PASS: gdb.base/restore.exp: caller5 calls callee5; return restored l3 to 32494
    +FAIL: gdb.base/restore.exp: caller5 calls callee5; return restored l1 to 32492
    +FAIL: gdb.base/restore.exp: caller5 calls callee5; return restored l2 to 32493
    +FAIL: gdb.base/restore.exp: caller5 calls callee5; return restored l3 to 32494
     PASS: gdb.base/restore.exp: caller5 calls callee5; return restored l4 to 32495
     PASS: gdb.base/restore.exp: caller5 calls callee5; return restored l5 to 32496
     PASS: gdb.base/restore.exp: run to completion
    @@ -2170,35 +2170,35 @@ PASS: gdb.base/store.exp: var long l; print incremented l, expecting 2
     PASS: gdb.base/store.exp: tbreak wack_longest
     PASS: gdb.base/store.exp: continue to wack_longest
     PASS: gdb.base/store.exp: var longest l; print old l, expecting -1
    -PASS: gdb.base/store.exp: var longest l; print old r, expecting -2
    +FAIL: gdb.base/store.exp: var longest l; print old r, expecting -2
     PASS: gdb.base/store.exp: var longest l; setting l to 4
     PASS: gdb.base/store.exp: var longest l; print new l, expecting 4
     PASS: gdb.base/store.exp: var longest l; next over add call
     PASS: gdb.base/store.exp: var longest l; print incremented l, expecting 2
     PASS: gdb.base/store.exp: tbreak wack_float
     PASS: gdb.base/store.exp: continue to wack_float
    -PASS: gdb.base/store.exp: var float l; print old l, expecting -1
    +FAIL: gdb.base/store.exp: var float l; print old l, expecting -1
     PASS: gdb.base/store.exp: var float l; print old r, expecting -2
    -PASS: gdb.base/store.exp: var float l; setting l to 4
    -PASS: gdb.base/store.exp: var float l; print new l, expecting 4
    +FAIL: gdb.base/store.exp: var float l; setting l to 4
    +FAIL: gdb.base/store.exp: var float l; print new l, expecting 4
     PASS: gdb.base/store.exp: var float l; next over add call
    -PASS: gdb.base/store.exp: var float l; print incremented l, expecting 2
    +FAIL: gdb.base/store.exp: var float l; print incremented l, expecting 2
     PASS: gdb.base/store.exp: tbreak wack_double
     PASS: gdb.base/store.exp: continue to wack_double
    -PASS: gdb.base/store.exp: var double l; print old l, expecting -1
    -PASS: gdb.base/store.exp: var double l; print old r, expecting -2
    -PASS: gdb.base/store.exp: var double l; setting l to 4
    -PASS: gdb.base/store.exp: var double l; print new l, expecting 4
    +FAIL: gdb.base/store.exp: var double l; print old l, expecting -1
    +FAIL: gdb.base/store.exp: var double l; print old r, expecting -2
    +FAIL: gdb.base/store.exp: var double l; setting l to 4
    +FAIL: gdb.base/store.exp: var double l; print new l, expecting 4
     PASS: gdb.base/store.exp: var double l; next over add call
    -PASS: gdb.base/store.exp: var double l; print incremented l, expecting 2
    +FAIL: gdb.base/store.exp: var double l; print incremented l, expecting 2
     PASS: gdb.base/store.exp: tbreak wack_doublest
     PASS: gdb.base/store.exp: continue to wack_doublest
    -PASS: gdb.base/store.exp: var doublest l; print old l, expecting -1
    -PASS: gdb.base/store.exp: var doublest l; print old r, expecting -2
    -PASS: gdb.base/store.exp: var doublest l; setting l to 4
    -PASS: gdb.base/store.exp: var doublest l; print new l, expecting 4
    +FAIL: gdb.base/store.exp: var doublest l; print old l, expecting -1
    +FAIL: gdb.base/store.exp: var doublest l; print old r, expecting -2
    +FAIL: gdb.base/store.exp: var doublest l; setting l to 4
    +FAIL: gdb.base/store.exp: var doublest l; print new l, expecting 4
     PASS: gdb.base/store.exp: var doublest l; next over add call
    -PASS: gdb.base/store.exp: var doublest l; print incremented l, expecting 2
    +FAIL: gdb.base/store.exp: var doublest l; print incremented l, expecting 2
     PASS: gdb.base/store.exp: tbreak add_charest
     PASS: gdb.base/store.exp: continue to add_charest
     PASS: gdb.base/store.exp: upvar charest l; up
    @@ -2231,30 +2231,30 @@ PASS: gdb.base/store.exp: tbreak add_longest
     PASS: gdb.base/store.exp: continue to add_longest
     PASS: gdb.base/store.exp: upvar longest l; up
     PASS: gdb.base/store.exp: upvar longest l; print old l, expecting -1
    -PASS: gdb.base/store.exp: upvar longest l; print old r, expecting -2
    +FAIL: gdb.base/store.exp: upvar longest l; print old r, expecting -2
     PASS: gdb.base/store.exp: upvar longest l; set l to 4
     PASS: gdb.base/store.exp: upvar longest l; print new l, expecting 4
     PASS: gdb.base/store.exp: tbreak add_float
     PASS: gdb.base/store.exp: continue to add_float
     PASS: gdb.base/store.exp: upvar float l; up
    -PASS: gdb.base/store.exp: upvar float l; print old l, expecting -1
    +FAIL: gdb.base/store.exp: upvar float l; print old l, expecting -1
     PASS: gdb.base/store.exp: upvar float l; print old r, expecting -2
    -PASS: gdb.base/store.exp: upvar float l; set l to 4
    -PASS: gdb.base/store.exp: upvar float l; print new l, expecting 4
    +FAIL: gdb.base/store.exp: upvar float l; set l to 4
    +FAIL: gdb.base/store.exp: upvar float l; print new l, expecting 4
     PASS: gdb.base/store.exp: tbreak add_double
     PASS: gdb.base/store.exp: continue to add_double
     PASS: gdb.base/store.exp: upvar double l; up
    -PASS: gdb.base/store.exp: upvar double l; print old l, expecting -1
    -PASS: gdb.base/store.exp: upvar double l; print old r, expecting -2
    -PASS: gdb.base/store.exp: upvar double l; set l to 4
    -PASS: gdb.base/store.exp: upvar double l; print new l, expecting 4
    +FAIL: gdb.base/store.exp: upvar double l; print old l, expecting -1
    +FAIL: gdb.base/store.exp: upvar double l; print old r, expecting -2
    +FAIL: gdb.base/store.exp: upvar double l; set l to 4
    +FAIL: gdb.base/store.exp: upvar double l; print new l, expecting 4
     PASS: gdb.base/store.exp: tbreak add_doublest
     PASS: gdb.base/store.exp: continue to add_doublest
     PASS: gdb.base/store.exp: upvar doublest l; up
    -PASS: gdb.base/store.exp: upvar doublest l; print old l, expecting -1
    -PASS: gdb.base/store.exp: upvar doublest l; print old r, expecting -2
    -PASS: gdb.base/store.exp: upvar doublest l; set l to 4
    -PASS: gdb.base/store.exp: upvar doublest l; print new l, expecting 4
    +FAIL: gdb.base/store.exp: upvar doublest l; print old l, expecting -1
    +FAIL: gdb.base/store.exp: upvar doublest l; print old r, expecting -2
    +FAIL: gdb.base/store.exp: upvar doublest l; set l to 4
    +FAIL: gdb.base/store.exp: upvar doublest l; print new l, expecting 4
     PASS: gdb.base/store.exp: tbreak wack_struct_1
     PASS: gdb.base/store.exp: continue to wack_struct_1
     PASS: gdb.base/store.exp: var struct 1 u; next to add_struct_1 call


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: [GCC PR55056] Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
  2013-06-14 13:39         ` [GCC PR55056] " Thomas Schwinge
@ 2013-06-14 14:24           ` Jan Kratochvil
  2014-09-09 21:17             ` Doug Evans
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2013-06-14 14:24 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gdb-patches, gcc

On Fri, 14 Jun 2013 15:02:47 +0200, Thomas Schwinge wrote:
> On Sun, 3 Feb 2013 18:27:21 +0100, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> > gdb/testsuite/
> > 2013-02-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > 
> > 	Workaround GCC PR debug/55056 and GDB PR server/15081.
> > 	* gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef.
> > 	(caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef.
> > 	(caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef.
> > 	* gdb.base/restore.exp: New variable opts.  Test caller3, caller4 and
> > 	caller5 for l1, l2 and l3.  New prepare_for_testing.
> > 	* gdb.base/store.c (wack_longest, wack_float, wack_double)
> > 	(wack_doublest): Protect l and r by GCC_PR_55056 #ifdef.
> > 	* gdb.base/store.exp: New variable opts.  Test longest, float, double
> > 	and doublest functions for l and r.  New prepare_for_testing.
> > 	* gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by
> > 	GCC_PR_55056 #ifdef.  Protect locar by GDB_PR_15081 #ifdef.
> > 	* gdb.trace/unavailable.c: Likewise.
> > 	* gdb.trace/collection.exp: New variable opts.  Test reglocal_test_func
> > 	for locf, locd and locar.  New prepare_for_testing.
> > 	(gdb_collect_locals_test): Increase list size to 43.
> > 	* gdb.trace/unavailable.exp: Likewise.
> 
> As far as I can tell, no consensus has yet been reached about the
> approach to fix this issue discussed in this thread.  (I have not looked
> at the proposed patch in detail.)

I have found now I posted the testsuite workaround for GDB
	http://sourceware.org/ml/gdb-patches/2013-01/msg00688.html
but it has never been checked-in (neither in Fedora) which explains why you
see PASS->FAIL (which I also see on Fedora 19).


Jan

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

* Re: [GCC PR55056] Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
  2013-06-14 14:24           ` Jan Kratochvil
@ 2014-09-09 21:17             ` Doug Evans
  2014-09-10 20:29               ` Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Doug Evans @ 2014-09-09 21:17 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Thomas Schwinge, gdb-patches

[- gcc]

Jan Kratochvil writes:
 > On Fri, 14 Jun 2013 15:02:47 +0200, Thomas Schwinge wrote:
 > > On Sun, 3 Feb 2013 18:27:21 +0100, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
 > > > gdb/testsuite/
 > > > 2013-02-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
 > > > 
 > > > 	Workaround GCC PR debug/55056 and GDB PR server/15081.
 > > > 	* gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef.
 > > > 	(caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef.
 > > > 	(caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef.
 > > > 	* gdb.base/restore.exp: New variable opts.  Test caller3, caller4 and
 > > > 	caller5 for l1, l2 and l3.  New prepare_for_testing.
 > > > 	* gdb.base/store.c (wack_longest, wack_float, wack_double)
 > > > 	(wack_doublest): Protect l and r by GCC_PR_55056 #ifdef.
 > > > 	* gdb.base/store.exp: New variable opts.  Test longest, float, double
 > > > 	and doublest functions for l and r.  New prepare_for_testing.
 > > > 	* gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by
 > > > 	GCC_PR_55056 #ifdef.  Protect locar by GDB_PR_15081 #ifdef.
 > > > 	* gdb.trace/unavailable.c: Likewise.
 > > > 	* gdb.trace/collection.exp: New variable opts.  Test reglocal_test_func
 > > > 	for locf, locd and locar.  New prepare_for_testing.
 > > > 	(gdb_collect_locals_test): Increase list size to 43.
 > > > 	* gdb.trace/unavailable.exp: Likewise.
 > > 
 > > As far as I can tell, no consensus has yet been reached about the
 > > approach to fix this issue discussed in this thread.  (I have not looked
 > > at the proposed patch in detail.)
 > 
 > I have found now I posted the testsuite workaround for GDB
 > 	http://sourceware.org/ml/gdb-patches/2013-01/msg00688.html
 > but it has never been checked-in (neither in Fedora) which explains why you
 > see PASS->FAIL (which I also see on Fedora 19).

Hi.

The patch kinda died at this point.
Have you thought of how you might do it differently now?
If not, any objections to committing it?

[rebased on top of current head]

gdb/testsuite/
2013-01-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Workaround GCC PR debug/55056 and GDB PR server/15081.
	* gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef.
	(caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef.
	(caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef.
	* gdb.base/restore.exp: New variable opts.  Test caller3, caller4 and
	caller5 for l1, l2 and l3.  New prepare_for_testing.
	* gdb.base/store.c (wack_longest, wack_float, wack_double)
	(wack_doublest): Protect l and r by GCC_PR_55056 #ifdef.
	* gdb.base/store.exp: New variable opts.  Test longest, float, double
	and doublest functions for l and r.  New prepare_for_testing.
	* gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by
	GCC_PR_55056 #ifdef.  Protect locar by GDB_PR_15081 #ifdef.
	* gdb.trace/collection.exp: New variable opts.  Test reglocal_test_func
	for locf, locd and locar.  New prepare_for_testing.
	(gdb_collect_locals_test): Increase list size to 43.

diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c
index 2ef0d36..70682da 100644
--- a/gdb/testsuite/gdb.base/restore.c
+++ b/gdb/testsuite/gdb.base/restore.c
@@ -205,6 +205,10 @@ caller2 (void)
 int
 caller3 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller3 prologue */
   register int l2 = increment (l1);
   register int l3 = increment (l2);
@@ -221,7 +225,15 @@ caller3 (void)
 int
 caller4 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller4 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
   register int l3 = increment (l2);
   register int l4 = increment (l3);
@@ -238,8 +250,20 @@ caller4 (void)
 int
 caller5 (void)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l1 = increment (0x7eeb);  /* caller5 prologue */
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l2 = increment (l1);
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register int l3 = increment (l2);
   register int l4 = increment (l3);
   register int l5 = increment (l4);
diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp
index 9bba535..65ef4b9 100644
--- a/gdb/testsuite/gdb.base/restore.exp
+++ b/gdb/testsuite/gdb.base/restore.exp
@@ -24,7 +24,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach caller { caller3 caller4 caller5 } { with_test_prefix $caller {
+    gdb_breakpoint $caller
+    gdb_continue_to_breakpoint $caller
+
+    foreach l { l1 l2 l3 } { with_test_prefix $l {
+	set test "info addr $l"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$l\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$l\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/store.c b/gdb/testsuite/gdb.base/store.c
index 545515d..3ac4a1a 100644
--- a/gdb/testsuite/gdb.base/store.c
+++ b/gdb/testsuite/gdb.base/store.c
@@ -98,6 +98,10 @@ wack_long (register long u, register long v)
 long
 wack_longest (register longest u, register longest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register longest l = u, r = v;
   l = add_longest (l, r);
   return l + r;
@@ -106,6 +110,10 @@ wack_longest (register longest u, register longest v)
 float
 wack_float (register float u, register float v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float l = u, r = v;
   l = add_float (l, r);
   return l + r;
@@ -114,6 +122,10 @@ wack_float (register float u, register float v)
 double
 wack_double (register double u, register double v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double l = u, r = v;
   l = add_double (l, r);
   return l + r;
@@ -122,6 +134,10 @@ wack_double (register double u, register double v)
 doublest
 wack_doublest (register doublest u, register doublest v)
 {
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register doublest l = u, r = v;
   l = add_doublest (l, r);
   return l + r;
diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp
index f0fab90..f235bd2 100644
--- a/gdb/testsuite/gdb.base/store.exp
+++ b/gdb/testsuite/gdb.base/store.exp
@@ -18,7 +18,37 @@
 standard_testfile
 set executable $testfile
 
-if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
+set opts {debug}
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
+    return -1
+}
+
+if {![runto_main]} {
+    return -1
+}
+
+foreach func { longest float double doublest } { with_test_prefix $func {
+    gdb_breakpoint wack_$func
+    gdb_continue_to_breakpoint wack_$func
+
+    foreach var { l r } { with_test_prefix $var {
+	set test "info addr $var"
+	gdb_test_multiple $test $test {
+	    -re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+		lappend opts additional_flags=-DGCC_PR_55056
+		xfail "$test (register variable has no location)"
+	    }
+	    -re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+		pass $test
+	    }
+	}
+    }}
+}}
+
+set executable ${testfile}opts
+
+if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c
index a568c37..9dcadae 100644
--- a/gdb/testsuite/gdb.trace/collection.c
+++ b/gdb/testsuite/gdb.trace/collection.c
@@ -141,10 +141,23 @@ int reglocal_test_func ()		/* test collecting register locals */
 {
   register char        locc = 11;
   register int         loci = 12;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register float       locf = 13.3;
+  /* volatile is a GCC PR debug/55056 workaround.  */
+#ifdef GCC_PR_55056
+  volatile
+#endif
   register double      locd = 14.4;
   register test_struct locst;
-  register int         locar[4];
+  /* The "register" removal is a GDB PR server/15081 workaround as it cannot
+     handle DW_OP_piece variables occupying more than 64 bits on gcc-4.8.0.  */
+#ifndef GDB_PR_15081
+  register
+#endif
+  int                  locar[4];
   int                  i;
 
   locst.memberc  = 15;
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index e0763d9..4fca436 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -19,7 +19,43 @@ load_lib "trace-support.exp"
 standard_testfile
 set executable $testfile
 
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+set opts {debug nowarnings}
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
+    return -1
+}
+
+if {![runto reglocal_test_func]} {
+    return -1
+}
+
+foreach var { locf locd } { with_test_prefix $var {
+    set test "info addr $var"
+    gdb_test_multiple $test $test {
+	-re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" {
+	    lappend opts additional_flags=-DGCC_PR_55056
+	    xfail "$test (register variable has no location)"
+	}
+	-re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" {
+	    pass $test
+	}
+    }
+}}
+
+set test "info addr locar"
+gdb_test_multiple $test $test {
+    -re "\r\nSymbol \"locar\" is a variable \[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\.\r\n$gdb_prompt $" {
+	lappend opts additional_flags=-DGDB_PR_15081
+	kfail gdb/15081 "$test (GDB cannot handle >64-bit trace data))"
+    }
+    -re "\r\nSymbol \"locar\" is .*\r\n$gdb_prompt $" {
+	pass $test
+    }
+}
+
+set executable ${testfile}opts
+
+if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} {
     return -1
 }
 
@@ -300,7 +336,7 @@ proc gdb_collect_locals_test { func mylocs msg } {
 
     # Find the comment-identified line for setting this tracepoint.
     set testline 0
-    gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
+    gdb_test_multiple "list $func, +43" "collect $msg: find tracepoint line" {
 	-re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
 	    set testline $expect_out(1,string)
 	    pass "collect $msg: find tracepoint line"

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

* Re: [GCC PR55056] Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL
  2014-09-09 21:17             ` Doug Evans
@ 2014-09-10 20:29               ` Jan Kratochvil
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Kratochvil @ 2014-09-10 20:29 UTC (permalink / raw)
  To: Doug Evans; +Cc: Thomas Schwinge, gdb-patches

On Tue, 09 Sep 2014 23:17:12 +0200, Doug Evans wrote:
> Have you thought of how you might do it differently now?

gcc-4.4.7-4.el6.x86_64 at least for restore.exp produces with line 75:
	gdb_test "info addr l$var"
only patterns:
	Symbol "l\d+" is a variable in $r\d+.

While gcc-4.9.1-7.fc21.x86_64 with the patch of mine we discuss here produces
in half the cases:
	Symbol "l1" is a complex DWARF expression: 0: DW_OP_fbreg -44
And therefore the testcase no longer really tests the GDB feature.

Therefore proposing to make it x86_64 arch specific testcase with
gcc-4.4.7-4.el6.x86_64-precompiled .S file.

For the test I tried only restore.exp now, I will check more the others.

Another possibility would be to make the testcase -Og compatible as GCC
hackers in
	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55056
say that the variables then should not be <optimized out>.
I have tested that with -Og the testcase currently FAILs already on various
line-matching issues.  But I find the arch-specific .S file safer.


Jan

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

end of thread, other threads:[~2014-09-10 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-26 20:27 [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL Jan Kratochvil
2013-01-28 19:57 ` Yao Qi
2013-01-29 18:16   ` Jan Kratochvil
     [not found]     ` <20130202092240.GA24458@host2.jankratochvil.net>
2013-02-03 17:27       ` Jan Kratochvil
2013-06-14 13:39         ` [GCC PR55056] " Thomas Schwinge
2013-06-14 14:24           ` Jan Kratochvil
2014-09-09 21:17             ` Doug Evans
2014-09-10 20:29               ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).