dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing Expect/Dejagnu commands question


From: Bob Rossi
Subject: Re: Mixing Expect/Dejagnu commands question
Date: Mon, 7 Feb 2005 12:27:48 -0500
User-agent: Mutt/1.3.28i

On Mon, Feb 07, 2005 at 11:53:49AM -0500, Daniel Jacobowitz wrote:
> On Mon, Feb 07, 2005 at 11:39:18AM -0500, Bob Rossi wrote:
> > Once I do that, I send a command to GDB with 'remote_send'. I then get
> > the output with 'remote_expect'. All of this probably sounds typical to
> > you. The part that is not typical is when I need to set 'spawn_id' and call
> > 'expect' to read the output of the inferior process. See below,
> > 
> >    remote_send "send_string"
> >    remote_expect "expected string"
> > 
> >    # change to the 'spawn -pty' process, and read the output
> >    set spawn_id $tty_id_from_spawn_pty
> >    expect -re "inferior output regex"
> >    unset spawn_id
> > 
> > This allows me to read the output from both GDB and the inferior
> > process, in two distinct streams. 
> > 
> > After all of this, my question is, will setting the 'spawn_id' variable
> > and calling 'spawn' and 'expect' somehow corrupt the internals of
> > dejagnu's remote_* functions? Or is this a safe thing to do?
> 
> Can't you use expect -i $tty_id_from_spawn_pty instead?

Yes, thanks Daniel, this is even cleaner!

I'm still wondering though, does using 'spawn -pid' and 'expect -i' mess
with any of the remote_* functions that dejagnu provides? Am I possibly
corrupting buffers that these functions use by throwing 'expect' in the
middle here and there?

Thanks,
Bob Rossi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]