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] != "" } {
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 $"\
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 $"\
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.)