]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.reverse/finish-reverse.exp
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.reverse / finish-reverse.exp
index 69d5df2c6d7a0c6fb81e182d66e046cda04555e9..91147f26c23cd61ee6de4ebf7a9b0fbfadd01fc6 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2008, 2009 Free Software Foundation, Inc.
+# Copyright 2008-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # This file is part of the GDB testsuite.  It tests 'finish' with
 # reverse debugging.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
-set testfile "finish-reverse"
-set srcfile ${testfile}.c
+standard_testfile
 
 if { [prepare_for_testing $testfile.exp "$testfile" $srcfile] } {
     return -1
 }
 
-proc test_start_of_line { line_text test_msg } {
-    global gdb_prompt
-    global decimal
-    global hex
-
-    send_gdb "info line\n"
-    gdb_expect {
-       -re "Line $decimal of .* starts at address ($hex) .*$gdb_prompt $" {
-           set line_begin $expect_out(1,string)
-       }
-       default {
-           fail "Get line address in test_start_of_line"
-       }
-    }
-    send_gdb "info reg pc\n"
-    gdb_expect {
-       -re ".*: ($hex)\r\n*$gdb_prompt $" {
-           set stop_pc $expect_out(1,string)
-       }
-       default {
-           fail"Get stop pc in test_start_of_line"
-       }
-    }
-    gdb_test "print $line_begin == $stop_pc" \
-       " = 1\[\r\n\]*" \
-       "test_start_of_line, $test_msg"
-}
-
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
-    gdb_test "record" "" "Turn on process record"
-    # FIXME: command ought to acknowledge, so we can test if it succeeded.
+    gdb_test_no_output "record" "Turn on process record"
 }
 
 # Test finish from void func
@@ -183,7 +153,7 @@ gdb_test_multiple "finish" "$test_msg" {
 ###
 
 # Now switch to reverse
-gdb_test "set exec-dir reverse" "" "set reverse execution"
+gdb_test_no_output "set exec-dir reverse" "set reverse execution"
 
 # Test reverse finish from long long func
 
@@ -193,7 +163,7 @@ gdb_continue_to_breakpoint "long_long_func" ".*/$srcfile:$breakloc.*"
 set test_msg "reverse finish from long_long_func"
 gdb_test_multiple "finish" "$test_msg" {
     -re ".* long_checkpoint.*$gdb_prompt $" {
-       test_start_of_line "long_checkpoint" "$test_msg"
+       pass "$test_msg"
     }
 }
 
@@ -205,7 +175,7 @@ gdb_continue_to_breakpoint "long_func" ".*/$srcfile:$breakloc.*"
 set test_msg "reverse finish from long_func"
 gdb_test_multiple "finish" "$test_msg" {
     -re ".* int_checkpoint.*$gdb_prompt $" {
-       test_start_of_line "int_checkpoint" "$test_msg"
+       pass "$test_msg"
     }
 }
 
@@ -217,7 +187,7 @@ gdb_continue_to_breakpoint "int_func" ".*/$srcfile:$breakloc.*"
 set test_msg "reverse finish from int_func"
 gdb_test_multiple "finish" "$test_msg" {
     -re ".* short_checkpoint.*$gdb_prompt $" {
-       test_start_of_line "short_checkpoint" "$test_msg"
+       pass "$test_msg"
     }
 }
 
@@ -229,7 +199,7 @@ gdb_continue_to_breakpoint "short_func" ".*/$srcfile:$breakloc.*"
 set test_msg "reverse finish from short_func"
 gdb_test_multiple "finish" "$test_msg" {
     -re ".* char_checkpoint.*$gdb_prompt $" {
-       test_start_of_line "char_checkpoint" "$test_msg"
+       pass "$test_msg"
     }
 }
 
@@ -241,7 +211,7 @@ gdb_continue_to_breakpoint "char_func" ".*/$srcfile:$breakloc.*"
 set test_msg "reverse finish from char_func"
 gdb_test_multiple "finish" "$test_msg" {
     -re ".* void_checkpoint.*$gdb_prompt $" {
-       test_start_of_line "void_checkpoint" "$test_msg"
+       pass "$test_msg"
     }
 }
 
@@ -253,8 +223,6 @@ gdb_continue_to_breakpoint "void_func" ".*/$srcfile:$breakloc.*"
 set test_msg "reverse finish from void_func"
 gdb_test_multiple "finish" "$test_msg" {
     -re ".* call to void_func.*$gdb_prompt $" {
-       test_start_of_line "call to void_func" "$test_msg"
+       pass "$test_msg"
     }
 }
-
-return 0