From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7628 invoked by alias); 7 Jan 2014 17:21:27 -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 7614 invoked by uid 89); 7 Jan 2014 17:21:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_JMF_BL autolearn=no version=3.3.2 X-HELO: homiemail-a50.g.dreamhost.com Received: from caibbdcaabid.dreamhost.com (HELO homiemail-a50.g.dreamhost.com) (208.113.200.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jan 2014 17:21:23 +0000 Received: from homiemail-a50.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a50.g.dreamhost.com (Postfix) with ESMTP id 7840FE205 for ; Tue, 7 Jan 2014 09:21:21 -0800 (PST) Received: from redwood.eagercon.com (c-50-148-128-197.hsd1.ca.comcast.net [50.148.128.197]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eager@eagerm.com) by homiemail-a50.g.dreamhost.com (Postfix) with ESMTPSA id 5AF76E204 for ; Tue, 7 Jan 2014 09:21:21 -0800 (PST) Message-ID: <52CC3790.4030702@eagerm.com> Date: Tue, 07 Jan 2014 17:21:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [PATCH] Fix check for ICC incomplete struct types Content-Type: multipart/mixed; boundary="------------080404080901080002010908" X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00146.txt.bz2 This is a multi-part message in MIME format. --------------080404080901080002010908 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 504 GDB contains code in read_structure_type() which is supposed to check for incorrect DWARF generated by ICC for an incomplete structure type. The code is incomplete, in that it doesn't check for length == 0, and it doesn't set the STUB flag. This patch adds the test and sets the flag. gdb: 2014-01-07 Michael Eager * dwarf2read.c (read_structure_type): Set stub if ICC & length == 0. -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077 --------------080404080901080002010908 Content-Type: text/x-patch; name="icc_stub.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="icc_stub.patch" Content-length: 930 >From 38d324503619d60646d8a5194f80b71b91bcb713 Mon Sep 17 00:00:00 2001 From: Michael Eager Date: Tue, 7 Jan 2014 09:15:48 -0800 Subject: [PATCH] 2014-01-07 Michael Eager * dwarf2read.c (read_structure_type): Set stub if ICC & length == 0. --- gdb/dwarf2read.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 23bcfe0..cbec171 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -12830,10 +12830,11 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) TYPE_LENGTH (type) = 0; } - if (producer_is_icc (cu)) + if (producer_is_icc (cu) && (TYPE_LENGTH (type) == 0)) { /* ICC does not output the required DW_AT_declaration on incomplete types, but gives them a size of zero. */ + TYPE_STUB (type) = 1; } else TYPE_STUB_SUPPORTED (type) = 1; -- 1.8.1.4 --------------080404080901080002010908--