GDB: Remove Linux core PRPSINFO note writer override
authorMaciej W. Rozycki <macro@imgtec.com>
Wed, 11 Oct 2017 14:01:41 +0000 (15:01 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Wed, 11 Oct 2017 14:01:41 +0000 (15:01 +0100)
Revert parts of commit b3ac9c77560a ("Put more info in NT_PRPSINFO Linux
notes"), <https://sourceware.org/ml/binutils/2013-02/msg00024.html>, and
remove support for a Linux core PRPSINFO note writer override, now that
all variants are handled automatically within BFD itself.

gdb/
* linux-tdep.c (linux_make_corefile_notes): Remove call to
`gdbarch_elfcore_write_linux_prpsinfo'.
* gdbarch.sh (elfcore_write_linux_prpsinfo): Remove architecture
method.
(elf_internal_linux_prpsinfo): Remove declaration.
* gdbarch.h: Regenerate.
* gdbarch.c: Regenerate.

gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/linux-tdep.c

index d7e4117af22a7005b5998a79c294c8a0fc22d7dd..62316382710c3de2331362d49a5c673d08fdbce0 100644 (file)
@@ -1,3 +1,13 @@
+2017-10-11  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * linux-tdep.c (linux_make_corefile_notes): Remove call to
+       `gdbarch_elfcore_write_linux_prpsinfo'.
+       * gdbarch.sh (elfcore_write_linux_prpsinfo): Remove architecture
+       method.
+       (elf_internal_linux_prpsinfo): Remove declaration.
+       * gdbarch.h: Regenerate.
+       * gdbarch.c: Regenerate.
+
 2017-10-11  Maciej W. Rozycki  <macro@imgtec.com>
 
        * ppc-linux-tdep.c (ppc_linux_init_abi): Remove call to
index 5a84879ae1e58f99d3f44eed8fc6ab5487471893..007392cd6a7f8438401e8e16e1ca317c9740f4ac 100644 (file)
@@ -281,7 +281,6 @@ struct gdbarch
   gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
   gdbarch_iterate_over_regset_sections_ftype *iterate_over_regset_sections;
   gdbarch_make_corefile_notes_ftype *make_corefile_notes;
-  gdbarch_elfcore_write_linux_prpsinfo_ftype *elfcore_write_linux_prpsinfo;
   gdbarch_find_memory_regions_ftype *find_memory_regions;
   gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
   gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix;
@@ -641,7 +640,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of fetch_pointer_argument, has predicate.  */
   /* Skip verify of iterate_over_regset_sections, has predicate.  */
   /* Skip verify of make_corefile_notes, has predicate.  */
-  /* Skip verify of elfcore_write_linux_prpsinfo, has predicate.  */
   /* Skip verify of find_memory_regions, has predicate.  */
   /* Skip verify of core_xfer_shared_libraries, has predicate.  */
   /* Skip verify of core_xfer_shared_libraries_aix, has predicate.  */
@@ -972,12 +970,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
                       host_address_to_string (gdbarch->elf_make_msymbol_special));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_elfcore_write_linux_prpsinfo_p() = %d\n",
-                      gdbarch_elfcore_write_linux_prpsinfo_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: elfcore_write_linux_prpsinfo = <%s>\n",
-                      host_address_to_string (gdbarch->elfcore_write_linux_prpsinfo));
   fprintf_unfiltered (file,
                       "gdbarch_dump: execute_dwarf_cfa_vendor_op = <%s>\n",
                       host_address_to_string (gdbarch->execute_dwarf_cfa_vendor_op));
@@ -3660,30 +3652,6 @@ set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch,
   gdbarch->make_corefile_notes = make_corefile_notes;
 }
 
