From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123486 invoked by alias); 15 Nov 2018 00:16:05 -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 123268 invoked by uid 89); 15 Nov 2018 00:15:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2278, H*UA:6.1, H*u:6.1 X-HELO: userp2130.oracle.com Received: from userp2130.oracle.com (HELO userp2130.oracle.com) (156.151.31.86) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Nov 2018 00:15:43 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAF04BPk108893; Thu, 15 Nov 2018 00:15:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=RDXuLmH8XIEFZq5/2Ahp/W6JOQUh6QIxpeh3haKPNLE=; b=MnXNMIwA3BcBBu5kw+pzAg95ehlWV3oY9rb+2zNj7IN+Drr8X3Vw9xK2p+P5v8CS1HoQ e49IdEPgMavTULbuVMNQMVvSqGf+ZziUgJjMDl6mqOZyKJRkS5P0bgwsAufKRECFyarM fyHpgiPq7ObYl6gnbA5mksQAreqHL38zS8+x6x1b5upBd1K1o+iK4eMMVOts6NyW+c9/ awiTAAdhA7dkOZRYl8KHqOcfGZNaHDsie0XrUO1t05dhVZ7NHCRdZcB/gP91qYHbNz4S 8VW9DRjNTU4rvYr1EbOHivkm5P/8IqnVz5iUYHOBrV783Bwe3YlrS0+t3gh6Li2BNvrk hg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2nr7cs6phq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Nov 2018 00:15:38 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAF0FasO009832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Nov 2018 00:15:37 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wAF0FaDZ024906; Thu, 15 Nov 2018 00:15:36 GMT Received: from [10.159.145.149] (/10.159.145.149) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Nov 2018 16:15:36 -0800 Subject: Re: [PATCH PR gdb/20057] Internal error on trying to set {char[]}$pc="string" To: Joel Brobecker Cc: gdb-patches@sourceware.org References: <1516844738-79996-1-git-send-email-weimin.pan@oracle.com> <20180125041431.tghhxefsgxnxh3l3@adacore.com> <1dfc87b0-353d-3388-a427-fee247dc79a5@oracle.com> <20180131074526.rqbsjxyxp3p26js5@adacore.com> <1d28e9c6-6377-0c46-6bce-1dc25a7fa2d5@oracle.com> <20180201075955.mnqxzmw4ktuy3f5d@adacore.com> <20181114235153.GB4336@adacore.com> From: Wei-min Pan Message-ID: Date: Thu, 15 Nov 2018 00:16:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181114235153.GB4336@adacore.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2018-11/txt/msg00237.txt.bz2 On 11/14/2018 3:51 PM, Joel Brobecker wrote: >>>>> Unfortunately, I only have vague answers for you. I know it's not >>>>> as satisfactory as a firm one, but I haven't had time to investigate >>>>> further. >>>>> >>>>> My feeling is that it's (intuitively) a bad idea to start mixing >>>>> and matching the ownership type for a give type chain. It just >>>>> muddies the waters, and makes memory management more complex. >>>> Given there are functions such as arch_integer_type(), >>>> arch_character_type(), >>>> and arch_float_type() that can be used to add types to an arch, it doesn't >>>> seem terribly wrong to add a type which is not associated with any objfile >>>> to gdbarch? Also a type can actually exist in both an arch and an objfile. >>> I am not sure we understand each other. For me, what seems wrong >>> is the fact that we have an array type where part of the type is >>> objfile-owned, and part of it arch-owned. >>> >>> Creating arch-owned type is fine, as long as the entire type is >>> arch-owned. >> Sorry, I just don't see how it's possible to have an array type where >> part of the type is objfile-owned and part of it arch-owned. When an >> array type is copied, the space allocation depends on whether or not >> the element type is defined in the program. If it is defined, space >> for the index type, range type, and array type itself are all >> allocated from that object file. Otherwise, they are all allocated >> from the arch. > I am not sure I understand what you are saying. On my end, I am > precisely saying that we should not create a type where we have > a mix and match. And if I read this last message correctly, you > are saying you don't see how it's possible to be doing that. So, > on the surface, your last message seems to be in agreement with > the property I am saying we should preserve. But aren't you reporting > a situation where we are actually trying to create a type with > inconsistent ownership? Otherwise, I don't see why we would have > triggered the assertion failure you reported. > Problem is copy_type will assert on to-be-copied type which does not have an associated objfile. It doesn't matter if the type is entirely arch-owned.