[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mixing Expect/Dejagnu commands question
From: |
Bob Rossi |
Subject: |
Mixing Expect/Dejagnu commands question |
Date: |
Mon, 7 Feb 2005 11:39:18 -0500 |
User-agent: |
Mutt/1.3.28i |
Hi,
I'm new to Expect and Dejagnu, so I hope this question is phrased OK.
I'm currently using Dejagnu with GDB's testsuite. Currently, GDB calls
remote_spawn instead of spawn. There's no documentation on the web
(that I could find) about what this command does but I'm assuming it's
just calling spawn, but doing configuration details behind the scene.
Also, it seems to be keeping track of all the spawn_id vars, and stuff
like that.
So here's what I hope to do,
I have to call 'spawn -pty' to get Expect to open a new pty for me, so
that I can give the inferior ( program GDB is debugging ) a separate tty
to work on. Then I would like to call remote_spawn to start GDB, like it
does now. For instance,
spawn -pty
set inferior_spawn_id $spawn_id
set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]
"];
...
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?
Thanks,
Bob Rossi
- Mixing Expect/Dejagnu commands question,
Bob Rossi <=