From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: brobecker@adacore.com (Joel Brobecker)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Introduce "target_gdbarch" variable
Date: Mon, 18 Aug 2008 13:59:00 -0000 [thread overview]
Message-ID: <200808181357.m7IDvCiv002739@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20080818113323.GF16894@adacore.com> from "Joel Brobecker" at Aug 18, 2008 03:33:23 PM
Joel Brobecker wrote:
> Just my 2 cents...
Thanks for looking at this!
> > The idea is that this variable would stay even as other uses of
> > current_gdbarch are being eliminated in favor of per-thread etc.
> > architectures.
>
> I am wondering why these ones are OK to stay, or perhaps you were
> thinking of a short-to-medium term situation. Otherwise, isn't this
> global going to be a problem with true multi-arch? Another situation
> where this might be a problem is when the debugger is debugging more
> than one process from different architectures (Stan's project).
The idea was that target_gdbarch is the architecture assoicated with
the connection to one target. As we currently support only one target
at a time, using a global for that should be fine. As soon as we start
supporting multiple target connections at the same time, we'd need
multiple instances of this as well. At this point, it would probably
make sense to make this a member of "struct target".
> > Does this seem reasonable?
>
> It seems reasonable to me, modulo the part where I don't understand
> why the current globals used in target-remote/solib are OK to stay.
"remote" uses gdbarch to store properties of the connection to its
targets. For example, the layout of the "g" packet is stored there.
Even in a scenario where we have per-thread / per-frame architectures,
those properties will still stay invariant for one target.
Similarly, "solib" stores the overall method to use to search for
shared libraries as gdbarch properties. Again, this is a global
property of a certain target, even though the inferior may have
some threads / frames that use a different architecture.
It may be that at some point, this will need to be fundamentally
changed anyway, e.g. because the association of one single solib
method to one target may no longer be sufficient. At this point,
those properties might have to be moved out of gdbarch completely.
But even so, I think moving them to target_gdbarch (even if in the
long run this turns out to be just a temporary solution) would be
helpful in the short run, as it allows adding per-frame architecture
support without major up-front changes to the solib code ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2008-08-18 13:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 19:53 Ulrich Weigand
2008-08-18 11:34 ` Joel Brobecker
2008-08-18 13:59 ` Ulrich Weigand [this message]
2008-08-18 14:11 ` Joel Brobecker
2008-08-26 17:33 ` Ulrich Weigand
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=200808181357.m7IDvCiv002739@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=brobecker@adacore.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