From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Andrew Cagney Cc: GDB Discussion Subject: Re: gdb_expect and default{} vs timeout{} Date: Thu, 15 Feb 2001 22:53:00 -0000 Message-id: <3A8CCDD5.32AF948D@redhat.com> References: <3A8B69C1.D059D535@cygnus.com> X-SW-Source: 2001-02/msg00200.html 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