From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11960 invoked by alias); 11 Apr 2013 10:48:12 -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 11950 invoked by uid 89); 11 Apr 2013 10:48:12 -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.1 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; Thu, 11 Apr 2013 10:48:11 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UQF34-0002YE-9s from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 11 Apr 2013 03:48:10 -0700 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); Thu, 11 Apr 2013 03:48:10 -0700 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; Thu, 11 Apr 2013 03:48:09 -0700 Message-ID: <516694E8.4040107@codesourcery.com> Date: Thu, 11 Apr 2013 22:58: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: Hui Zhu CC: gdb-patches ml Subject: Re: [PATCH] store trace default-collect to target [1/6] target, trace and remote References: <51665508.5050706@mentor.com> <5166554D.2070906@mentor.com> In-Reply-To: <5166554D.2070906@mentor.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-04/txt/msg00327.txt.bz2 On 04/11/2013 02:16 PM, Hui Zhu wrote: > --- a/remote.c > +++ b/remote.c > @@ -215,6 +215,8 @@ static int remote_get_trace_status (stru > static int remote_upload_tracepoints (struct uploaded_tp **utpp); > > static int remote_upload_trace_state_variables (struct uploaded_tsv **utsvp); > + > +static void remote_upload_trace_default_collest (char **collectp); ^^^^^^^ typo "collect" > > static void remote_query_supported (void); > > @@ -3567,6 +3569,7 @@ remote_start_remote (int from_tty, struc > { > struct uploaded_tp *uploaded_tps = NULL; > struct uploaded_tsv *uploaded_tsvs = NULL; > + char *uploaded_default_collest = NULL; ^^^^^^^ typo. > > if (current_trace_status ()->running) > printf_filtered (_("Trace is already running on the target.\n")); > @@ -3581,6 +3584,10 @@ remote_start_remote (int from_tty, struc > remote_upload_tracepoints (&uploaded_tps); > > merge_uploaded_tracepoints (&uploaded_tps); > + > + remote_upload_trace_default_collest (&uploaded_default_collest); > + > + trace_set_default_collect (uploaded_default_collest); Likewise. > } > > /* The thread and inferior lists are now synchronized with the > @@ -10567,6 +10574,23 @@ remote_download_tracepoint (struct bp_lo > do_cleanups (old_chain); > } > > +static void > +remote_download_tracepoint_default_collect (char *collect) Add a comment to this function. > > +static void > +remote_upload_trace_default_collest (char **collectp) Comments to this function are needed as well. > +/* Not overwrite default collect If COLLECT is NULL or its size is 0. */ > + > +void > +trace_set_default_collect (char *collect) > +{ > + if (collect != NULL && strlen (collect) != 0) > + { > + xfree (default_collect); > + default_collect = collect; > + } > +} It looks incorrect to me. When we change target to a tfile, in which the default-collect is "", the variable default_collect won't be updated. Supposing we have two tfile actions.tf and actions1.tf, the default-collect is "$regs" and "" respectively, (gdb) target tfile testsuite/gdb.trace/actions.tf (gdb) show default-collect The list of expressions to collect by default is "$regs". (gdb) target tfile testsuite/gdb.trace/actions1.tf (gdb) show default-collect The list of expressions to collect by default is "$regs". I don't have other comments. -- Yao (齐尧)