Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@freebsd.org>
To: gdb-patches@sourceware.org
Cc: "Maciej W. Rozycki" <macro@imgtec.com>, Yao Qi <qiyaoltc@gmail.com>
Subject: Re: [PATCH] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c
Date: Wed, 10 May 2017 16:19:00 -0000	[thread overview]
Message-ID: <3174656.5xSoUNdgyV@ralph.baldwin.cx> (raw)
In-Reply-To: <alpine.DEB.2.00.1705101248380.2590@tp.orcam.me.uk>

On Wednesday, May 10, 2017 12:51:59 PM Maciej W. Rozycki wrote:
> On Tue, 9 May 2017, Yao Qi wrote:
> 
> > Target description initialization should be called in -tdep.c, instead of
> > -nat.c.  Rebuild mips-linux native GDB.  Regression test is not run.
> 
>  Why?  These descriptions are only used in the native case, otherwise 
> gdbserver supplies its own.  The current arrangement has worked for some 
> 12 years now.

Target descriptions (in general) might be determined purely by a core dump's
contents.  For example, in my out-of-tree patches for CHERI MIPS I added
target descriptions for the CHERI capability registers and then use those
target descriptions instead of the default for FreeBSD/mips core dumps that
contain a special "capregs" note (this is implemented via a gdbarch
"core_read_description" method).  For native binaries I depend on a working
ptrace op to determine if the native CPU supports the registers via
the "read_description" target method.

If core dumps of Linux binaries on processors with DSP registers included
those registers in process cores then you would need a similar method for
the Linux MIPS gdbarch that worked similar to mips_linux_read_description
to select the appropriate target description for process cores.

Another example of target descriptions used this way is on i386/amd64 for
both Linux and FreeBSD which use the register note with XSAVE registers
(and it's embedded value of %xcr0) to decide which target description to
use for plain SSE vs AVX vs MPX, etc.  Again, these checks are performed
both in the native target "read_description" method for live processes and
in the gdbarch "core_read_description" method for cores.

My guess is that Yao is just fixing this to follow the general rule that
target descriptions belong to the 'tdep' layer so that they can be used
by gdbarch "core_read_description" methods.

-- 
John Baldwin


  parent reply	other threads:[~2017-05-10 16:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 10:07 Yao Qi
2017-05-10 11:52 ` Maciej W. Rozycki
2017-05-10 16:16   ` Yao Qi
2017-05-16 14:01     ` Maciej W. Rozycki
2017-05-10 16:19   ` John Baldwin [this message]
2017-05-16 13:44     ` Maciej W. Rozycki

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=3174656.5xSoUNdgyV@ralph.baldwin.cx \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@imgtec.com \
    --cc=qiyaoltc@gmail.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