From patchwork Thu Mar 16 10:44:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiong Wang X-Patchwork-Id: 19598 Received: (qmail 129609 invoked by alias); 16 Mar 2017 10:44:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 129595 invoked by uid 89); 16 Mar 2017 10:44:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=transfer X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 Mar 2017 10:44:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 07736687; Thu, 16 Mar 2017 03:44:36 -0700 (PDT) Received: from [10.2.206.198] (e104437-lin.cambridge.arm.com [10.2.206.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D5F13F220; Thu, 16 Mar 2017 03:44:35 -0700 (PDT) Subject: Re: [PATCH v2] inf-ptrace: Do not stop memory transfers after a single word To: Andreas Arnez , gdb-patches@sourceware.org References: Cc: Simon Marchi From: Jiong Wang Message-ID: Date: Thu, 16 Mar 2017 10:44:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: On 14/03/17 15:44, Andreas Arnez wrote: > + /* Restrict to a chunk that fits in the current word. */ > + chunk = std::min (sizeof (PTRACE_TYPE_RET) - skip, len - n); > On 14/03/17 15:44, Andreas Arnez wrote: > > + /* Restrict to a chunk that fits in the current word. */ > + chunk = std::min (sizeof (PTRACE_TYPE_RET) - skip, len - n); Hi Andres, I am seeing the following build failure on my local AArch32 native build: ...binutils-gdb/gdb/inf-ptrace.c:473:65: error: no matching function for call to 'min(unsigned int, ULONGEST)' There are a few ways to fix this, this patch simply change the type of "skip" from "unsigned int" to "ULONGEST" so operands for std::min can have the same type. OK for master? gdb/ 2017-03-16 Jiong Wang * inf-ptrace.c (inf_ptrace_peek_poke): Change the type to "ULONGEST" for "skip". diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 32794ec132f72c261debd329196c73a4e3cff75b..431a36b8c726f8475650de00bf895b8d5f48fa83 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -462,7 +462,7 @@ inf_ptrace_peek_poke (pid_t pid, gdb_byte *readbuf, /* We transfer aligned words. Thus align ADDR down to a word boundary and determine how many bytes to skip at the beginning. */ - unsigned int skip = addr & (sizeof (PTRACE_TYPE_RET) - 1); + ULONGEST skip = addr & (sizeof (PTRACE_TYPE_RET) - 1); addr -= skip; for (n = 0;