From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61661 invoked by alias); 21 Dec 2016 19:42:46 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 61619 invoked by uid 89); 21 Dec 2016 19:42:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=world, world!, structured, notion 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, 21 Dec 2016 19:42:33 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uBLJeGTl107171 for ; Wed, 21 Dec 2016 14:42:31 -0500 Received: from e06smtp06.uk.ibm.com (e06smtp06.uk.ibm.com [195.75.94.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 27fvgtb9fx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 21 Dec 2016 14:42:31 -0500 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Dec 2016 19:42:29 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp06.uk.ibm.com (192.168.101.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 21 Dec 2016 19:42:27 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 03B3B2190019; Wed, 21 Dec 2016 19:41:36 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uBLJgRFG7274808; Wed, 21 Dec 2016 19:42:27 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4ABEFA404D; Wed, 21 Dec 2016 18:40:31 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 249BDA4040; Wed, 21 Dec 2016 18:40:31 +0000 (GMT) Received: from oc1027705133.ibm.com (unknown [9.152.212.51]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 21 Dec 2016 18:40:31 +0000 (GMT) From: Andreas Arnez To: GDB Development Cc: Tom Tromey , Jan Kratochvil Subject: Should a DW_OP_implicit_value be taken from the left end? Date: Wed, 21 Dec 2016 19:42:00 -0000 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-Content-Scanned: Fidelis XPS MAILER x-cbid: 16122119-0024-0000-0000-00000278C6D2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16122119-0025-0000-0000-000021B6E045 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-21_14:,, 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-1612050000 definitions=main-1612210300 X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00030.txt.bz2 The following patch changed how sub-values of a DW_OP_implicit_value are extracted on big-endian platforms: https://sourceware.org/ml/gdb-patches/2011-08/msg00123.html The patch seems to assume that the placement rule is similar as for DW_OP_stack_value. I think that's wrong; DW_OP_implicit_value should always be taken from the left end. (See rationale below for an explanation.) And I'd like to know whether anyone objects. I'm in the process of preparing a patch series for fixing various problems with DWARF piece handling, and the series currently contains a patch for reverting the above patch's effect on DW_OP_implicit_value. Rationale: Since DW_OP_implicit_value can express arbitrary amounts of structured or unstructured data, the notion of a "least significant byte" is meaningless. The patch above makes it impossible for a DW_OP_implicit_pointer operation to refer to any sub-value within a DW_OP_implicit_value on big-endian targets. E.g., consider this code snippet: const char foo[] = "Hello, world!"; char *a = &foo[0]; char *b = &foo[7]; IMHO the compiler should be able to describe `foo' with a single DW_OP_implicit_value operation and `a' and `b' as DW_OP_implicit_pointer operations pointing into that value. Any objections? -- Andreas