public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: remove TYPE_FIELD macro
Date: Sat, 23 May 2020 17:22:23 -0400	[thread overview]
Message-ID: <ba9ad86e-97b3-d216-b13a-5696ac3bc5e5@efficios.com> (raw)
In-Reply-To: <87eeratm07.fsf@tromey.com>

On 2020-05-23 4:49 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> Replace all uses of it by type::field.
> 
> Looks good.

Thanks, I'll push the patch then.

> Simon> Note that since type::field returns a reference to the field, some spots
> Simon> are used to assign the whole field structure.  See ctfread.c, function
> Simon> attach_fields_to_type, for example.  This is the same as was happening
> Simon> with the macro, so I don't think it's a problem, but if anybody sees a
> Simon> really nicer way to do this, now could be a good time to implement it.
> 
> Ultimately I imagine we'll just want a way to set all the fields at
> once, perhaps making a copy of them if needed; and then disallow writing
> to a field.
> 
> Tom
> 

Perhaps, I'm not really there yet.  I think it will still be useful
to set just one field, some languages do that I believe.  But it could
be using a type::set_field method, this way it's easier to trace /
debug.

Forcing to set all the fields at once would just force the callers to
do more work, without any benefit.  If they copy the whole field array,
make a modification, then set the whole field array, it's essentially
the same as just setting that single field, isn't it?

Simon

      reply	other threads:[~2020-05-23 21:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 21:27 Simon Marchi
2020-05-23 20:49 ` Tom Tromey
2020-05-23 21:22   ` Simon Marchi [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=ba9ad86e-97b3-d216-b13a-5696ac3bc5e5@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).