Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Pedro Alves <pedro@palves.net>,
	Simon Marchi <simon.marchi@efficios.com>,
	 gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: fix gdbarch_tdep ODR violation
Date: Mon, 15 Nov 2021 11:53:58 -0500	[thread overview]
Message-ID: <2f790289-e834-b294-47d7-d6de5f008099@simark.ca> (raw)
In-Reply-To: <02f10a33-9657-5e16-e753-4b0476a4da1d@palves.net>

On 2021-11-15 11:47 a.m., Pedro Alves wrote:
> On 2021-11-12 20:42, Simon Marchi via Gdb-patches wrote:
>> +      aarch64_gdbarch_tdep *tdep
>> +	= (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch);
> 
> I'd think it would be nicer if we added a small wrapper function to each module, like:
> 
> static aarch64_gdbarch_tdep *
> aarch64_gdbarch_tdep (struct gdbarch *gdbarch)
> {
>    return (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch);
> }
> 
> and then we we'd get rid of all the casts and duplicated type names at the callers, like:
> 
>      auto *tdep = aarch64_gdbarch_tdep (gdbarch);
> 
> That'd essentially require touching again most lines you already touched, so, yeah, for some
> other rainy day...
> 

Hmm good idea.  Perhaps with some sed commands it might not be so bad, I'll see.

Simon

      reply	other threads:[~2021-11-15 16:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 20:42 Simon Marchi via Gdb-patches
2021-11-12 21:55 ` John Baldwin
2021-11-15 10:45 ` Luis Machado via Gdb-patches
2021-11-15 16:29   ` Simon Marchi
2021-11-15 20:42     ` will schmidt via Gdb-patches
2021-11-15 20:43       ` Simon Marchi via Gdb-patches
2021-11-15 23:19         ` Luis Machado via Gdb-patches
2021-11-16  2:02           ` Simon Marchi via Gdb-patches
2021-11-15 16:47 ` Pedro Alves
2021-11-15 16:53   ` 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=2f790289-e834-b294-47d7-d6de5f008099@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simon.marchi@efficios.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