aboutsummaryrefslogtreecommitdiff
path: root/gdb/riscv-linux-nat.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
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.
2018-11-30gdb/riscv: Add read_description method for riscv_linux_nat_targetAndrew Burgess1-0/+38
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-10-28gdb/riscv: Add back missing braces in riscv-linux-nat.cAndrew Burgess1-2/+4
In this commit: commit ee67fd7f3f6ca78eede2862e309c0bcf266bbd7e 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-25gdb/riscv: Use correct regnum in riscv_linux_nat_target::fetch_registersAndrew Burgess1-4/+2
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-08-29Fix riscv-linux native gdb build failure.Jim Wilson1-4/+5
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-09RISC-V: Add native linux support.Jim Wilson1-0/+280
Add initial native support for riscv*-linux*. gdb/ * riscv-linux-nat.c: New file.