From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7630 invoked by alias); 29 Mar 2012 14:02:06 -0000 Received: (qmail 7609 invoked by uid 22791); 29 Mar 2012 14:02:03 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 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; Thu, 29 Mar 2012 14:01:50 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SDFvA-0001pi-UZ from Hui_Zhu@mentor.com ; Thu, 29 Mar 2012 07:01:48 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 29 Mar 2012 07:01:48 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Thu, 29 Mar 2012 07:01:17 -0700 Message-ID: <4F746B2A.6000302@mentor.com> Date: Thu, 29 Mar 2012 14:02:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH] testsuite tfind.exp: If current target don't support trace, try gdbserver. References: <4F7428BD.30408@mentor.com> <4F742A2A.9060500@redhat.com> <4F742B75.3000408@mentor.com> <4F742F7D.1070602@redhat.com> In-Reply-To: <4F742F7D.1070602@redhat.com> Content-Type: multipart/mixed; boundary="------------060706070501000508090305" 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: 2012-03/txt/msg00990.txt.bz2 --------------060706070501000508090305 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1652 Hi Pedro, On 03/29/12 17:46, Pedro Alves wrote: > On 03/29/2012 10:29 AM, Hui Zhu wrote: > >> On 03/29/12 17:23, Pedro Alves wrote: >>> On 03/29/2012 10:17 AM, Hui Zhu wrote: >>> >>>> Hi, >>>> >>>> When we want to test the trace function that in gdb.trace directory, we will got a lot of UNSUPPORTED. To use this testcase, we need follow way in http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_configuration. >>>> >>>> So I post a patch add some code if current target don't support trace, try gdbserver in tfind.exp. >>>> If this patch goes OK. I will post patch for other testsuite that support by gdbserver. >>> >>> >>> NAK. If the current target doesn't support tracing, the right thing to >>> do is to skip the test, as we do currently. >>> >> >> That is because it didn't use target remote, most trace function is together with target remote, right? > > > There are of course remote targets that also don't support tracing. Not all GDBserver > ports support tracing, or we could even be testing against a server other than GDBserver > (qemu, for example). Technically, native targets could also support tracing. See e.g., Yao's > push towards using an IPA with the native target. > I agree with you. It really affect current test. So I add a var TRACE_TRY_GDBSERVER in this check, then the test will try gdbserver only when set TRACE_TRY_GDBSERVER. Then for the people that don't care about try gdbserver when test tracepoint, he can set TRACE_TRY_GDBSERVER with himself. Thanks, Hui 2012-03-29 Hui Zhu * gdb.trace/tfind.exp: If current target don't support trace, try gdbserver. --------------060706070501000508090305 Content-Type: text/plain; charset="us-ascii"; name="testsuite_trace_use_gdbserver.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="testsuite_trace_use_gdbserver.txt" Content-length: 1037 --- testsuite/gdb.trace/tfind.exp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) --- a/testsuite/gdb.trace/tfind.exp +++ b/testsuite/gdb.trace/tfind.exp @@ -36,10 +36,32 @@ gdb_test "tfind none" ".*" "" runto_main gdb_reinitialize_dir $srcdir/$subdir -if { ![gdb_target_supports_trace] } then { - unsupported "Current target does not support trace" - return 1; +if ![gdb_target_supports_trace] { + global TRACE_TRY_GDBSERVER + + if ![info exists TRACE_TRY_GDBSERVER] { + unsupported "target does not support trace" + return -1; + } + + load_lib gdbserver-support.exp + + clean_restart $testfile + if { [skip_gdbserver_tests] } { + unsupported "target does not support trace" + return -1; + } + + gdb_test "disconnect" ".*" + + gdbserver_run "" + gdb_reinitialize_dir $srcdir/$subdir + + if ![gdb_target_supports_trace] { + unsupported "target does not support trace" + return -1; + } } # If testing on a remote host, download the source file. --------------060706070501000508090305--