RISC-V: Enable 32-bit linux gdb core file support.

Message ID 20190422211852.4239-1-jimw@sifive.com
State New
Headers show
Series
  • RISC-V: Enable 32-bit linux gdb core file support.
Related show

Commit Message

Jim Wilson April 22, 2019, 9:18 p.m.
This allows riscv32-linux gdb to read a core file.  This was tested by building
a 32-bit OpenEmbedded rootfs, booting in qemu, using kill to generate a core
file, copying the binary and core file out of the rootfs, and loading them
into a cross gdb.  Without the patch, gdb gives an error saying that it can't
find any registers.  With the patch, gdb reports the correct signal, and the
correct register file values.

This was also tested with cross binutils, gas, and ld checks for 32- and 64-bit
elf and linux targets.  There were no regressions.

Committed.

Jim

	bfd/
	* elfnn-riscv.c (PRSTATUS_SIZE) [ARCH_SIZE==32]: Change from 0 to 204.
---
 bfd/elfnn-riscv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

Patch

diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 964b6bdcbc..1bddbcaa93 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -4008,7 +4008,7 @@  fail:
 }
 
 #if ARCH_SIZE == 32
-# define PRSTATUS_SIZE			0 /* FIXME */
+# define PRSTATUS_SIZE			204
 # define PRSTATUS_OFFSET_PR_CURSIG	12
 # define PRSTATUS_OFFSET_PR_PID		24
 # define PRSTATUS_OFFSET_PR_REG		72