summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chastain <mec@google.com>2004-08-26 18:02:59 +0000
committerMichael Chastain <mec@google.com>2004-08-26 18:02:59 +0000
commit3a77aa28110170f079bf4e5835ca55136be0a2d3 (patch)
tree584bada2dd24cebd2d45524728e240a78f6f7990
parent85a84e7a87d99f18c509431f799d1eb81ba70c1b (diff)
downloadppe42-binutils-3a77aa28110170f079bf4e5835ca55136be0a2d3.tar.gz
ppe42-binutils-3a77aa28110170f079bf4e5835ca55136be0a2d3.zip
2004-08-26 Paul Gilliam <pgilliam@us.ibm.com>
* gdb.base/call-sc.exp (test_scalar_returns): Make sure PC is synchronized after the "return".
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/call-sc.exp24
2 files changed, 29 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f0cfc404df..ad443108b0 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-26 Paul Gilliam <pgilliam@us.ibm.com>
+
+ * gdb.base/call-sc.exp (test_scalar_returns): Make sure PC is
+ synchronized after the "return".
+
2004-08-26 Michael Chastain <mec.gnu@mindspring.com>
* gdb.mi/basics.c: Include <stdio.h>.
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index d42e725a1f..01a9f15209 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -281,6 +281,30 @@ proc test_scalar_returns { } {
}
}
+ # If the previous test did not work, the program counter might
+ # still be inside foo() rather than main(). Make sure the program
+ # counter is is main().
+ #
+ # This happens on ppc64 GNU/Linux with gcc 3.4.1 and a buggy GDB
+
+ set test "return foo; synchronize pc to main()"
+ for {set loop_count 0} {$loop_count < 2} {incr loop_count} {
+ gdb_test_multiple "backtrace 1" $test {
+ -re "#0.*main \\(\\).*${gdb_prompt} $" {
+ pass $test
+ set loop_count 2
+ }
+ -re "#0.*fun \\(\\).*${gdb_prompt} $" {
+ if {$loop_count < 1} {
+ gdb_test "finish" ".*" ""
+ } else {
+ fail $test
+ set loop_count 2
+ }
+ }
+ }
+ }
+
# Check that the return-value is as expected. At this stage we're
# just checking that GDB has returned a value consistent with
# "return_value_unknown" set above.
OpenPOWER on IntegriCloud