[gdb/testsuite] Add test-case gold-gdb-index.exp
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / step-line.exp
index 9754fddcee0237f6af8257002ba82dce44008758..fce8628eeb01b6aea8e13691a8aba5c6124e657c 100644 (file)
@@ -1,21 +1,18 @@
-# Copyright 2001, 2003 Free Software Foundation, Inc.
+# Copyright 2001-2020 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
 # use this to debug:
 #
 #log_user 1
 # step-line.exp -- Expect script to test stepping in files with
 # #line directives.
 
-if $tracelevel then {
-    strace $tracelevel
-}
-
-set testfile step-line
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
+set linefile ${testfile}.inp
 
-remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+    return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if ![runto_main] then {
-   fail "Can't run to main"
+   fail "can't run to main"
    return 0
 }
 
-gdb_test "break f1" ".*Breakpoint 2 at .* file step-line.c.*" "break f1"
+set remote_linefile [gdb_remote_download host ${srcdir}/${subdir}/${linefile}]
+
+gdb_test "break f1" ".*Breakpoint 2 at .* file .*step-line.c.*"
 gdb_test "continue" \
          "Continuing.*Breakpoint 2, f1 \\(i=4\\).*dummy \\(1, i\\);" \
         "continue to f1"
@@ -92,4 +80,5 @@ gdb_test "next" \
 gdb_test "next" \
          ".*RETURN \\(j\\);.*" \
         "next over dummy 10"
+
 return 0
This page took 0.026945 seconds and 4 git commands to generate.