From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53061 invoked by alias); 2 Aug 2018 16:47:05 -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 52963 invoked by uid 89); 2 Aug 2018 16:47:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:889 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Aug 2018 16:46:59 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w72GdZR4006550 for ; Thu, 2 Aug 2018 12:46:58 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2km2yh8qxc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 02 Aug 2018 12:46:58 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Aug 2018 17:46:56 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 2 Aug 2018 17:46:53 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w72GkqfR39649436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 2 Aug 2018 16:46:52 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E47011C054; Thu, 2 Aug 2018 19:47:02 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B0C411C050; Thu, 2 Aug 2018 19:47:02 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.80]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 2 Aug 2018 19:47:02 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 16707D802AB; Thu, 2 Aug 2018 18:46:52 +0200 (CEST) Subject: Re: [PATCH v2 3/6] Use get_remote_packet_size in download_tracepoint To: pedromfc@linux.ibm.com (Pedro Franco de Carvalho) Date: Thu, 02 Aug 2018 16:47:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20180727210318.2960-4-pedromfc@linux.ibm.com> from "Pedro Franco de Carvalho" at Jul 27, 2018 06:03:15 PM MIME-Version: 1.0 x-cbid: 18080216-0020-0000-0000-000002B016A2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080216-0021-0000-0000-000020FC4501 Message-Id: <20180802164652.16707D802AB@oc3748833570.ibm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-SW-Source: 2018-08/txt/msg00037.txt.bz2 Pedro Franco de Carvalho wrote: > * remote.c (remote_target::download_tracepoint): Remove BUF_SIZE. > Replace array buf with gdb::char_vector buf, of size > get_remote_packet_size (). Replace references to buf and BUF_SIZE > to buf.data () and buf.size (). Replace strcpy, strcat and > pack_hex_byte with snprintf. Raise errors if the buffer is too > small. > if (target_static_tracepoint_marker_at (tpaddr, &marker)) > - strcat (buf, ":S"); > + { > + size_left = buf.size () - strlen (buf.data ()); > + ret = snprintf (buf.data () + strlen (buf.data ()), > + size_left, ":F%x", > + gdb_insn_length (loc->gdbarch, tpaddr)); This changes the message -- I guess that should remain :S? Otherwise this looks good to me. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com