gdb/riscv: Add read_description method for riscv_linux_nat_target
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 28 Nov 2018 22:42:27 +0000 (22:42 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 30 Nov 2018 18:13:43 +0000 (18:13 +0000)
commit92528b6772a19dd671b52d954c14886b11fc0a8d
tree1f858fb31fd4fde6cbcca127636ad8e82d9db556
parent634494366c515a89c4747d8a68a8da9218bb4969
gdb/riscv: Add read_description method for riscv_linux_nat_target

Adds riscv_linux_nat_target::read_description method to find a
suitable target description for the native linux target we are running
on.

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.

As of Linux 4.19 there is no ptrace support for reading the
f-registers, this should appear in 4.20, so right now we only return
target descriptions without f-registers.

gdb/ChangeLog:

* riscv-linux-nat.c: Add 'inferior.h' and 'target-descriptions.h'
header files.
(riscv_linux_nat_target::read_description): New method.
gdb/ChangeLog
gdb/riscv-linux-nat.c