This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, Phil Muldoon <pmuldoon at redhat dot com>, Tom Tromey <tom at tromey dot com>, gdb at sourceware dot org
- Date: Fri, 24 Apr 2015 08:27:24 +0200
- Subject: Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types
- Authentication-results: sourceware.org; auth=none
- References: <20150410123145 dot GA18073 at host1 dot jankratochvil dot net> <20150414060905 dot GA22747 at host1 dot jankratochvil dot net> <20150417152213 dot GA2589 at host1 dot jankratochvil dot net> <20150418101953 dot GA12295 at host1 dot jankratochvil dot net> <55396CF6 dot 8020707 at redhat dot com>
On Fri, 24 Apr 2015 00:06:46 +0200, Jeff Law wrote:
> On 04/18/2015 04:19 AM, Jan Kratochvil wrote:
> > Instead of current:
> > plugin_build_record_type:
> > record_type = make_node (RECORD_TYPE)
> > plugin_build_add_field:
> > add fields to record_type... But there is no qualified_record_type here!
> > plugin_finish_record_or_union:
> > TYPE_SIZE (record_type) etc. ... to finish the type
> > plugin_build_qualified_type:
> > qualified_record_type = build_qualified_type (record_type, ...)
[...]
> I'm a bit surprised the former didn't work,
build_qualified_type() will make a copy of the type being created. While the
original type gets finished later (added more fields and its final TYPE_SIZE)
the copy remains unfinished forever and GCC later crashes trying to access the
unfinished copy.
> but if the latter is working consistently, then I'd stick with it.
Yes, it is solved now.
Jan