From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11014 invoked by alias); 10 Mar 2017 17:57:48 -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 10553 invoked by uid 89); 10 Mar 2017 17:57:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=consulted, H*x:version 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; Fri, 10 Mar 2017 17:57:46 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2AHiOZd071194 for ; Fri, 10 Mar 2017 12:57:45 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 293w6qb7qj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 10 Mar 2017 12:57:45 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Mar 2017 17:57:42 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 10 Mar 2017 17:57:41 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2AHvf5N21102694; Fri, 10 Mar 2017 17:57:41 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20419A4040; Fri, 10 Mar 2017 17:57:35 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0489BA4055; Fri, 10 Mar 2017 17:57:35 +0000 (GMT) Received: from oc3748833570.ibm.com (unknown [9.164.174.223]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 10 Mar 2017 17:57:34 +0000 (GMT) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 21D9CD806AB; Fri, 10 Mar 2017 18:57:40 +0100 (CET) Subject: Re: [PATCH] PR gdb/21226: Take DWARF stack value pieces from LSB end To: arnez@linux.vnet.ibm.com (Andreas Arnez) Date: Fri, 10 Mar 2017 17:57:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: from "Andreas Arnez" at Mar 08, 2017 07:26:26 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17031017-0008-0000-0000-000003FC66D4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031017-0009-0000-0000-00001CC5868D Message-Id: <20170310175740.21D9CD806AB@oc3748833570.ibm.com> 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-1703100140 X-SW-Source: 2017-03/txt/msg00141.txt.bz2 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. (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 :-)) Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com