Commit Graph

6 Commits

Author SHA1 Message Date
Joel Brobecker 42a4f53d2b Update copyright year range in all GDB files.
This commit applies all changes made after running the gdb/copyright.py
script.

Note that one file was flagged by the script, due to an invalid
copyright header
(gdb/unittests/basic_string_view/element_access/char/empty.cc).
As the file was copied from GCC's libstdc++-v3 testsuite, this commit
leaves this file untouched for the time being; a patch to fix the header
was sent to gcc-patches first.

gdb/ChangeLog:

	Update copyright year range in all GDB files.
2019-01-01 10:01:51 +04:00
Andrew Burgess 92528b6772 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.
2018-11-30 18:13:43 +00:00
Andrew Burgess a3d7226832 gdb/riscv: Add back missing braces in riscv-linux-nat.c
In this commit:

    commit ee67fd7f3f
    Date:   Thu Oct 25 12:03:31 2018 +0100

        gdb/riscv: Use correct regnum in riscv_linux_nat_target::fetch_registers

I incorrectly removed a set of braces in violation of the GDB coding
standard.  This commit adds them back.

gdb/ChangeLog:

	* riscv-linux-nat.c (riscv_linux_nat_target::fetch_registers):
	Add missing braces.  No functional change.
2018-10-28 10:43:26 +00:00
Andrew Burgess ee67fd7f3f gdb/riscv: Use correct regnum in riscv_linux_nat_target::fetch_registers
In riscv_linux_nat_target::fetch_registers, if we are asked to supply
all registers (regnum parameter is -1), then we currently end up
calling regcache::raw_supply_zeroed with the regnum -1, which is
invalid.  Instead we should be passing the regnum of the specific
register we wish to supply zeroed, in this case RISCV_CSR_MISA_REGNUM.

I removed the extra { ... } block in line with the coding standard
while editing this area.

gdb/ChangeLog:

	* riscv-linux-nat.c (riscv_linux_nat_target::fetch_registers):
	Pass correct regnum to raw_supply_zeroed.
2018-10-25 12:03:31 +01:00
Jim Wilson 4d3928d7e0 Fix riscv-linux native gdb build failure.
The linux kernel uses NT_PRFPREG.  Glibc before BZ 14890 defines NT_FPREGSET.
After it defines both.  Avoid glibc version dependency by using the gdb header
file instead of the glibc header file, and the macro name that gdb defines
which is NT_FPREGSET.

	gdb/
	* riscv-linux-nat.c: Include elf/common.h instead of elf.h.
	(riscv_linux_nat_target::fetch_registers): Use NT_FPREGSET instead
	of NT_PRFPREG.
	(riscv_linux_nat_target::store_registers): Likewise.
2018-08-29 10:52:42 -07:00
Jim Wilson 3c77f97eb0 RISC-V: Add native linux support.
Add initial native support for riscv*-linux*.

	gdb/
	* riscv-linux-nat.c: New file.
2018-08-09 13:35:24 -07:00