Fix more cases of improper test names
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / step-test.exp
index 70c4d0db310bdfc41c618280c296dfe4fc5a1861..64bb2e36fc178bd4f3640b1ad9ec49fb8655ab08 100644 (file)
@@ -1,44 +1,33 @@
 # This testcase is part of GDB, the GNU debugger.
 
-# Copyright 1997, 1998, 1999, 2000, 2002, 2001, 2003, 2004 Free
-# Software Foundation, Inc.
+# Copyright 1997-2016 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/>.  */
 # step-test.exp -- Expect script to test stepping in gdb
 
-if $tracelevel then {
-    strace $tracelevel
-}
-
-set testfile step-test
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 remote_exec build "rm -f ${binfile}"
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested step-test.exp
+     untested "failed to compile"
      return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
-   fail "Can't run to main"
+   fail "can't run to main"
    return 0
 }
 
@@ -76,7 +65,7 @@ gdb_test "step" ".*${decimal}.*myglob.*"   "step into"
 # to the restoration of the global pointer (which is a caller-save).
 # Similarly on MIPS PIC targets.
 set test "step out"
-if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] || [istarget "mips*-*-*"]} {
+if { [istarget "ia64-*-*"] || [istarget "mips*-*-*"]} {
     gdb_test_multiple "finish" "$test" {
         -re ".*${decimal}.*a.*5.*= a.*3.*$gdb_prompt $" {
            pass "$test"
@@ -129,8 +118,11 @@ proc test_i {name command here there} {
 test_i "stepi to next line" "stepi" \
        ".*${decimal}.*a.*5.* = a.*3" \
        ".*${decimal}.*callee.*STEPI"
+
+# Continue to step until we enter the function.  Also keep stepping
+# if this passes through a (useless) PLT entry.
 test_i "stepi into function" "stepi" \
-       ".*${decimal}.*callee.*STEPI" \
+       "(.*${decimal}.*callee.*STEPI|.* in callee@plt)" \
        ".*callee \\(\\) at .*step-test\\.c" 
 
 # Continue to step until we reach the function's body.  This makes it
@@ -148,7 +140,7 @@ gdb_test_multiple "finish" "$test" {
     -re ".*${decimal}.*callee.*NEXTI.*$gdb_prompt $" {
        pass "$test"
     }
-    -re ".*(Program received|Program exited).*$gdb_prompt $" {
+    -re ".*(Program received|$inferior_exited_re).*$gdb_prompt $" {
        # Oops... We ran to the end of the program...  Better reset     
        if {![runto_main]} then {
            fail "$test (Can't run to main)"
@@ -165,7 +157,7 @@ gdb_test_multiple "finish" "$test" {
        # On IA-64, we end up on callee instead of on the following line due
        # to the restoration of the global pointer.
        # Similarly on MIPS PIC targets.
-       if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] || [istarget "mips*-*-*"] } {
+       if { [istarget "ia64-*-*"] || [istarget "mips*-*-*"] } {
            test_i "$test" "stepi" \
                ".*${decimal}.*callee.*STEPI"  ".*${decimal}.*callee.*NEXTI"
        } else {
This page took 0.02633 seconds and 4 git commands to generate.