]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2004-08-26 Paul Gilliam <pgilliam@us.ibm.com>
authorMichael Chastain <mec@google.com>
Thu, 26 Aug 2004 18:02:59 +0000 (18:02 +0000)
committerMichael Chastain <mec@google.com>
Thu, 26 Aug 2004 18:02:59 +0000 (18:02 +0000)
* gdb.base/call-sc.exp (test_scalar_returns): Make sure PC is
synchronized after the "return".

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/call-sc.exp

index f0cfc404df46ba61c4a300010ff593141be418a1..ad443108b03302246b2c4ba8cb8497618ab77d9c 100644 (file)
@@ -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>.
index d42e725a1f43ea3a3b6636c258f1df3be441114c..01a9f152097cbed958d36f9f6d95f9a94ed530e5 100644 (file)
@@ -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.