]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/foll-exec.exp
[testsuite] Remove BASEDIR
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / foll-exec.exp
index 7d86d0140027b3758e98a63e826a8aca66be433d..8859f9f8c36eeb226fae5e4522063384c60f0e45 100644 (file)
@@ -29,8 +29,6 @@ set srcfile2 ${testfile2}.c
 set binfile2 [standard_output_file ${testfile2}]
 
 set compile_options debug
-set dirname [relative_filename [pwd] [file dirname $binfile]]
-lappend compile_options "additional_flags=-DBASEDIR=\"$dirname\""
 
 # build the first test case
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $compile_options] != "" } {
@@ -80,19 +78,17 @@ proc do_exec_tests {} {
      fail "Couldn't run ${testfile}"
      return
    }
+   # Execute the code setting up variable PROG.
+   set tbreak_line [gdb_get_line_number " tbreak-execlp " $srcfile]
+   gdb_test "tbreak ${tbreak_line}"
+   gdb_continue_to_breakpoint "line tbreak-execlp" ".*execlp \\(.*"
 
    # Verify that we can see various global and local variables
    # in this program, and that they have expected values.  Some
    # of these variables are also declared in the program we'll
    # exec in a moment.
    #
-   send_gdb "next 3\n"
-   gdb_expect {
-     -re "execlp \\(.*$gdb_prompt $"\
-                     {pass "step to exec call"}
-     -re "$gdb_prompt $" {fail "step to exec call"}
-     timeout         {fail "(timeout) step to exec call"}
-   }
+
    send_gdb "print global_i\n"
    gdb_expect {
      -re ".* = 100.*$gdb_prompt $"\
@@ -238,11 +234,15 @@ proc do_exec_tests {} {
      fail "Couldn't run ${testfile} (3rd try)"
      return
    }
+   # Execute the code setting up variable PROG.
+   set tbreak_line [gdb_get_line_number " tbreak-execlp " $srcfile]
+   gdb_test "tbreak ${tbreak_line}"
+   gdb_continue_to_breakpoint "line tbreak-execlp" ".*execlp \\(.*"
 
    # Verify that we can follow through follow an execl()
    # call.  (We must jump around earlier exec* calls.)
    #
-   set tbreak_line [gdb_get_line_number "tbreak-execl" $srcfile]
+   set tbreak_line [gdb_get_line_number " tbreak-execl " $srcfile]
    send_gdb "tbreak ${tbreak_line}\n"
    gdb_expect {
      -re "Temporary breakpoint .*file .*${srcfile}, line ${tbreak_line}.*$gdb_prompt $"\
@@ -299,6 +299,10 @@ proc do_exec_tests {} {
      fail "Couldn't run ${testfile} (4th try)"
      return
    }
+   # Execute the code setting up variable PROG.
+   set tbreak_line [gdb_get_line_number " tbreak-execlp " $srcfile]
+   gdb_test "tbreak ${tbreak_line}"
+   gdb_continue_to_breakpoint "line tbreak-execlp" ".*execlp \\(.*"
 
    # Verify that we can follow through follow an execv()
    # call.  (We must jump around earlier exec* calls.)