This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/testsuite] MI inferior's output in remote target


On 10/26/2011 09:28 PM, Pedro Alves wrote:
>> > I look at my work again, and think my original attempt works, but 
>> > expect is unable to get these output.  During test, inferior-tty is 
>> > set to `/dev/pts/55', for example, and update 
>> > gdb_stdtarg/gdb_stdtargerr to a new ui-file created for `/dev/pts/55'.
>> > At that moment, expect is getting gdb's output, and unable to get 
>> > output from another pty in the same process.  That is the limitation
>> > of expect, if I read "Exploring  Exect" book correctly> .  
> How does work when native testing then?  Do you have a url
> where I can read about that?
> 

It is a hard copy, and I don't have a url of that book.  In Expect, when
a process is spawned, Expect allocates the pty and arranges for the
process to use the pty.  For each process (spawn_id), there is one pty.
 Expect is able to switch among multiple spawn_ids (processes), and
'send to' and 'expect from' them.

In native testing, there are two processes, gdb and inferior, and each
of them get a different pty.  Expect can use 'expect -i' to switch
between them, so everything works well.  In remote testing, there is
only one process, gdb, and we'll force gdb to use two pty'es, one for
gdb's output and the other for gdb_stdtarg/gdb_stdtargerr.  Expect is
unable to read anything from the second pty, so we get a timeout fail.

>> > If my
>> > understand is correct here, the problem #2 in my first post is unable
>> > to fix.  So I change test case mi-console.exp to match @-prefixed output 
>> > from gdb in remote testing.
> Quite frankly, this sounds like papering over a bug due to a testing
> limitation.  A separate tty was requested, and we'd just ignore
> that, hiding the issue, and not testing what was intented.  Better
> would be to kfail the test, IMO.
> 

Yeah, I agree this fail is caused by Expect's limitation on handling
multiple pty'es in a single process, if I understand expect correctly.

>>>> > >> I suggest that we check the inferior's
>>>> > >> output if gdb,noinferiorio is false and is not a remote target.
>>> > > 
>>> > > A quick grep tells me this is probably happening on the sims too.
>>> > > 
>> > 
>> > I don't understand your bit here, could you elaborate a little please?
> I just meant that this is probably happening with "target sim" too,
> or everything non-native.

I see.  If we agree on my words above, I'll create a patch to KFAIL it
when it is a remote target or sim target.

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]