diff options
author | Pedro Alves <palves@redhat.com> | 2011-09-08 14:56:34 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-09-08 14:56:34 +0000 |
commit | a391a2f6df2553b9d2e0cf4bc8c58e85d73137ae (patch) | |
tree | 01993cb0c399757ca76dc58f90520629c8a3ccfa /gdb/testsuite/gdb.base/annota1.exp | |
parent | 85bc8cb7855e8ae9ba6e207ed557f849479c41c0 (diff) | |
download | gdb-a391a2f6df2553b9d2e0cf4bc8c58e85d73137ae.zip gdb-a391a2f6df2553b9d2e0cf4bc8c58e85d73137ae.tar.gz gdb-a391a2f6df2553b9d2e0cf4bc8c58e85d73137ae.tar.bz2 |
2011-09-08 Pedro Alves <pedro@codesourcery.com>
* gdb.base/annota1.exp, gdb.base/annota3.exp: Extract the
inferior's pid and look for a core dump named core.$pid. Use
`remote_file' commands on the host instead of hand coding shell
commands on the build.
* gdb.base/valgrind-db-attach.exp: Kill the program before
finishing the test.
Diffstat (limited to 'gdb/testsuite/gdb.base/annota1.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/annota1.exp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp index 1517907..9ceeeac 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -392,6 +392,17 @@ gdb_test_multiple "next" "breakpoint ignore count" { } } +# Get the inferior's PID for later. + +set test "get inferior pid" +set pid -1 +gdb_test_multiple "info inferior 1" "$test" { + -re "process (\[0-9\]*).*$gdb_prompt$" { + set pid $expect_out(1,string) + pass "$test" + } +} + # # Send a signal that is not handled; test: # annotate-signalled @@ -422,21 +433,17 @@ if [target_info exists gdb,nosignals] { } } - # Check for production of a core file and remove it! -set exec_output [remote_exec build "ls core"] - set test "cleanup core file" -if [ regexp "core not found" $exec_output] { - pass "$test (not dumped)" +if { [remote_file host exists core] } { + remote_file host delete core + pass "$test (removed)" +} elseif { $pid != -1 && [remote_file host exists core.$pid] } { + remote_file host delete core.$pid + pass "$test (removed)" } else { - if [ regexp "No such file or directory" $exec_output] { - pass "$test (not dumped)" - } else { - remote_exec build "rm -f core" - pass "$test (removed)" - } + pass "$test (not dumped)" } proc thread_test {} { |