Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Michael Snyder <msnyder@vmware.com>
Subject: Re: [RFA] (long) sepdebug.exp replace send_gdb with gdb_test
Date: Thu, 20 May 2010 16:47:00 -0000	[thread overview]
Message-ID: <201005201741.52364.pedro@codesourcery.com> (raw)
In-Reply-To: <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


  reply	other threads:[~2010-05-20 16:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20  0:59 Michael Snyder
2010-05-20 16:47 ` Pedro Alves [this message]
2010-05-20 18:02   ` Michael Snyder
2010-05-20 18:15     ` Pedro Alves
2010-05-20 18:24       ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201005201741.52364.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox