From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8532 invoked by alias); 24 Jun 2013 17:25:42 -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 8520 invoked by uid 89); 24 Jun 2013 17:25:41 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 24 Jun 2013 17:25:41 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5OHPe6W020909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Jun 2013 13:25:40 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r5OHPcFq018321; Mon, 24 Jun 2013 13:25:39 -0400 Message-ID: <51C88112.7000406@redhat.com> Date: Mon, 24 Jun 2013 17:32:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH 13/16] move sizeof_pkt into remote_trace_find References: <1371835506-15691-1-git-send-email-tromey@redhat.com> <1371835506-15691-14-git-send-email-tromey@redhat.com> In-Reply-To: <1371835506-15691-14-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00661.txt.bz2 On 06/21/2013 06:25 PM, Tom Tromey wrote: > The global sizeof_pkt is only used in remote_trace_find, like so: > > reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt); > > I think in this situation it is more correct to use the recorded size > of the buffer. Otherwise it seems that some skew could result. Yeah. A leftover from making the tracepoint bits go through the target vector. A few of these globals, along with all the tracepoint RSP handling, used to live in tracepoint.c, got moved to remote.c, and then some of these redundant globals were never eliminated. > > * remote.c (sizeof_pkt): Remove. > (remote_trace_find): Use rs->buf, not sizeof_pkt. > --- > gdb/remote.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/gdb/remote.c b/gdb/remote.c > index 287b701..94aa5a8 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -496,8 +496,6 @@ struct remote_arch_state > long remote_packet_size; > }; > > -long sizeof_pkt = 2000; > - > /* Utility: generate error from an incoming stub packet. */ > static void > trace_error (char *buf) > @@ -10974,7 +10972,7 @@ remote_trace_find (enum trace_find_type type, int num, > } > > putpkt (rs->buf); > - reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt); > + reply = remote_get_noisy_reply (&(rs->buf), &rs->buf_size); > if (*reply == '\0') > error (_("Target does not support this command.")); > > -- Pedro Alves