Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function

Yao Qi
2013-01-18T02:07:31Z

On 01/18/2013 09:22 AM, Hui Zhu wrote:
>> What is the error? 'remote_exec host' has been used in some places in gdb
>> >testsuite so it should work well. The one-line statement below works with
>> >combinations of {remote-host, local-host} x {babeltrace installed,
>> >babeltrace not installed}
> ERROR: tcl error sourcing ../../../gdb/gdb/testsuite/gdb.trace/ctf.exp.
> ERROR: bad spawn_id (process died earlier?)
>
> This is what I got.

Looks Tom encountered this error before and it was discussed here
<http://sourceware.org/ml/gdb-patches/2012-11/msg00310.html>

I think you get an error in this line
remote_exec host "babeltrace $ctfdir < /dev/null" "" "" "output"

as mentioned in the link above, this line should work,

remote_exec host "babeltrace $ctfdir < /dev/null" "" "/dev/null"
"output"

or

remote_exec host "babeltrace $ctfdir" "" "/dev/null" "output"

This approach is used in proc run in
gdb/testsuite/gdb.base/gnu-debugdata.exp.

>
>> >
>> > set ctfdir "foo"
>> > set status [remote_exec host "babeltrace $ctfdir < /dev/null"]
>> > verbose -log "status\[0\] ([lindex $status 0])"
>> > verbose -log "status\[1\] ([lindex $status 1])"
>> >
>> >1) babeltrace installed (local-host and remote-host). We'll get,
>> >status[0] (1)
>> >status[1] ([error] opening trace "foo" for reading.
>> >
>> >2) babeltrace not installed, local-host. We'll get,
>> >status[0] (-1)
>> >status[1] (spawn failed)
>> >
>> >3) babeltrace not installed, remote-host. We'll get,
>> >status[0] (1)
>> >status[1] (sh: babeltrace: command not found)
>> >
>> >We can match 'status[1]' to know the different results of executing
>> >'babeltrace' on host.
>> >
>> >P.S. I am not good at tcl/expect, so I may miss something.
> Thanks. I am very clear about this way. Do you mind I keep current
> way that I just used?
>

If the existing method to fix 'remote_exec host' errors (mentioned
above) still doesn't work, I don't mind using your approach, although I
didn't read it carefully. Or we can skip it in remote host? I have no
comments on this patch.

I am not the maintainer to approve or reject the patches, and all my
comments are optional. Please feel free to "cherry-pick" useful ones.

--
Yao (é½å°§)