# Solaris-specific core file processing. # Will contribute upstream if possible. --- gdb-15.1/bfd/elf-bfd.h +++ gdb-15.1/bfd/elf-bfd.h @@ -1447,6 +1447,11 @@ note is found in a core file. */ bool (*elf_backend_grok_freebsd_prstatus) (bfd *, Elf_Internal_Note *); + /* This function, if defined, is called when an NT_LWPSTATUS + note is found in a core file. */ + bool (*elf_backend_grok_lwpstatus) + (bfd *, Elf_Internal_Note *); + /* This function, if defined, is called to write a note to a corefile. */ char *(*elf_backend_write_core_note) (bfd *abfd, char *buf, int *bufsiz, int note_type, ...); --- gdb-15.1/bfd/elf.c +++ gdb-15.1/bfd/elf.c @@ -10516,7 +10516,10 @@ data structure apart. */ static bool elfcore_grok_prfpreg (bfd *abfd, Elf_Internal_Note *note) { - return elfcore_make_note_pseudosection (abfd, ".reg2", note); + asection *sect = bfd_get_section_by_name (abfd, ".reg2"); + if (sect == NULL) + return elfcore_make_note_pseudosection (abfd, ".reg2", note); + return true; } /* Linux dumps the Intel SSE regs in a note named "LINUX" with a note @@ -11211,6 +11214,9 @@ #endif #if defined (HAVE_LWPSTATUS_T) case NT_LWPSTATUS: + if (bed->elf_backend_grok_lwpstatus) + if ((*bed->elf_backend_grok_lwpstatus) (abfd, note)) + return true; return elfcore_grok_lwpstatus (abfd, note); #endif --- gdb-15.1/bfd/elfxx-target.h +++ gdb-15.1/bfd/elfxx-target.h @@ -630,6 +630,9 @@ #endif #ifndef elf_backend_grok_psinfo #define elf_backend_grok_psinfo NULL #endif +#ifndef elf_backend_grok_lwpstatus +#define elf_backend_grok_lwpstatus NULL +#endif #ifndef elf_backend_grok_freebsd_prstatus #define elf_backend_grok_freebsd_prstatus NULL #endif @@ -894,6 +897,7 @@ elf_backend_count_additional_relocs, elf_backend_sort_relocs_p, elf_backend_grok_prstatus, elf_backend_grok_psinfo, + elf_backend_grok_lwpstatus, elf_backend_grok_freebsd_prstatus, elf_backend_write_core_note, elf_backend_lookup_section_flags_hook,