This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] RISC-V: Enable 32-bit linux gdb core file support.
- From: Jim Wilson <jimw at sifive dot com>
- To: binutils at sourceware dot org
- Cc: Jim Wilson <jimw at sifive dot com>
- Date: Mon, 22 Apr 2019 14:18:52 -0700
- Subject: [PATCH] RISC-V: Enable 32-bit linux gdb core file support.
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(-)
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
--
2.17.1