gdb: Allow GDB to _not_ load a previous command history
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / step-bt.exp
index e28148bc59787e3b92ff30fbcb617593829d7049..cae87c6ecceaebf1b1d9385048439661875d8dbb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright 2006-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 intent of this testcase is to assure that backtrace works while
 # single-stepping the instructions that prepare to call a function.
 
-if $tracelevel then {
-    strace $tracelevel
-}
 
-set prms_id 0
-set bug_id 0
+standard_testfile
 
-set testfile step-bt
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested "Couldn't compile test program"
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-# Get things started.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 gdb_test "break *hello" \
          "Breakpoint.*at.* file .*$srcfile, line .*" \
          "breakpoint at first instruction of hello()"
 
 gdb_run_cmd
-gdb_expect {
-    -re ".*Breakpoint.* hello .* at .*$srcfile:.*$gdb_prompt $"  {
-       pass "run to hello()"
-    }
-    -re ".*$gdb_prompt $" {
-       fail "run to hello()"
-       return -1
-    }
-    timeout {
-        fail "run to hello() (timeout)"
-        return -1
-    }
-}
+gdb_test "" "Breakpoint.* hello .* at .*$srcfile:.*" "run to hello()"
 
 gdb_test "stepi" \
-         "" \
+         ".*" \
          "step first instruction"
 
 gdb_test "bt" \
@@ -66,7 +39,7 @@ gdb_test "bt" \
          "backtrace after first instruction step"
 
 gdb_test "stepi" \
-         "" \
+         ".*" \
          "step second instruction"
 
 gdb_test "bt" \
This page took 0.027145 seconds and 4 git commands to generate.