Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@imgtec.com>
To: <binutils@sourceware.org>, <gdb-patches@sourceware.org>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>,
	Pedro Alves	<palves@redhat.com>,
	Djordje Todorovic <djordje.todorovic@rt-rk.com>
Subject: [PATCH 4/4] GDB: Remove Linux core PRPSINFO note writer override
Date: Sat, 23 Sep 2017 00:05:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1709230041030.16752@tp.orcam.me.uk> (raw)
In-Reply-To: <alpine.DEB.2.00.1709220216120.16752@tp.orcam.me.uk>

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/gdbarch.c    |   32 --------------------------------
 gdb/gdbarch.h    |   13 -------------
 gdb/gdbarch.sh   |    8 --------
 gdb/linux-tdep.c |   23 +++++++----------------
 4 files changed, 7 insertions(+), 69 deletions(-)

gdb-gdbarch-elfcore-write-linux-prpsinfo.diff
Index: binutils/gdb/gdbarch.c
===================================================================
--- binutils.orig/gdb/gdbarch.c	2017-09-15 13:54:01.000000000 +0100
+++ binutils/gdb/gdbarch.c	2017-09-20 01:02:46.584755366 +0100
@@ -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.  */
@@ -973,12 +971,6 @@ gdbarch_dump (struct gdbarch *gdbarch, s
                       "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));
   fprintf_unfiltered (file,
@@ -3661,30 +3653,6 @@ set_gdbarch_make_corefile_notes (struct 
 }
 
 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)
 {
   gdb_assert (gdbarch != NULL);
Index: binutils/gdb/gdbarch.h
===================================================================
--- binutils.orig/gdb/gdbarch.h	2017-08-11 18:17:40.000000000 +0100
+++ binutils/gdb/gdbarch.h	2017-09-20 01:02:52.288155019 +0100
@@ -62,7 +62,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;
@@ -876,18 +875,6 @@ typedef char * (gdbarch_make_corefile_no
 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: binutils/gdb/gdbarch.sh
===================================================================
--- binutils.orig/gdb/gdbarch.sh	2017-09-15 13:54:01.000000000 +0100
+++ binutils/gdb/gdbarch.sh	2017-09-20 01:00:11.068519662 +0100
@@ -728,13 +728,6 @@ M;void;iterate_over_regset_sections;iter
 # 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
 
@@ -1287,7 +1280,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: binutils/gdb/linux-tdep.c
===================================================================
--- binutils.orig/gdb/linux-tdep.c	2017-09-15 13:54:02.000000000 +0100
+++ binutils/gdb/linux-tdep.c	2017-09-20 01:02:04.909851990 +0100
@@ -1955,23 +1955,14 @@ linux_make_corefile_notes (struct gdbarc
 
   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.  */


  parent reply	other threads:[~2017-09-23  0:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-23  0:02 [PATCH 0/4] Fix issues with Linux core PRPSINFO note definitions Maciej W. Rozycki
2017-09-23  0:03 ` [PATCH 1/4] ELF/BFD: Fix padding in `elf_external_linux_prpsinfo64' Maciej W. Rozycki
2017-09-23  0:04 ` [PATCH 3/4] ELF/BFD: Handle both variants of the 64-bit Linux core PRPSINFO note Maciej W. Rozycki
2017-09-23  2:05   ` Sergio Durigan Junior
2017-09-24 22:19     ` Maciej W. Rozycki
2017-09-24 23:32       ` Sergio Durigan Junior
2017-09-25  9:48         ` Maciej W. Rozycki
2017-09-25 16:49           ` Sergio Durigan Junior
2017-09-23  0:04 ` [PATCH 2/4] ELF/BFD,GDB: Handle both variants of the 32-bit " Maciej W. Rozycki
2017-09-23  0:05 ` Maciej W. Rozycki [this message]
2017-09-23  2:10 ` [PATCH 0/4] Fix issues with Linux core PRPSINFO note definitions Sergio Durigan Junior
2017-09-24 23:46 ` Alan Modra
2017-09-29 21:11 ` [PING][PATCH " Maciej W. Rozycki
2017-10-11  0:32   ` [PING^2][PATCH " Maciej W. Rozycki
2017-10-11  9:41     ` Pedro Alves
2017-10-11 14:06       ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1709230041030.16752@tp.orcam.me.uk \
    --to=macro@imgtec.com \
    --cc=binutils@sourceware.org \
    --cc=djordje.todorovic@rt-rk.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=sergiodj@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox