From patchwork Mon Mar 19 16:29:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 147575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 24B5DB6EEC for ; Tue, 20 Mar 2012 03:30:08 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332779409; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=3AHCaGTRbv6q2cY8bmeG GZB/ASc=; b=QD2ioRRp0oHDZvDGqiERkmJKFyw5r52GRQkMiNEQ0KK4mo+dqK98 iIbwgdNGjO9P4Jmt4u5XjpbbTZrfyXqYlX1QbNlcQZ/6wcWJNf1nrW9GcARWOyfg Wy5ODwNPyI/Rl7/B2KvORpJi9XEJYOihgmmGssDPVUM0O97xevvSfU4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=g/k5wGwlFg8wYUhHlzTDF6wAPM8sjhibL0h5NLjBoIZ8MDTUkqa0YGTjNMuC/Q M+pcVaoxxXB+oqc9C0Mytti3xgvwJ6QrQrJtlQiAidn3XjaEz9fiXGwbg8Ah2I0R YxEXJxiDTYOpK/1s3f7XThzsCZ45+gylj+WDIZKGaOMUc=; Received: (qmail 24077 invoked by alias); 19 Mar 2012 16:30:00 -0000 Received: (qmail 24069 invoked by uid 22791); 19 Mar 2012 16:29:58 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Mar 2012 16:29:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9925F1C63C5; Mon, 19 Mar 2012 12:29:35 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pS54zgcsMS+8; Mon, 19 Mar 2012 12:29:35 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 72A811C639A; Mon, 19 Mar 2012 12:29:35 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 6C3683FEE8; Mon, 19 Mar 2012 12:29:35 -0400 (EDT) Date: Mon, 19 Mar 2012 12:29:35 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Gary Dismukes Subject: [Ada] Missing debug info for object of class-wide interface type Message-ID: <20120319162935.GA18016@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org For an object of a class-wide interface type, the object declaration is rewritten as a renaming with a new entity, and debug info was not being generated for the renaming, preventing printing of the object's value in gdb. The entity of the renaming is now marked as needing debug info. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-03-19 Gary Dismukes * exp_ch3.adb (Expand_N_Object_Declaration): In the case of an object of a class-wide interface type, where the declaration is rewritten as a renaming, call Set_Debug_Info_Needed on the renaming entity so that Materialize_Entity will be set. Also, change existing call (for other than interface cases) to call Set_Debug_Info_Needed rather than Set_Needs_Debug_Info (as specified for that flag). Index: exp_ch3.adb =================================================================== --- exp_ch3.adb (revision 185520) +++ exp_ch3.adb (working copy) @@ -4820,6 +4820,17 @@ Subtype_Mark => New_Occurrence_Of (Typ, Loc), Name => Convert_Tag_To_Interface (Typ, Tag_Comp))); + -- If the original entity comes from source, then mark the + -- new entity as needing debug information, even though it's + -- defined by a generated renaming that does not come from + -- source, so that Materialize_Entity will be set on the + -- entity when Debug_Renaming_Declaration is called during + -- analysis. + + if Comes_From_Source (Def_Id) then + Set_Debug_Info_Needed (Defining_Identifier (N)); + end if; + Analyze (N, Suppress => All_Checks); -- Replace internal identifier of rewritten node by the @@ -5065,7 +5076,7 @@ -- renaming that does not come from source. if Comes_From_Source (Defining_Identifier (N)) then - Set_Needs_Debug_Info (Defining_Identifier (N)); + Set_Debug_Info_Needed (Defining_Identifier (N)); end if; -- Now call the routine to generate debug info for the renaming