From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60486 invoked by alias); 10 Mar 2017 19:27:19 -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 60463 invoked by uid 89); 10 Mar 2017 19:27:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,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; Fri, 10 Mar 2017 19:27:16 +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 v2AJODfS139338 for ; Fri, 10 Mar 2017 14:27:15 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 293f4v77xw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 10 Mar 2017 14:27:15 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Mar 2017 19:27:13 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 10 Mar 2017 19:27:11 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2AJRBQe16056558; Fri, 10 Mar 2017 19:27:11 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B5E042049; Fri, 10 Mar 2017 19:26:58 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 550244203F; Fri, 10 Mar 2017 19:26:58 +0000 (GMT) Received: from oc1027705133.ibm.com (unknown [9.152.212.162]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 10 Mar 2017 19:26:58 +0000 (GMT) From: Andreas Arnez To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] PR gdb/21226: Take DWARF stack value pieces from LSB end References: <20170310175740.21D9CD806AB@oc3748833570.ibm.com> Date: Fri, 10 Mar 2017 19:27:00 -0000 In-Reply-To: <20170310175740.21D9CD806AB@oc3748833570.ibm.com> (Ulrich Weigand's message of "Fri, 10 Mar 2017 18:57:40 +0100 (CET)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 17031019-0012-0000-0000-000004E1614F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031019-0013-0000-0000-0000178FC6D7 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-10_12:,, 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-1702020001 definitions=main-1703100151 X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00148.txt.bz2 On Fri, Mar 10 2017, Ulrich Weigand wrote: > Andreas Arnez wrote: > > Sorry, I overlooked one other issue: > >> + /* Piece offset is from least significant bit end. */ >> + if (bits_big_endian) >> + source_offset_bits += obj_size - (p->offset + p->size); >> + else >> + source_offset_bits += p->offset; > > Should this really consult bits_big_endian, as opposed to the > regular byte order? Note that in the DWARF_VALUE_REGISTER case, > we have the same issue, and there the byte order is consulted. Using the byte order would strictly be more correct, yes. As opposed to register pieces, we would have to get it from a different gdbarch, though. I think the right one would be the objfile gdbarch of the underlying CU, right? > > (This doesn't make much of a difference today since in GDB > bit order is always the same a byte order, but we might as > well get it right ...) > > Also, is p->size the right value here? Note that the code before > the loop might already have partially reduced the size and updated > the this_size(_bits) variables. Again, I think this case basically > ought to work the same as the DWARF_VALUE_REGISTER case. (Hmmm. > On the other hand, maybe the DWARF_VALUE_REGISTER case is wrong. > Either way, it should be the same :-)) Yeah, p->size is correct, and the code for DWARF_VALUE_REGISTER is wrong. Again, I didn't want to mix fixes for other piece types into this patch. So I'll add another patch for that. -- Andreas