From patchwork Sun May 26 08:54:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 246373 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id CEFF52C0092 for ; Sun, 26 May 2013 18:55:57 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=tlQCwmUDNkcGWfBG 77sXj4JmnTLBiLlE2LEWdjuv1osVrS4KopXta2n6yh20wCDwTI8WtmzsbE8p/6ns 0ore2wXSs3Fs1Yk0e/Kjk8avixppEm3F/jjfgEjE/wrlAmDvtPsmz6uA2LJySgFR qFWPDPBYh5gWIkfppefBdbPo20c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=Jk3r00UPovgS4cTIJMjktd zwWx4=; b=OIvvlmlm1YapWsTU0W5YuuOFJiHfRYziQU+mmn+4eBJML845xt4Yuw ee/DoedaJtFZUpNLvAgNEl53GxADGrvY2iijuKmSH5EfimOTLWKMY0UKjCWmTazb a3azmjtL9SSMSX7hh9EKPMkZhZRzuTxJebB/XWUs0FOnugbaZT/S0= Received: (qmail 11323 invoked by alias); 26 May 2013 08:55:51 -0000 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 Received: (qmail 11313 invoked by uid 89); 26 May 2013 08:55:50 -0000 X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.1 Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 26 May 2013 08:55:50 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 1AA862647C8F for ; Sun, 26 May 2013 10:54:22 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cilhdXe3ZDG4 for ; Sun, 26 May 2013 10:54:22 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id E692F2647C14 for ; Sun, 26 May 2013 10:54:21 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix awkward stepping over CW var assignment in GDB Date: Sun, 26 May 2013 10:54:20 +0200 Message-ID: <136960562.lSWuMbc9x5@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.19-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 X-Virus-Found: No On specific platforms, stepping over an assignment to a class-wide variable in GDB leads to an awkward behavior. Fixed thusly. Tested on x86_64-suse-linux, applied on the mainline. 2013-05-26 Eric Botcazou * gcc-interface/gigi.h (make_aligning_type): Adjust prototype. * gcc-interface/utils.c (make_aligning_type): Take GNAT_NODE parameter for the position of the associated TYPE_DECL. * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to above. * gcc-interface/utils2.c (maybe_wrap_malloc): Likewise. Index: gcc-interface/utils.c =================================================================== --- gcc-interface/utils.c (revision 199330) +++ gcc-interface/utils.c (working copy) @@ -653,11 +653,12 @@ gnat_pushdecl (tree decl, Node_Id gnat_n /* Create a record type that contains a SIZE bytes long field of TYPE with a starting bit position so that it is aligned to ALIGN bits, and leaving at least ROOM bytes free before the field. BASE_ALIGN is the alignment the - record is guaranteed to get. */ + record is guaranteed to get. GNAT_NODE is used for the position of the + associated TYPE_DECL. */ tree make_aligning_type (tree type, unsigned int align, tree size, - unsigned int base_align, int room) + unsigned int base_align, int room, Node_Id gnat_node) { /* We will be crafting a record type with one field at a position set to be the next multiple of ALIGN past record'address + room bytes. We use a @@ -739,7 +740,7 @@ make_aligning_type (tree type, unsigned /* Declare it now since it will never be declared otherwise. This is necessary to ensure that its subtrees are properly marked. */ - create_type_decl (name, record_type, NULL, true, false, Empty); + create_type_decl (name, record_type, NULL, true, false, gnat_node); return record_type; } Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 199336) +++ gcc-interface/decl.c (working copy) @@ -1368,7 +1368,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit tree gnu_new_type = make_aligning_type (gnu_type, TYPE_ALIGN (gnu_type), TYPE_SIZE_UNIT (gnu_type), - BIGGEST_ALIGNMENT, 0); + BIGGEST_ALIGNMENT, 0, gnat_entity); tree gnu_new_var = create_var_decl (create_concat_name (gnat_entity, "ALIGN"), NULL_TREE, gnu_new_type, NULL_TREE, false, Index: gcc-interface/utils2.c =================================================================== --- gcc-interface/utils2.c (revision 199330) +++ gcc-interface/utils2.c (working copy) @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2012, Free Software Foundation, Inc. * + * Copyright (C) 1992-2013, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -2101,7 +2101,8 @@ maybe_wrap_malloc (tree data_size, tree = ((data_align > system_allocator_alignment) ? make_aligning_type (data_type, data_align, data_size, system_allocator_alignment, - POINTER_SIZE / BITS_PER_UNIT) + POINTER_SIZE / BITS_PER_UNIT, + gnat_node) : NULL_TREE); tree size_to_malloc Index: gcc-interface/gigi.h =================================================================== --- gcc-interface/gigi.h (revision 199330) +++ gcc-interface/gigi.h (working copy) @@ -123,9 +123,10 @@ extern bool is_cplusplus_method (Entity_ /* Create a record type that contains a SIZE bytes long field of TYPE with a starting bit position so that it is aligned to ALIGN bits, and leaving at least ROOM bytes free before the field. BASE_ALIGN is the alignment the - record is guaranteed to get. */ + record is guaranteed to get. GNAT_NODE is used for the position of the + associated TYPE_DECL. */ extern tree make_aligning_type (tree type, unsigned int align, tree size, - unsigned int base_align, int room); + unsigned int base_align, int room, Node_Id); /* TYPE is a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE that is being used as the field type of a packed record if IN_RECORD is true, or as the