From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: FYI: use SYMBOL_SYMTAB accessor
Date: Mon, 26 Nov 2012 20:43:00 -0000 [thread overview]
Message-ID: <20121126204310.GD3089@adacore.com> (raw)
In-Reply-To: <87mwy4gqqs.fsf@fleche.redhat.com>
> I'm somewhat on the fence about this, but on balance I think it is a
> good idea to make types that are used in more than one file opaque.
>
> However, in practice this hasn't always helped much. The symbol
> accessors are the worst, as we've discussed before, because many of them
> are polymorphic without any purpose -- so they are both verbose and hard
> to change. In other cases in recent memory, I've wanted to change
> direct accessors to separate assignments from uses; and this requires
> global changes anyway, meaning that the macros didn't really help all
> that much.
Yeah - in retrospect, I think we should have required that for our
types. I like opaque types (for complex types), because it allows
us to control the contents of the data through a well defined API,
and then allows us to easily track its use. Our macros serve this
purpose to a degree, except that we do not automatically catch
mistakes where we access the field directly instead of through
the macros.
Anyway, I don't think it's really all that important for existing
code at the moment. But something perhaps to bear in mind if we
ever create new data structures - to ask ourselves whether the type
should be opaque or not. Or if we revamp our symbol/types data.
--
Joel
prev parent reply other threads:[~2012-11-26 20:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 15:54 Tom Tromey
2012-11-26 16:37 ` Joel Brobecker
2012-11-26 18:32 ` Tom Tromey
2012-11-26 20:43 ` Joel Brobecker [this message]
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=20121126204310.GD3089@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.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