Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Yao Qi <yao@codesourcery.com>
Cc: Tom Tromey <tromey@redhat.com>,
	Joel Brobecker <brobecker@adacore.com>,
		gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function
Date: Tue, 19 Feb 2013 06:57:00 -0000	[thread overview]
Message-ID: <CANFwon23xCQiqXJqHtrVU+F_4ZPZQdpgnX1bxE4Mx34rJtstFA@mail.gmail.com> (raw)
In-Reply-To: <5122049C.3050800@codesourcery.com>

On Mon, Feb 18, 2013 at 6:38 PM, Yao Qi <yao@codesourcery.com> wrote:
> On 01/25/2013 07:09 PM, Hui Zhu wrote:
>>
>> +# Get the pathname of babeltrace and set it to $which_babeltrace.
>> +# If host doesn't have babeltrace, $which_babeltrace will set to 0.
>> +if [info exists BABELTRACE] {
>>
>> +    set which_babeltrace ${BABELTRACE}
>> +} else {
>> +    remote_exec host "which babeltrace" "" "/dev/null"
>> "babeltrace.which"
>>
>> +    remote_upload host "babeltrace.which"
>> +    set which_babeltrace [file_contents "babeltrace.which"]
>> +    remote_file build delete "babeltrace.which"
>> +    remote_file host delete "babeltrace.which"
>> +}
>> +
>> +# Use $which_babeltrace check $ctfdir.
>> +if { $which_babeltrace == "" } then {
>>
>> +    unsupported "babeltrace check ctf directory"
>> +} else {
>> +    # Let babeltrace output an error to make sure current way is right.
>>
>> +    remote_exec host "$which_babeltrace not_exist" "" "/dev/null"
>> "babeltrace.output"
>> +    remote_upload host "babeltrace.output"
>> +    set babeltrace_output [file_contents "babeltrace.output"]
>> +    remote_file build delete "babeltrace.output"
>> +    remote_file host delete "babeltrace.output"
>> +    if { [string last "\[error\]" $babeltrace_output] == -1 } then {
>> +       unsupported "cannot handle babeltrace output"
>> +    } else {
>> +       #Call $which_babeltrace check $ctfdir.
>>
>> +       remote_exec host "$which_babeltrace $ctfdir" "" "/dev/null"
>> "babeltrace.output"
>> +       remote_upload host "babeltrace.output"
>> +       set babeltrace_output [file_contents "babeltrace.output"]
>> +       remote_file build delete "babeltrace.output"
>> +       remote_file host delete "babeltrace.output"
>> +       if { [string last "\[error\]" $babeltrace_output] != -1 } then {
>> +           fail "babeltrace open ctf directory"
>> +       }
>> +    }
>> +}
>
>
> Unless I misunderstand it, it is still incorrect.  IIUC, what you want to do
> here is to run "babeltrace" to check your trace data, you can simply do
>
>   remote_exec host "babeltrace $ctfdir < /dev/null" "" "/dev/null"
> "output"
>
> You can tell from the return value and "output" about
>  1) whether babeltrace is installed on host machine,
>  2) whether babeltrace is executed successfully.

If I think is right, this idea base on "babeltrace" will not change
its error output.  But if they change the error output in some feature
version.  And maybe in different environment, this test will face with
different version of "babeltrace".
So what I want in this test call "babeltrace" is:
1. Make sure the system have the "babeltrace".  It is not because call
this command got error.  Just because the system really don't have it.
2. Make sure the current way in test is the right way to check the
output of babeltrace.
3. Use this way to check the output the babeltrace.

Are you sure a "remote_exec" is OK for this part?  Or maybe I think
too much in this part?  :)

Thanks,
Hui

>
> DejaGNU is smart enough to know what is the host machine, and execute this
> command there, which is determined by the board file.  If you are testing a
> native gdb, the command will be run in local machine, if you are testing GDB
> in a remote host way (test a native mingw32 native gdb on linux machine),
> this command will be executed on the remote host (a windows machine).
>
> --
> Yao (齐尧)


  reply	other threads:[~2013-02-19  6:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14  3:49 Hui Zhu
2013-01-14 12:44 ` Yao Qi
2013-01-15 11:19   ` Hui Zhu
2013-01-15 13:49     ` Yao Qi
2013-01-16  7:39       ` Hui Zhu
2013-01-16  9:52         ` Yao Qi
2013-01-18  1:23           ` Hui Zhu
2013-01-18  2:07             ` Yao Qi
2013-01-18 15:28             ` Tom Tromey
2013-01-25 11:10               ` Hui Zhu
2013-02-11 12:55                 ` Hui Zhu
2013-02-18 10:39                 ` Yao Qi
2013-02-19  6:57                   ` Hui Zhu [this message]
2013-01-14 13:30 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANFwon23xCQiqXJqHtrVU+F_4ZPZQdpgnX1bxE4Mx34rJtstFA@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox