Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: GDB Discussion <gdb@sources.redhat.com>
Subject: Re: gdb_expect and default{} vs timeout{}
Date: Thu, 15 Feb 2001 22:53:00 -0000	[thread overview]
Message-ID: <3A8CCDD5.32AF948D@redhat.com> (raw)
In-Reply-To: <3A8B69C1.D059D535@cygnus.com>

Andrew Cagney wrote:
> 
> Hello,
> 
> This is kind of a dejagnu question.  In pthreads.exp there is the code:
> 
>     gdb_expect {
>         ....
>         default {
>             fail "continue to bkpt at common_routine in thread 2
> (default)"
>         }
>         timeout {
>             fail "continue to bkpt at common_routine in thread 2
> (timeout)"
>         }
>     }
> 
> what I don't understand is the purpose that both of these serve.  If
> there is a default, will the timeout action ever occure?
> 

Sorry for the delay.

You are right, this is sort of weird.  

"default" is equivalent to `"eof" or "timeout"'.

If you want to do the same thing in both "eof" and "timeout" conditions,
then use "default" instead (just to save typing).

I don't think the code above, although redundant, will cause any harm. 
Probably the default clause will take precedence for being specified
first, so the timeout clause is never used.


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


  reply	other threads:[~2001-02-15 22:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-14 21:36 Andrew Cagney
2001-02-15 22:53 ` Fernando Nasser [this message]
2001-02-16  8:45   ` Andrew Cagney
2001-02-14 21:48 Michael Elizabeth Chastain

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=3A8CCDD5.32AF948D@redhat.com \
    --to=fnasser@redhat.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb@sources.redhat.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