This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb_expect and default{} vs timeout{}
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: gdb_expect and default{} vs timeout{}
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Fri, 16 Feb 2001 01:51:01 -0500
- CC: GDB Discussion <gdb at sources dot redhat dot com>
- Organization: Red Hat Canada
- References: <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