-int
-gdbarch_elfcore_write_linux_prpsinfo_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->elfcore_write_linux_prpsinfo != NULL;
-}
-
-char *
-gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch, bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->elfcore_write_linux_prpsinfo != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_elfcore_write_linux_prpsinfo called\n");
-  return gdbarch->elfcore_write_linux_prpsinfo (obfd, note_data, note_size, info);
-}
-
-void
-set_gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch,
-                                          gdbarch_elfcore_write_linux_prpsinfo_ftype elfcore_write_linux_prpsinfo)
-{
-  gdbarch->elfcore_write_linux_prpsinfo = elfcore_write_linux_prpsinfo;
-}
-
 int
 gdbarch_find_memory_regions_p (struct gdbarch *gdbarch)
 {
index 830acb28b4a9a1253d401cfaa71d2b683e937984..f276d09a6612eb159cceda9fa00404f17ebb1df8 100644 (file)
@@ -61,7 +61,6 @@ struct axs_value;
 struct stap_parse_info;
 struct parser_state;
 struct ravenscar_arch_ops;
-struct elf_internal_linux_prpsinfo;
 struct mem_range;
 struct syscalls_info;
 struct thread_info;
@@ -875,18 +874,6 @@ typedef char * (gdbarch_make_corefile_notes_ftype) (struct gdbarch *gdbarch, bfd
 extern char * gdbarch_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size);
 extern void set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch, gdbarch_make_corefile_notes_ftype *make_corefile_notes);
 
-/* The elfcore writer hook to use to write Linux prpsinfo notes to core
-   files.  Most Linux architectures use the same prpsinfo32 or
-   prpsinfo64 layouts, and so won't need to provide this hook, as we
-   call the Linux generic routines in bfd to write prpsinfo notes by
-   default. */
-
-extern int gdbarch_elfcore_write_linux_prpsinfo_p (struct gdbarch *gdbarch);
-
-typedef char * (gdbarch_elfcore_write_linux_prpsinfo_ftype) (bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info);
-extern char * gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch, bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info);
-extern void set_gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch, gdbarch_elfcore_write_linux_prpsinfo_ftype *elfcore_write_linux_prpsinfo);
-
 /* Find core file memory regions */
 
 extern int gdbarch_find_memory_regions_p (struct gdbarch *gdbarch);
index addd92df0a57b2ac3c669c5d6b61dee2e8ecd9cc..ea15c8c1b51b90da46db83588e0584ce02400158 100755 (executable)
@@ -728,13 +728,6 @@ M;void;iterate_over_regset_sections;iterate_over_regset_sections_cb *cb, void *c
 # Create core file notes
 M;char *;make_corefile_notes;bfd *obfd, int *note_size;obfd, note_size
 
-# The elfcore writer hook to use to write Linux prpsinfo notes to core
-# files.  Most Linux architectures use the same prpsinfo32 or
-# prpsinfo64 layouts, and so won't need to provide this hook, as we
-# call the Linux generic routines in bfd to write prpsinfo notes by
-# default.
-F;char *;elfcore_write_linux_prpsinfo;bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info;obfd, note_data, note_size, info
-
 # Find core file memory regions
 M;int;find_memory_regions;find_memory_region_ftype func, void *data;func, data
 
@@ -1286,7 +1279,6 @@ struct axs_value;
 struct stap_parse_info;
 struct parser_state;
 struct ravenscar_arch_ops;
-struct elf_internal_linux_prpsinfo;
 struct mem_range;
 struct syscalls_info;
 struct thread_info;
index 5dd87b7e847bcc5e17ed8c59db8a0cbaad4a01af..8751718e84396a4cf0a91152fa929680c9c67781 100644 (file)
@@ -1956,23 +1956,14 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
 
   if (linux_fill_prpsinfo (&prpsinfo))
     {
-      if (gdbarch_elfcore_write_linux_prpsinfo_p (gdbarch))
-       {
-         note_data = gdbarch_elfcore_write_linux_prpsinfo (gdbarch, obfd,
-                                                           note_data, note_size,
-                                                           &prpsinfo);
-       }
+      if (gdbarch_ptr_bit (gdbarch) == 64)
+       note_data = elfcore_write_linux_prpsinfo64 (obfd,
+                                                   note_data, note_size,
+                                                   &prpsinfo);
       else
-       {
-         if (gdbarch_ptr_bit (gdbarch) == 64)
-           note_data = elfcore_write_linux_prpsinfo64 (obfd,
-                                                       note_data, note_size,
-                                                       &prpsinfo);
-         else
-           note_data = elfcore_write_linux_prpsinfo32 (obfd,
-                                                       note_data, note_size,
-                                                       &prpsinfo);
-       }
+       note_data = elfcore_write_linux_prpsinfo32 (obfd,
+                                                   note_data, note_size,
+                                                   &prpsinfo);
     }
 
   /* Thread register information.  */