This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] (long) sepdebug.exp replace send_gdb with gdb_test
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Michael Snyder <msnyder at vmware dot com>
- Date: Thu, 20 May 2010 17:41:52 +0100
- Subject: Re: [RFA] (long) sepdebug.exp replace send_gdb with gdb_test
- References: <4BF47D1D.2030005@vmware.com>
I didn't to a thorough review, but I noticed a couple of
issues.
On Thursday 20 May 2010 01:06:53, Michael Snyder wrote:
>
> -# Test deleting all breakpoints when there are none installed,
> -# GDB should not prompt for confirmation.
> -# Note that gdb-init.exp provides a "delete_breakpoints" proc
> -# for general use elsewhere.
> -
> -send_gdb "delete breakpoints\n"
> -gdb_expect {
> - -re "Delete all breakpoints.*$" {
> - send_gdb "y\n"
> - gdb_expect {
> - -re "$gdb_prompt $" {
> - fail "Delete all breakpoints when none (unexpected prompt)"
> - }
> - timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" }
> - }
> - }
> - -re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" }
> - timeout { fail "Delete all breakpoints when none (timeout)" }
> -}
> +delete_breakpoints
delete_breakpoints doesn't do what the test was doing before.
Notice the comment.. Whether what is being tested or not has any
value in this case, is another question, but it seems
to have been just blindly copied from break.exp. You could
just delete it it seems.
> - -re "Catchpoint \[0-9\]* .fork..*$gdb_prompt $"
> - {pass $name}
> - -re "Catch of fork not yet implemented.*$gdb_prompt $"
> - {pass $name}
> - -re "$gdb_prompt $"
> - {fail $name}
> - timeout {fail "(timeout) $name"}
> +gdb_test_multiple "catch fork" $name {
> + -re "Catchpoint \[0-9\]* .fork.*" {
> + pass $name
You should make sure to always consume the prompt with gdb_test_multiple,
otherwise, it may be left in the input stream and confuse follow up tests.
--
Pedro Alves