From patchwork Fri Nov 11 19:37:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 17418 Received: (qmail 30800 invoked by alias); 11 Nov 2016 19:37:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 30783 invoked by uid 89); 11 Nov 2016 19:37:30 -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=Hx-languages-length:1483, 2.3.0, UD:dwarf2, gdb.dwarf2 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, 11 Nov 2016 19:37:29 +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 uABJXqnd014641 for ; Fri, 11 Nov 2016 14:37:28 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 26nju2pcaq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 11 Nov 2016 14:37:28 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Nov 2016 19:37:26 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 11 Nov 2016 19:37:24 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2656C17D805A for ; Fri, 11 Nov 2016 19:39:46 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uABJbN5B16581006 for ; Fri, 11 Nov 2016 19:37:23 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uABJbN8b015083 for ; Fri, 11 Nov 2016 14:37:23 -0500 Received: from oc1027705133.ibm.com (dyn-9-152-212-182.boeblingen.de.ibm.com [9.152.212.182]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uABJbHT4015011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 11 Nov 2016 14:37:23 -0500 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH] bitfield-parent-optimized-out: Fix struct definition Date: Fri, 11 Nov 2016 20:37:17 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111119-0028-0000-0000-00000249DE1E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111119-0029-0000-0000-0000212F390B Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-11_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611110346 X-IsSubscribed: yes The "struct S" type in bitfield-parent-optimized-out.exp is declared to have a size of 4 bytes but to hold two 4-byte members: an int-based bitfield and a 4-byte int. Also, both members have the same data_member_location 2, causing them to overlap and to reach 2 bytes beyond the structure's boundary. This is fixed by increasing the structure size to 8 and setting the first and second member's data_member_location to 0 and 4, respectively. gdb/testsuite/ChangeLog: * gdb.dwarf2/bitfield-parent-optimized-out.exp: Fix DWARF code for the definition of struct S. --- gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp index 27d8044..b789970 100644 --- a/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp +++ b/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp @@ -43,19 +43,18 @@ Dwarf::assemble $asm_file { struct_label: structure_type { {name S} - {byte_size 4 DW_FORM_sdata} + {byte_size 8 DW_FORM_sdata} } { member { {name bitfield} {type :$int_label} {bit_size 12 DW_FORM_sdata} {bit_offset 20 DW_FORM_sdata} - {data_member_location 2 DW_FORM_sdata} } member { {name intfield} {type :$int_label} - {data_member_location 2 DW_FORM_sdata} + {data_member_location 4 DW_FORM_sdata} } }