@@ -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);
@@ -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
}
@@ -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;
@@ -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
}
@@ -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;
@@ -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"
@@ -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;
@@ -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
}