From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23730 invoked by alias); 31 Jan 2012 13:06:58 -0000 Received: (qmail 23711 invoked by uid 22791); 31 Jan 2012 13:06:57 -0000 X-SWARE-Spam-Status: No, hits=-1.4 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; Tue, 31 Jan 2012 13:06:44 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1RsDQ3-0003o0-Gr from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 31 Jan 2012 05:06:43 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 31 Jan 2012 05:06:38 -0800 Received: from [127.0.0.1] (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; Tue, 31 Jan 2012 05:06:37 -0800 Message-ID: <4F27E75D.9080303@codesourcery.com> Date: Tue, 31 Jan 2012 16:49:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Hui Zhu CC: Subject: Re: [PATCH] Fix error when gdb connect to a stub that tracepoint is running[1/2] reset current_trace_status in the begin of remote_start_remote References: <4F274C42.7010008@mentor.com> <4F27A4AD.9020608@codesourcery.com> <4F27CFCA.9050203@mentor.com> In-Reply-To: <4F27CFCA.9050203@mentor.com> Content-Type: text/plain; charset="UTF-8" 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: 2012-01/txt/msg01013.txt.bz2 On 01/31/2012 07:26 PM, Hui Zhu wrote: > I have 2 ideas with your mail: > 1. If we want move merge_uploaded_tracepoints (&uploaded_tps); to the > begin, I think all the code about tracepoint should move to the begin of > this function. > > /* Possibly the target has been engaged in a trace run started > previously; find out where things are at. */ > if (remote_get_trace_status (current_trace_status ()) != -1) > { > struct uploaded_tp *uploaded_tps = NULL; > struct uploaded_tsv *uploaded_tsvs = NULL; > > if (current_trace_status ()->running) > printf_filtered (_("Trace is already running on the target.\n")); > > /* Get trace state variables first, they may be checked when > parsing uploaded commands. */ > > remote_upload_trace_state_variables (&uploaded_tsvs); > > merge_uploaded_trace_state_variables (&uploaded_tsvs); > > remote_upload_tracepoints (&uploaded_tps); > > merge_uploaded_tracepoints (&uploaded_tps); > } > Yes, that is what I did in my patch. They should be moved as a whole. > 2. But I think move the code before start_remote is not very well. > Because the code before tracepoint code do a lot of init work, maybe > move it will bring more issues to current code. Changing the order of code in a large function (remote_start_remote) makes me feel a little uncomfortable. I'll think of it carefully. -- Yao (齐尧)