public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tromey@adacore.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Make gdb property batons type-safe
Date: Wed, 01 Mar 2023 15:28:30 -0700	[thread overview]
Message-ID: <87wn40ayy9.fsf@tromey.com> (raw)
In-Reply-To: <debe62c8-e56f-35ea-27de-18ad1c9de309@simark.ca> (Simon Marchi's message of "Wed, 1 Mar 2023 13:44:47 -0500")

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> On 3/1/23 10:18, Tom Tromey via Gdb-patches wrote:
>> gdbtypes treats dynamic property batons as 'void *', but in actuality
>> the only users all use dwarf2_property_baton.  This patch changes this
>> code to be type-safe.  If a new type is needed here, it seems like
>> that too could be done in a type-safe way.

Simon> I don't mind doing this, because in practice the DWARF reader is the
Simon> only one to use that data pointer.  But just wondering, what would be
Simon> the "right" way to implement this pattern in a type-safe way, if
Simon> multiple debug info readers wanted to use that field?

There's several possibilities but one would be to just add a new element
to the union and new setters/getters.

Tom

  reply	other threads:[~2023-03-01 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 15:18 [PATCH 0/2] Two minor dynamic property fixes Tom Tromey
2023-03-01 15:18 ` [PATCH 1/2] Make gdb property batons type-safe Tom Tromey
2023-03-01 18:44   ` Simon Marchi
2023-03-01 22:28     ` Tom Tromey [this message]
2023-03-01 15:18 ` [PATCH 2/2] Use const for dwarf2_property_baton Tom Tromey
2023-03-01 18:45 ` [PATCH 0/2] Two minor dynamic property fixes Simon Marchi

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=87wn40ayy9.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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).