From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10238 invoked by alias); 14 Jan 2013 12:44:38 -0000 Received: (qmail 10228 invoked by uid 22791); 14 Jan 2013 12:44:37 -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, 14 Jan 2013 12:44:30 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Tue5Z-0006jk-SO from Yao_Qi@mentor.com ; Sun, 13 Jan 2013 23:04:09 -0800 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 13 Jan 2013 23:04:09 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Sun, 13 Jan 2013 23:04:08 -0800 Message-ID: <50F3ADB8.1000603@codesourcery.com> Date: Mon, 14 Jan 2013 12:44: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: gdb-patches ml , Tom Tromey Subject: Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function References: 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-01/txt/msg00270.txt.bz2 On 01/14/2013 11:48 AM, Hui Zhu wrote: > --- a/testsuite/gdb.trace/Makefile.in > +++ b/testsuite/gdb.trace/Makefile.in > @@ -5,7 +5,7 @@ srcdir = @srcdir@ > > PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \ > passc-dyn passcount report save-trace tfile tfind tracecmd tsv \ > - unavailable while-dyn while-stepping > + unavailable while-dyn while-stepping ctf Looks we should keep the alphabetic order of this list. > --- /dev/null > +++ b/testsuite/gdb.trace/ctf.exp > + > +#Test "tsave -ctf" > + > +gdb_test "trace 24" "Tracepoint \[0-9\]+ at .*" We can use 'gdb_get_line_number' instead of hard-code the line number. > +gdb_trace_setactions "set action for line 24" "" \ > + "collect \$local" "^$" > +gdb_test "trace 25" "Tracepoint \[0-9\]+ at .*" Likewise. > +gdb_trace_setactions "set action for line 25" "" \ > + "collect \$reg" "^$" > + > +gdb_test_no_output "tstart" > + > +gdb_test "break end" "Breakpoint ${decimal} at .*" > +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" > +gdb_test_no_output "tstop" > + > +gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory \'$ctfdir\'." > + What if GDB is built without ctf support? > +set ret [exec whereis babeltrace] We should use 'remote_exec host' instead of 'exec' and I am not sure it is portable to check 'babeltrace' exist by 'whereis'. > +if { [string compare "babeltrace:" $ret] == 0 } then { > + unsupported "babeltrace check ctf directory" > +} else { > + set ret [catch {exec babeltrace $ctfdir} results] remote_exec host 'babeltrace $ctfdir' > + if { $ret != 0 } then { > + fail "babeltrace open ctf directory" > + return -1 > + } > +} > + > + > +#Test "target ctf" > + > +gdb_test_no_output "set confirm off" > +gdb_test_no_output "target ctf $ctfdir" > + > +gdb_test "tfind 0" ".*Found trace frame 0.*" > +gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*" > +gdb_test "print \$b" ".* = 1.*" > +gdb_test "print \$a" ".* = 0.*" > +gdb_test "print \$i" ".* = 0.*" > + > +gdb_test "tfind 1" ".*Found trace frame 1.*" > + > +gdb_test "tfind 2" ".*Found trace frame 2.*" > +gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*" > +gdb_test "print \$b" ".* = 2.*" > +gdb_test "print \$a" ".* = 1.*" > +gdb_test "print \$i" ".* = 1.*" > + I don't run it but there must be some duplicated test results in gdb.sum, such as "tdump", "print $a", and etc. It is better to run 'tfind' until there is no trace frame in the trace file, to make sure no unexpected trace frame is generated. > + > +#Clean > + > +exec rm -rf $ctfdir remote_exec host "rm -rf $ctfdir" -- Yao (齐尧)