Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Remove only use of current_inferior ()->gdbarch outside of gdbarch.*
Date: Fri, 28 Aug 2015 15:04:00 -0000	[thread overview]
Message-ID: <CAP9bCMSMhczR4VzEVxTtEud7=o7zRiutMfpB6FnprH3kQk2WNA@mail.gmail.com> (raw)
In-Reply-To: <m3d1y8f0yl.fsf@sspiff.org>

On Thu, Aug 27, 2015 at 10:15 PM, Doug Evans <xdje42@gmail.com> wrote:
> Hi.
>
> target_gdbarch is a magical thing, there are different kinds of arches:
> for multiarch systems (e.g., call) which arch you use for certain
> struct gdbarch API calls is important.
>
> E.g.,
> https://sourceware.org/ml/gdb-patches/2015-08/msg00789.html
>
> Until this is cleaned up it'd be best to only use target_gdbarch
> and not its underlying implementation.
> Fortunately there is only one place that needed changing
> (further reinforcing my sense that only target_gdbarch should be
> used and never current_inferior ()->gdbarch).
>
> Alas, short of an API reorg (which I think is reasonable), I can't think
> of a way to prevent this from recurring.
>
>
> 2015-08-27  Doug Evans  <xdje42@gmail.com>
>
>         * ravenscar-thread.c (ravenscar_inferior_created): Replace
>         current_inferior ()->gdbarch with its wrapper target_gdbarch.
>
> diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
> index ef82507..fe36c96 100644
> --- a/gdb/ravenscar-thread.c
> +++ b/gdb/ravenscar-thread.c
> @@ -341,7 +341,7 @@ ravenscar_inferior_created (struct target_ops *target, int from_tty)
>    struct ravenscar_arch_ops *ops;
>
>    if (!ravenscar_task_support
> -      || gdbarch_ravenscar_ops (current_inferior ()->gdbarch) == NULL
> +      || gdbarch_ravenscar_ops (target_gdbarch ()) == NULL
>        || !has_ravenscar_runtime ())
>      return;
>

Hmmm, forgot about ARI, bleah.
We could use that to at least catch recurrences.


  reply	other threads:[~2015-08-28 15:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28  5:16 Doug Evans
2015-08-28 15:04 ` Doug Evans [this message]
2015-08-28 17:22   ` Ulrich Weigand
2015-08-28 19:16     ` Doug Evans
2015-08-31 14:02       ` Ulrich Weigand
2015-09-20 19:52         ` Doug Evans

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='CAP9bCMSMhczR4VzEVxTtEud7=o7zRiutMfpB6FnprH3kQk2WNA@mail.gmail.com' \
    --to=xdje42@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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