From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39213 invoked by alias); 31 May 2017 14:02:50 -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 39123 invoked by uid 89); 31 May 2017 14:02:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-languages-length:1127, transfer X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 May 2017 14:02:44 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4VDwjKV146473 for ; Wed, 31 May 2017 10:02:47 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2asp1prmxq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 31 May 2017 10:02:46 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 31 May 2017 15:02:45 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 31 May 2017 15:02:43 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4VE2hg815991152; Wed, 31 May 2017 14:02:43 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74627A4069; Wed, 31 May 2017 15:00:54 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5F1F4A4065; Wed, 31 May 2017 15:00:54 +0100 (BST) Received: from oc1027705133.ibm.com (unknown [9.152.212.151]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 31 May 2017 15:00:54 +0100 (BST) From: Andreas Arnez To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 17/19] Fix bit-/byte-offset mismatch in parameter to read_value_memory References: <1494352015-10465-1-git-send-email-arnez@linux.vnet.ibm.com> <1494352015-10465-18-git-send-email-arnez@linux.vnet.ibm.com> <3d3d77f7b369db28f50d388e54857a94@polymtl.ca> Date: Wed, 31 May 2017 14:02:00 -0000 In-Reply-To: <3d3d77f7b369db28f50d388e54857a94@polymtl.ca> (Simon Marchi's message of "Tue, 30 May 2017 21:59:07 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 17053114-0008-0000-0000-0000045AF843 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17053114-0009-0000-0000-00001DDEADB1 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705310256 X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00632.txt.bz2 On Tue, May 30 2017, Simon Marchi wrote: > On 2017-05-09 19:46, Andreas Arnez wrote: >> @@ -984,8 +984,9 @@ read_value_memory (struct value *val, LONGEST >> embedded_offset, >> if (status == TARGET_XFER_OK) >> /* nothing */; >> else if (status == TARGET_XFER_UNAVAILABLE) >> - mark_value_bytes_unavailable (val, embedded_offset + xfered_total, >> - xfered_partial); >> + mark_value_bits_unavailable (val, (xfered_total * HOST_CHAR_BIT >> + + bit_offset), >> + xfered_partial * HOST_CHAR_BIT); > > Since it's readily available, please use the unit_size variable here > instead of HOST_CHAR_BIT. Hm, I thought unit_size represents the number of *bytes* stored at the same target address. But we need an offset in *bits* here. Maybe you mean that xfered_total should have been multiplied by unit_size even before my patch? (Is it even correct that xfered_partial measures addressable target units? Note that to_xfer_partial is documented to "[...] transfer up to LEN 8-bit bytes of the target's OBJECT.") > > LGTM with that change. Thanks!