public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jim Wilson <jimw@sifive.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org, Palmer Dabbelt <palmer@sifive.com>,
		John Baldwin <jhb@freebsd.org>
Subject: Re: [RFC] gdb/riscv: Add read_description method for riscv_linux_nat_target
Date: Wed, 28 Nov 2018 23:37:00 -0000	[thread overview]
Message-ID: <CAFyWVab3AVHqUcmm6k653Neh4kuBVc_=DHTgeTH604fyCGTDuw@mail.gmail.com> (raw)
In-Reply-To: <20181128224953.22441-1-andrew.burgess@embecosm.com>

On Wed, Nov 28, 2018 at 2:49 PM Andrew Burgess
<andrew.burgess@embecosm.com> wrote:
> Currently this will supply a suitably sized set of x-registers, and
> will probe the kernel to see if the f-registers are readable.  If they
> are readable then we currently assume that the f-registers are the
> same size as the x-registers as I don't know of a good way to probe
> the f-register length.  This will obviously need fixing in future.

The linux kernel currently only supports 64-bit f-registers or none,
so just assuming that they are 64-bits if they exist will work for
now.  The NT_FPREGSET ptrace call is only supported if f-registers
exist, so checking for that is fine.  My linux kernel patch to add
f-register ptrace support adds an elf_fpreg_t type, but it is in
asm/elf.h which is currently not included, and you can't use the type
if you have a 4.19 or earlier kernel.  The elf_gpreg_t definition is
coming from sys/procfs.h which duplicates the definition in asm/elf.h,
but I didn't add an elf_fpreg_t definition to sys/procfs.h, so I'm not
sure what to do about that.

We always have the option of using hwcap info, there are bits set in
there for available architecture extensions.  The hwcap support is
apparently broken in some versions of the linux kernel development
tree, but is hopefully correct in all supported releases.  There are
macros you can find in asm/hwcap.h.  We would have to figure out how
to get these values into gdb, since including asm/hwcap.h directly is
probably not wise.

Jim

  reply	other threads:[~2018-11-28 23:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28 22:50 Andrew Burgess
2018-11-28 23:37 ` Jim Wilson [this message]
2018-11-29  2:23 ` Jim Wilson
2018-11-29 16:50   ` [PATCH 2/4] gdb/riscv: Add equality operators to riscv_gdb_features Andrew Burgess
2018-11-29 16:50   ` [PATCH 0/4] Re: gdb/riscv: Add read_description method for riscv_linux_nat_target Andrew Burgess
2018-11-29 16:50   ` [PATCH 3/4] gdb/riscv: Create each unique target description only once Andrew Burgess
2018-11-29 18:12     ` Pedro Alves
2018-11-29 19:17       ` Andrew Burgess
2018-11-29 22:32       ` Andrew Burgess
2018-11-30 17:07         ` Pedro Alves
2018-11-29 16:50   ` [PATCH 4/4] gdb/riscv: Add read_description method for riscv_linux_nat_target Andrew Burgess
2018-11-29 22:22     ` Jim Wilson
2018-11-29 16:50   ` [PATCH 1/4] gdb/riscv: Make some target description functions constant Andrew Burgess

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='CAFyWVab3AVHqUcmm6k653Neh4kuBVc_=DHTgeTH604fyCGTDuw@mail.gmail.com' \
    --to=jimw@sifive.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@freebsd.org \
    --cc=palmer@sifive.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).