diff options
Diffstat (limited to 'gdb/testsuite/gdb.base/foll-exec.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/foll-exec.exp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp index 21c69af..1a4d2a7 100644 --- a/gdb/testsuite/gdb.base/foll-exec.exp +++ b/gdb/testsuite/gdb.base/foll-exec.exp @@ -11,16 +11,9 @@ # 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, see <http://www.gnu.org/licenses/>. */ +# 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 - -if $tracelevel then { - strace $tracelevel - } - -if { ![isnative] } then { +if { [is_remote target] || ![isnative] } then { continue } @@ -48,7 +41,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # Until "catch exec" is implemented on other targets... # -if ![istarget "hppa*-hp-hpux*"] then { +if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { continue } @@ -93,6 +86,33 @@ proc do_exec_tests {} { return } + # Verify that the system supports "catch exec". + gdb_test "catch exec" "Catchpoint \[0-9\]* \\(exec\\)" "insert first exec catchpoint" + set has_exec_catchpoints 0 + gdb_test_multiple "continue" "continue to first exec catchpoint" { + -re ".*Your system does not support exec catchpoints.*$gdb_prompt $" { + unsupported "continue to first exec catchpoint" + } + -re ".*Catchpoint.*$gdb_prompt $" { + set has_exec_catchpoints 1 + pass "continue to first exec catchpoint" + } + } + + if {$has_exec_catchpoints == 0} { + unsupported "exec catchpoints" + return + } + + zap_session + + # Start the program running, and stop at main. + # + if ![runto_main] then { + perror "Couldn't run ${testfile}" + return + } + # 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 @@ -213,7 +233,7 @@ proc do_exec_tests {} { setup_xfail hppa2.0w-hp-hpux* CLLbs16760 send_gdb "continue\n" gdb_expect { - -re ".*Executing new program:.*${testfile2}.*Catchpoint .*(exec\'d .*${testfile2}).*in .START..*$gdb_prompt $"\ + -re ".*Executing new program:.*${testfile2}.*Catchpoint .*(exec\'d .*${testfile2}).*in .*$gdb_prompt $"\ {pass "hit catch exec"} -re "$gdb_prompt $" {fail "hit catch exec"} timeout {fail "(timeout) hit catch exec"} |