From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12872 invoked by alias); 18 Feb 2013 10:39:26 -0000 Received: (qmail 12852 invoked by uid 22791); 18 Feb 2013 10:39:26 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Feb 2013 10:39:20 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1U7O7y-00077N-E3 from Yao_Qi@mentor.com ; Mon, 18 Feb 2013 02:39:18 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 18 Feb 2013 02:39:18 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Mon, 18 Feb 2013 02:39:19 -0800 Message-ID: <5122049C.3050800@codesourcery.com> Date: Mon, 18 Feb 2013 10:39:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Hui Zhu CC: Tom Tromey , Joel Brobecker , gdb-patches ml Subject: Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function References: <50F3ADB8.1000603@codesourcery.com> <50F55E11.40008@codesourcery.com> <50F67844.5040007@codesourcery.com> <87a9s6a4tu.fsf@fleche.redhat.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00447.txt.bz2 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. 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 (齐尧)