From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [patch] [3/5] Types reference counting [make_function_type-objfile]
Date: Fri, 26 Jun 2009 16:40:00 -0000 [thread overview]
Message-ID: <20090626163927.GA14063@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <200906261323.n5QDN0Xi000973@d12av02.megacenter.de.ibm.com>
On Fri, 26 Jun 2009 15:23:00 +0200, Ulrich Weigand wrote:
> - I think the symbol readers should always return per-objfile types. This
> just makes everything simpler, in particular allocation of derived types
> (as you notice). I think it would also good to be able to guarantee that
> TYPE_OBJFILE of every symbol type is non-NULL ...
This IMO means "any two types somehow interconnected (by TYPE_TARGET_TYPE,
TYPE_INDEX_TYPE etc.) should have the same TYPE_OBJFILE".
> - The Java generated types should *not* go onto the "fake" dynamics objfile
> in the first place. That objfile is somewhat bogus in that it isn't
> associated with an architecture (thus breaking my per-type architecture
> effort), and it also don't help with type lifetime issues as the fake
> objfile never goes away. I think those types should be allocated with
> a NULL objfile (in the future are per-gdbarch types) instead.
I see now dynamics_objfile should be replaced by NULL TYPE_OBJFILE and being
a discardable type to be processed by the types garbage collector (which is
still not checked-in).
> Also, I think the implementation is broken in the "type smashing" case:
> if there is an incoming type allocated in objfile A, but the argument to
> make_function_type specifies objfile B,
I do not think it can happen. So far always type A referencing -> type
B either had the same TYPE_OBJFILE or TYPE_OBJFILE(B) was NULL. Using such
assertion-checks without facing problems.
As there cannot be a DWARF reference across objfiles (there can be one just
across CUs) cross-file type references use TYPE_IS_OPAQUE and they get
resolved each time on dereferencing such reference by calling check_typedef.
> Therefore, I'd prefer to fix the two problems mentioned above, and then
> revert your patch.
If the current rule:
# So far always type A referencing -> type B had either the same TYPE_OBJFILE
# or TYPE_OBJFILE(B) was NULL.
will be changed to:
# Type A referencing -> type B had the same TYPE_OBJFILE.
I only welcome it and sure I agree with reverting my patch afterwards.
Thanks,
Jan
next prev parent reply other threads:[~2009-06-26 16:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-11 10:22 Jan Kratochvil
2009-04-16 21:43 ` Tom Tromey
2009-05-01 14:44 ` Jan Kratochvil
2009-06-26 13:23 ` Ulrich Weigand
2009-06-26 13:26 ` [rfc] Always use per-objfile types in symbol readers Ulrich Weigand
2009-06-26 13:29 ` [rfc] Fix Java type allocation and revert make_function_type change Ulrich Weigand
2009-06-26 16:12 ` [patch] [3/5] Types reference counting [make_function_type-objfile] Tom Tromey
2009-06-26 17:06 ` Ulrich Weigand
2009-06-26 16:40 ` Jan Kratochvil [this message]
2009-06-26 17:12 ` Ulrich Weigand
2009-06-26 17:24 ` Tom Tromey
2009-06-26 17:36 ` Ulrich Weigand
2009-06-26 18:04 ` Tom Tromey
2009-06-29 13:25 ` Ulrich Weigand
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=20090626163927.GA14063@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
--cc=uweigand@de.ibm.com \
/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