[RFC,12/13] linux-tdep: Export linux_make_corefile_notes

Message ID 20231009183617.24862-13-jhb@FreeBSD.org
State New
Headers
Series Proposal for a new NT_X86_CPUID core dump note |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

John Baldwin Oct. 9, 2023, 6:36 p.m. UTC
  This permits Linux architectures to override the gdbarch
make_corefile_notes method to add architecture-specific notes.
---
 gdb/linux-tdep.c | 5 ++---
 gdb/linux-tdep.h | 7 +++++++
 2 files changed, 9 insertions(+), 3 deletions(-)
  

Patch

diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index f03a5b95332..1c9c09dbd71 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -2033,10 +2033,9 @@  linux_fill_prpsinfo (struct elf_internal_linux_prpsinfo *p)
   return 1;
 }
 
-/* Build the note section for a corefile, and return it in a malloc
-   buffer.  */
+/* See linux-tdep.h.  */
 
-static gdb::unique_xmalloc_ptr<char>
+gdb::unique_xmalloc_ptr<char>
 linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
 {
   struct elf_internal_linux_prpsinfo prpsinfo;
diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h
index e09a6ef32b1..20807031e44 100644
--- a/gdb/linux-tdep.h
+++ b/gdb/linux-tdep.h
@@ -52,6 +52,13 @@  typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *,
 						       bfd *, char *, int *,
 						       enum gdb_signal);
 
+/* Build the note section for a corefile, and return it in a malloc
+   buffer.  */
+
+gdb::unique_xmalloc_ptr<char> linux_make_corefile_notes (struct gdbarch *gdbarch,
+							 bfd *obfd,
+							 int *note_size);
+
 extern enum gdb_signal linux_gdb_signal_from_target (struct gdbarch *gdbarch,
 						     int signal);