diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/attach.exp | 23 |
2 files changed, 28 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8977404..6196c58 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-02-15 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gdb.base/attach.exp (attach to nonsense is prohibited): Make the + "Illegal process-id" expect string more exact. + (attach to digits-starting nonsense is prohibited): New. + 2010-02-13 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/prelink.exp (set verbose on): New. diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp index 8729d58..a507e3b 100644 --- a/gdb/testsuite/gdb.base/attach.exp +++ b/gdb/testsuite/gdb.base/attach.exp @@ -93,7 +93,28 @@ proc do_attach_tests {} { set test "attach to nonsense is prohibited" gdb_test_multiple "attach abc" "$test" { - -re "Illegal process-id: abc.*$gdb_prompt $" { + -re "Illegal process-id: abc\\.\r\n$gdb_prompt $" { + pass "$test" + } + -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" { + # Response expected from /proc-based systems. + pass "$test" + } + -re "Can't attach to process..*$gdb_prompt $" { + # Response expected on Cygwin + pass "$test" + } + -re "Attaching to.*$gdb_prompt $" { + fail "$test (bogus pid allowed)" + } + } + + # Verify that we cannot attach to nonsense even if its initial part is + # a valid PID. + + set test "attach to digits-starting nonsense is prohibited" + gdb_test_multiple "attach ${testpid}x" "$test" { + -re "Illegal process-id: ${testpid}x\\.\r\n$gdb_prompt $" { pass "$test" } -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" { |