From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84145 invoked by alias); 12 Jun 2017 14:34:57 -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 83104 invoked by uid 89); 12 Jun 2017 14:34:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KHOP_DYNAMIC,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy= 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; Mon, 12 Jun 2017 14:34:56 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v5CEYlti142751 for ; Mon, 12 Jun 2017 10:34:59 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2b1qf9yba6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 12 Jun 2017 10:34:58 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Jun 2017 15:34:56 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Jun 2017 15:34:55 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v5CEYsFF10158540; Mon, 12 Jun 2017 14:34:54 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 997C511C04C; Mon, 12 Jun 2017 15:32:58 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79FE411C050; Mon, 12 Jun 2017 15:32:58 +0100 (BST) Received: from oc1027705133.ibm.com (unknown [9.152.212.151]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 12 Jun 2017 15:32:58 +0100 (BST) From: Andreas Arnez To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 19/19] read/write_pieced_value: Merge into one function References: <1494352015-10465-1-git-send-email-arnez@linux.vnet.ibm.com> <1494352015-10465-20-git-send-email-arnez@linux.vnet.ibm.com> <86vao18g1y.fsf@gmail.com> Date: Mon, 12 Jun 2017 14:34:00 -0000 In-Reply-To: <86vao18g1y.fsf@gmail.com> (Yao Qi's message of "Mon, 12 Jun 2017 14:57:13 +0100") 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: 17061214-0040-0000-0000-000003A7D9B4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17061214-0041-0000-0000-000025A079F4 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-12_10:,, 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-1706120254 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00315.txt.bz2 On Mon, Jun 12 2017, Yao Qi wrote: > Andreas Arnez writes: > >> + if (from == NULL) >> + { >> + /* Read mode. */ >> + read_value_memory (v, offset, >> + p->v.mem.in_stack_memory, >> + p->v.mem.addr + bits_to_skip / 8, >> + buffer.data (), this_size); >> + copy_bitwise (v_contents, offset, >> + buffer.data (), bits_to_skip % 8, >> + this_size_bits, bits_big_endian); >> + break; >> + } >> + >> + /* Write mode. */ > > I feel it is more clear to add "else" here, like > > if (from == NULL) > { > /* Read mode. */ > } > else > { > /* Write mode. */ > } > > then, we don't need the "break" above. Yeah, I agree. Will change. Thanks for reviewing so far! I think the only patch you haven't approved yet is patch #17 "Fix bit-/byte-offset mismatch in parameter to read_value_memory". Do you want to have a look at that as well? -- Andreas