[PATCH 1/2] Nios2, libbfd: Support new coredump .reg section

Moritz Strübe moritz.struebe@siemens-energy.com
Fri Apr 19 10:39:21 GMT 2024


The coredumps of the current kernel are larger.
---
 bfd/elf32-nios2.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
index 806ec314c82..3d0fa6fbf27 100644
--- a/bfd/elf32-nios2.c
+++ b/bfd/elf32-nios2.c
@@ -1921,7 +1921,18 @@ nios2_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
     {
     default:
       return false;
+    case 272:  /* Linux/Nios II */
+      /* pr_cursig */
+      elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
+
+      /* pr_pid */
+      elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
 
+      /* pr_reg */
+      offset = 72;
+      size = 196;
+
+      break;
     case 212:	      /* Linux/Nios II */
       /* pr_cursig */
       elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
-- 
2.30.2



More information about the Gdb-patches mailing list