From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10351 invoked by alias); 23 Aug 2013 00:32:21 -0000 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 Received: (qmail 10341 invoked by uid 89); 23 Aug 2013 00:32:21 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.2 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 23 Aug 2013 00:32:20 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VCfIY-0004Wz-Jx from Yao_Qi@mentor.com ; Thu, 22 Aug 2013 17:32:18 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 Aug 2013 17:32:18 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Thu, 22 Aug 2013 17:32:17 -0700 Message-ID: <5216AD65.9010809@codesourcery.com> Date: Fri, 23 Aug 2013 00:32:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tom Tromey CC: Subject: Re: [RFC 2/2] Test entry values in trace frame References: <1376379586-24150-1-git-send-email-yao@codesourcery.com> <1376379586-24150-3-git-send-email-yao@codesourcery.com> <87siy4gsn4.fsf@fleche.redhat.com> <521458A8.7060304@codesourcery.com> In-Reply-To: <521458A8.7060304@codesourcery.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-08/txt/msg00656.txt.bz2 On 08/21/2013 02:05 PM, Yao Qi wrote: > I agree. I opened PR15871http://sourceware.org/bugzilla/show_bug.cgi?id=15871 > > On the other hand, I kfail the test. Pedro fixed this bug. I update the patch to get rid of the kfail. -- Yao (齐尧) gdb/testsuite: 2013-08-23 Yao Qi * gdb.trace/entry-values.c (end): New (main): Call end. * gdb.trace/entry-values.exp: Load trace-support.exp. Set tracepoint and collect data. Test entry value is unavailable. --- gdb/testsuite/gdb.trace/entry-values.c | 5 +++ gdb/testsuite/gdb.trace/entry-values.exp | 47 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 0 deletions(-) diff --git a/gdb/testsuite/gdb.trace/entry-values.c b/gdb/testsuite/gdb.trace/entry-values.c index 3f98615..e287203 100644 --- a/gdb/testsuite/gdb.trace/entry-values.c +++ b/gdb/testsuite/gdb.trace/entry-values.c @@ -32,6 +32,10 @@ bar (int i) int global1 = 1; int global2 = 2; +static void +end (void) +{} + int main (void) { @@ -41,5 +45,6 @@ main (void) global2++; ret = bar (0); + end (); return ret; } diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp index 0fb060a..bb62e5d 100644 --- a/gdb/testsuite/gdb.trace/entry-values.exp +++ b/gdb/testsuite/gdb.trace/entry-values.exp @@ -230,3 +230,50 @@ gdb_test_sequence "bt" "bt (2)" { "\[\r\n\]#1 .* bar \\(i=, i@entry=\\)" "\[\r\n\]#2 .* main \\(\\)" } + +# Restart GDB and trace. + +clean_restart $binfile + +load_lib "trace-support.exp" + +if ![runto_main] { + fail "Can't run to main to check for trace support" + return -1 +} + +if ![gdb_target_supports_trace] { + unsupported "target does not support trace" + return -1 +} + +gdb_test "trace foo" "Tracepoint $decimal at .*" + +if [is_amd64_regs_target] { + set spreg "\$rsp" +} elseif [is_x86_like_target] { + set spreg "\$esp" +} else { + set spreg "\$sp" +} + +# Collect arguments i and j. Collect 'global1' which is entry value +# of argument i. Don't collect 'global2' to test the entry value of +# argument j. + +gdb_trace_setactions "set action for tracepoint 1" "" \ + "collect i, j, global1, \(\*\(void \*\*\) \($spreg\)\) @ 64" "^$" + +gdb_test_no_output "tstart" + +gdb_breakpoint "end" +gdb_continue_to_breakpoint "end" + +gdb_test_no_output "tstop" + +gdb_test "tfind" "Found trace frame 0, .*" "tfind start" + +# Since 'global2' is not collected, j@entry is expected to be 'unavailable'. +gdb_test "bt 1" "#0 .* foo \\(i=\[-\]?$decimal, i@entry=2, j=\[-\]?$decimal, j@entry=\\).*" + +gdb_test "tfind" "Target failed to find requested trace frame\..*" -- 1.7.7.6