From: Wei-min Pan <weimin.pan@oracle.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH PR gdb/20057] Internal error on trying to set {char[]}$pc="string"
Date: Thu, 15 Nov 2018 00:16:00 -0000 [thread overview]
Message-ID: <ba98506a-766b-2353-7ff7-03a90746ecc3@oracle.com> (raw)
In-Reply-To: <20181114235153.GB4336@adacore.com>
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.
next prev parent reply other threads:[~2018-11-15 0:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 2:12 Weimin Pan
2018-01-25 4:14 ` Joel Brobecker
2018-01-25 22:24 ` Wei-min Pan
2018-01-31 7:45 ` Joel Brobecker
2018-02-01 1:46 ` Wei-min Pan
2018-02-01 8:00 ` Joel Brobecker
2018-02-02 1:14 ` Wei-min Pan
2018-11-14 23:38 ` Wei-min Pan
2018-11-14 23:51 ` Joel Brobecker
2018-11-15 0:16 ` Wei-min Pan [this message]
2018-11-29 19:18 ` Tom Tromey
2018-11-29 21:10 ` Wei-min Pan
2018-11-29 21:52 ` Tom Tromey
2018-11-29 23:26 ` Wei-min Pan
2018-11-30 15:37 ` Tom Tromey
2018-11-30 17:31 ` Wei-min Pan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba98506a-766b-2353-7ff7-03a90746ecc3@oracle.com \
--to=weimin.pan@oracle.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox