Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: mark.kettenis@xs4all.nl (Mark Kettenis)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc/rft] [3/5] Untangle register_addr: CANNOT_FETCH/STORE_REGISTER
Date: Mon, 16 Apr 2007 16:03:00 -0000	[thread overview]
Message-ID: <200704161514.l3GFElrS011272@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200704142249.l3EMnlut014933@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at Apr 15, 2007 12:49:47 AM

Mark Kettenis wrote:

> So effectively, this turns CANNOT_FETCH_REGISTER/CANNOT_STORE_REGISTER
> from being overloaded as both a native and target property into a
> target-architecture-only property instead.  That's probably a good
> idea.

Yes, that's certainly a main point of this.  Having an NM file provide
an override definition of a gdbarch routine is quite broken and prevents
further multi-arch conversion -- fortunately the mips-linux definition
of CANNOT_FETCH_REGISTER/CANNOT_STORE_REGISTER is the last remaining
instance of this.

> However, I think you removing the calls from the calls from the
> inf_ptrace_trad_target routines is wrong.  We should never fetch/store
> the registers for which the target architecture says that they cannot
> be fetched/stored.

Hmmm.  The reason why I did it this way was that I found it odd
for a native target fetch_registers routine to have to rely on
a gdbarch routine to make that determination.

Say, suppose on a target some register cannot be fetched (or stored)
by ptrace due to some limitation, but that same register may very well
be accessible via a remote stub.  In that case, it is not really a
gdbarch property that the register isn't accessible, but should be
handled solely within the native target code.

Now, a native target that simply provides its own fetch_registers
/ store_registers *is* of course free to implement such rules on
its own.  My patch simply makes that same set of choices available
to native targets that avail themselves of the inf_trad_ptrace
helpers.


Longer term, I would even think that the gdbarch cannot_store_register
and cannot_fetch_register routines could be completely obsoleted --
the per-target aspects should be handled by each target itself,
and the remaining per-architecture aspects could be covered by the
reggroup mechanism (in particular fetch_reggroup / store_reggroup).

But maybe this (if it should be the right direction anyway) should
be left to another patch, and not intermixed with the other set
of changes ...

> If you leave them in, do any targets remain that have any registers
> that can be fetched but cannot be stored by ptrace(2), that are not
> defined as such by the target architecture.  I'd be surprised if there
> were any such registers.

Well, there is the problem on mips-linux, because cannot_fetch is
different from cannot_store there.

However, as an intermediate step I could install the mips-linux
functions as Linux-specific gdbarch callbacks instead of NM file
overrides.  That would affect cross-debugging too, though ...

Bye,
Ulrich


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


      reply	other threads:[~2007-04-16 15:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-14 21:11 Ulrich Weigand
2007-04-14 22:55 ` Mark Kettenis
2007-04-16 16:03   ` Ulrich Weigand [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=200704161514.l3GFElrS011272@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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