diff options
author | Tom de Vries <tdevries@suse.de> | 2020-05-06 13:49:34 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-05-06 13:49:34 +0200 |
commit | abf6d805a0dfa792fdf232dabd7de18d2fe20834 (patch) | |
tree | 0d5322b7031dcc5b2f0859fd6b5ca9c65d455b5f | |
parent | 0fc2a808cbf5302016535367191bb8cd0900f332 (diff) | |
download | gdb-abf6d805a0dfa792fdf232dabd7de18d2fe20834.zip gdb-abf6d805a0dfa792fdf232dabd7de18d2fe20834.tar.gz gdb-abf6d805a0dfa792fdf232dabd7de18d2fe20834.tar.bz2 |
[gdb/testsuite] Fix gdb.base/store.exp with gcc-10
When running gdb.base/store.exp with gcc-10 instead of gcc-9, we have:
...
(gdb) PASS: gdb.base/store.exp: continue to wack_double
print l^M
-$22 = <optimized out>^M
+$22 = -1^M
-(gdb) UNSUPPORTED: gdb.base/store.exp: var double l; print old l, expecting -1
-(gdb) PASS: gdb.base/store.exp: var double l; print old l, expecting -1
+print r^M
+$23 = <optimized out>^M
+(gdb) FAIL: gdb.base/store.exp: var double l; print old r, expecting -2
...
With gcc-9, there's no location info for both l and r, but with gcc-10,
there's location info for l, but not r.
The test-case only checks for location info availability of l, and then
assumes location info for r is also available.
Fix this by allowing missing location info for r.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-05-06 Tom de Vries <tdevries@suse.de>
* gdb.base/store.exp (check_set, up_set): Allowing missing location
info for r.
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/store.exp | 52 |
2 files changed, 41 insertions, 16 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b2f9091..7a62fe8 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2020-05-06 Tom de Vries <tdevries@suse.de> + * gdb.base/store.exp (check_set, up_set): Allowing missing location + info for r. + +2020-05-06 Tom de Vries <tdevries@suse.de> + * gdb.base/shlib-call.exp: Add extra step to reach shmain.c:42, if necessary. diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp index 4708662..f3a6c06 100644 --- a/gdb/testsuite/gdb.base/store.exp +++ b/gdb/testsuite/gdb.base/store.exp @@ -55,26 +55,37 @@ proc check_set { t l r new add } { } } - set supported 1 + set supported_l 1 set test "${prefix}; print old l, expecting ${l}" gdb_test_multiple "print l" "$test" { - -re " = <optimized out>\r\n$gdb_prompt $" { + -re -wrap " = <optimized out>" { unsupported $test - set supported 0 + set supported_l 0 } - -re " = ${l}\r\n$gdb_prompt $" { + -re -wrap " = ${l}" { pass $test } } - if { $supported } { - gdb_test "print r" " = ${r}" \ - "${prefix}; print old r, expecting ${r}" + + set test "${prefix}; print old r, expecting ${r}" + gdb_test_multiple "print r" "$test" { + -re -wrap " = <optimized out>" { + unsupported $test + } + -re -wrap " = ${r}" { + pass $test + } + } + + if { $supported_l } { gdb_test_no_output "set variable l = 4" \ "${prefix}; setting l to 4" gdb_test "print l" " = ${new}" \ "${prefix}; print new l, expecting ${new}" - gdb_test "next" "return l \\+ r;" \ - "${prefix}; next over add call" + } + gdb_test "next" "return l \\+ r;" \ + "${prefix}; next over add call" + if { $supported_l } { gdb_test "print l" " = ${add}" \ "${prefix}; print incremented l, expecting ${add}" } @@ -101,20 +112,29 @@ proc up_set { t l r new } { gdb_test "up" "l = add_${t} .l, r.;" \ "${prefix}; up" - set supported 1 + set supported_l 1 set test "${prefix}; print old l, expecting ${l}" gdb_test_multiple "print l" "$test" { - -re " = <optimized out>\r\n$gdb_prompt $" { + -re -wrap " = <optimized out>" { unsupported $test - set supported 0 + set supported_l 0 } - -re " = ${l}\r\n$gdb_prompt $" { + -re -wrap " = ${l}" { pass $test } } - if { $supported } { - gdb_test "print r" " = ${r}" \ - "${prefix}; print old r, expecting ${r}" + + set test "${prefix}; print old r, expecting ${r}" + gdb_test_multiple "print r" "$test" { + -re -wrap " = <optimized out>" { + unsupported $test + } + -re -wrap " = ${r}" { + pass $test + } + } + + if { $supported_l } { gdb_test_no_output "set variable l = 4" \ "${prefix}; set l to 4" gdb_test "print l" " = ${new}" \ |