public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gdb] gdb-17.2-rebase-f44: reduce the size of gdb-6.6-buildid-locate.patch
Date: Sun, 28 Jun 2026 00:01:33 GMT	[thread overview]
Message-ID: <178260489366.1.114487245412060706.rpms-gdb-e27fd6f38806@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/gdb
            Branch : gdb-17.2-rebase-f44
            Commit : e27fd6f3880655c23f1a0edafe6843e114f0db1a
            Author : Andrew Burgess <aburgess@redhat.com>
            Date   : 2024-03-14T10:15:31+00:00
            Stats  : +15/-158 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/gdb/c/e27fd6f3880655c23f1a0edafe6843e114f0db1a?branch=gdb-17.2-rebase-f44

            Log:
            reduce the size of gdb-6.6-buildid-locate.patch

While working on the Fedora tree I noticed that the upstream function
build_id_bfd_get is renamed to build_id_bfd_shdr_get.  The body of the
function is not changed at all though.  This is done in the patch
gdb-6.6-buildid-locate.patch.

Carrying this sort of change in the Fedora tree just makes it harder
to maintain our downstream patches (merge conflicts) so I propose that
this small part of gdb-6.6-buildid-locate.patch be reverted, we leave
the function name as build_id_bfd_get.

When regenerating the patches gdb-6.6-buildid-locate-rpm.patch also
changed, but not really: the location of a hunk changed slightly as a
result of the cleanup in the earlier patch.  There's no actual content
change in this second patch.

There should be no changes in the functionality of a Fedora GDB build
after this commit.

---
diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch
index f38fdd5..14013ef 100644
--- a/gdb-6.6-buildid-locate-rpm.patch
+++ b/gdb-6.6-buildid-locate-rpm.patch
@@ -1074,7 +1074,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
 diff --git a/gdb/symfile.h b/gdb/symfile.h
 --- a/gdb/symfile.h
 +++ b/gdb/symfile.h
-@@ -367,6 +367,7 @@ extern void generic_load (const char *args, int from_tty);
+@@ -366,6 +366,7 @@ extern void generic_load (const char *args, int from_tty);
  /* build-id support.  */
  extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
  extern void debug_print_missing (const char *binary, const char *debug);

diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch
index 1350051..706fa34 100644
--- a/gdb-6.6-buildid-locate.patch
+++ b/gdb-6.6-buildid-locate.patch
@@ -33,7 +33,7 @@ diff --git a/bfd/libbfd.h b/bfd/libbfd.h
 diff --git a/gdb/build-id.c b/gdb/build-id.c
 --- a/gdb/build-id.c
 +++ b/gdb/build-id.c
-@@ -24,14 +24,72 @@
+@@ -24,9 +24,67 @@
  #include "gdbsupport/gdb_vecs.h"
  #include "symfile.h"
  #include "objfiles.h"
@@ -101,12 +101,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
  
  /* See build-id.h.  */
  
- const struct bfd_build_id *
--build_id_bfd_get (bfd *abfd)
-+build_id_bfd_shdr_get (bfd *abfd)
- {
-   /* Dynamic objfiles such as ones created by JIT reader API
-      have no underlying bfd structure (that is, objfile->obfd
 @@ -50,6 +108,348 @@ build_id_bfd_get (bfd *abfd)
    return NULL;
  }
@@ -456,15 +450,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
  /* See build-id.h.  */
  
  int
-@@ -58,7 +458,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
-   const struct bfd_build_id *found;
-   int retval = 0;
- 
--  found = build_id_bfd_get (abfd);
-+  found = build_id_bfd_shdr_get (abfd);
- 
-   if (found == NULL)
-     warning (_("File \"%s\" has no build-id, file skipped"),
 @@ -73,63 +473,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
    return retval;
  }
@@ -704,7 +689,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
  	  if (debug_bfd != NULL)
  	    return debug_bfd;
  	}
-@@ -190,31 +694,663 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
+@@ -190,30 +694,662 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
    return {};
  }
  
@@ -1366,14 +1351,12 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
  {
    const struct bfd_build_id *build_id;
  
--  build_id = build_id_bfd_get (objfile->obfd.get ());
 +  if (build_id_filename_return)
 +    *build_id_filename_return = NULL;
 +
-+  build_id = build_id_bfd_shdr_get (objfile->obfd.get ());
+   build_id = build_id_bfd_get (objfile->obfd.get ());
    if (build_id != NULL)
      {
-       if (separate_debug_file_debug)
 @@ -222,8 +1358,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile,
  		    _("\nLooking for separate debug info (build-id) for "
  		      "%s\n"), objfile_name (objfile));
@@ -1423,20 +1406,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
 diff --git a/gdb/build-id.h b/gdb/build-id.h
 --- a/gdb/build-id.h
 +++ b/gdb/build-id.h
-@@ -23,9 +23,10 @@
- #include "gdb_bfd.h"
- #include "gdbsupport/rsp-low.h"
- 
--/* Locate NT_GNU_BUILD_ID from ABFD and return its content.  */
-+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
-+   Locate NT_GNU_BUILD_ID from ABFD and return its content.  */
- 
--extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
-+extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd);
- 
- /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
-    Otherwise, issue a warning and return false.  */
-@@ -38,14 +39,19 @@ extern int build_id_verify (bfd *abfd,
+@@ -38,14 +38,19 @@ extern int build_id_verify (bfd *abfd,
     can be found, return NULL.  */
  
  extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len,
@@ -1458,7 +1428,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
  
  /* Find the separate debug file for OBJFILE, by using the build-id
     associated with OBJFILE's BFD.  If successful, returns the file name for the
-@@ -58,7 +64,8 @@ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len,
+@@ -58,7 +63,8 @@ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len,
     will be printed.  */
  
  extern std::string find_separate_debug_file_by_buildid
@@ -1503,12 +1473,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
  /* Issue a message saying we have no core to debug, if FROM_TTY.  */
  
  static void
-@@ -563,12 +569,14 @@ rename_vmcore_idle_reg_sections (bfd *abfd, inferior *inf)
- static void
- locate_exec_from_corefile_build_id (bfd *abfd, int from_tty)
- {
--  const bfd_build_id *build_id = build_id_bfd_get (abfd);
-+  const bfd_build_id *build_id = build_id_bfd_shdr_get (abfd);
+@@ -567,8 +573,10 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty)
    if (build_id == nullptr)
      return;
  
@@ -1548,7 +1513,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
 --- a/gdb/doc/gdb.texinfo
 +++ b/gdb/doc/gdb.texinfo
-@@ -22296,6 +22296,27 @@ information files.
+@@ -22296,6 +22296,27 @@
  
  @end table
  
@@ -1576,49 +1541,6 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
  @cindex @code{.gnu_debuglink} sections
  @cindex debug link sections
  A debug link is a special section of the executable file named
-diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
---- a/gdb/dwarf2/index-cache.c
-+++ b/gdb/dwarf2/index-cache.c
-@@ -96,7 +96,7 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic,
-     return;
- 
-   /* Get build id of objfile.  */
--  const bfd_build_id *build_id = build_id_bfd_get (per_bfd->obfd);
-+  const bfd_build_id *build_id = build_id_bfd_shdr_get (per_bfd->obfd);
-   if (build_id == nullptr)
-     {
-       index_cache_debug ("objfile %s has no build id",
-@@ -111,7 +111,8 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic,
- 
-   if (dwz != nullptr)
-     {
--      const bfd_build_id *dwz_build_id = build_id_bfd_get (dwz->dwz_bfd.get ());
-+      const bfd_build_id *dwz_build_id
-+	= build_id_bfd_shdr_get (dwz->dwz_bfd.get ());
- 
-       if (dwz_build_id == nullptr)
- 	{
-diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
---- a/gdb/dwarf2/read.c
-+++ b/gdb/dwarf2/read.c
-@@ -3355,7 +3355,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
- static gdb::array_view<const gdb_byte>
- get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
- {
--  const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ());
-+  const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd.get ());
-   if (build_id == nullptr)
-     return {};
- 
-@@ -3368,7 +3368,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
- static gdb::array_view<const gdb_byte>
- get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
- {
--  const bfd_build_id *build_id = build_id_bfd_get (dwz->dwz_bfd.get ());
-+  const bfd_build_id *build_id = build_id_bfd_shdr_get (dwz->dwz_bfd.get ());
-   if (build_id == nullptr)
-     return {};
- 
 diff --git a/gdb/elfread.c b/gdb/elfread.c
 --- a/gdb/elfread.c
 +++ b/gdb/elfread.c
@@ -1634,15 +1556,6 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
  
        if (debugfile.empty ())
  	debugfile = find_separate_debug_file_by_debuglink (objfile, &warnings);
-@@ -1239,7 +1241,7 @@ elf_symfile_read_dwarf2 (struct objfile *objfile,
- 	{
- 	  has_dwarf2 = false;
- 	  const struct bfd_build_id *build_id
--	    = build_id_bfd_get (objfile->obfd.get ());
-+	    = build_id_bfd_shdr_get (objfile->obfd.get ());
- 	  const char *filename = bfd_get_filename (objfile->obfd.get ());
- 
- 	  if (build_id != nullptr)
 @@ -1265,6 +1267,11 @@ elf_symfile_read_dwarf2 (struct objfile *objfile,
  		      has_dwarf2 = true;
  		    }
@@ -1655,27 +1568,6 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
  	    }
  	}
        /* If all the methods to collect the debuginfo failed, print the
-diff --git a/gdb/exec.c b/gdb/exec.c
---- a/gdb/exec.c
-+++ b/gdb/exec.c
-@@ -237,7 +237,7 @@ validate_exec_file (int from_tty)
-   current_exec_file = get_exec_file (0);
- 
-   const bfd_build_id *exec_file_build_id
--    = build_id_bfd_get (current_program_space->exec_bfd ());
-+    = build_id_bfd_shdr_get (current_program_space->exec_bfd ());
-   if (exec_file_build_id != nullptr)
-     {
-       /* Prepend the target prefix, to force gdb_bfd_open to open the
-@@ -250,7 +250,7 @@ validate_exec_file (int from_tty)
-       if (abfd != nullptr)
- 	{
- 	  const bfd_build_id *target_exec_file_build_id
--	    = build_id_bfd_get (abfd.get ());
-+	    = build_id_bfd_shdr_get (abfd.get ());
- 
- 	  if (target_exec_file_build_id != nullptr)
- 	    {
 diff --git a/gdb/objfiles.h b/gdb/objfiles.h
 --- a/gdb/objfiles.h
 +++ b/gdb/objfiles.h
@@ -1690,27 +1582,6 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h
  /* A deleter for objfile.  */
  
  struct objfile_deleter
-diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
---- a/gdb/python/py-objfile.c
-+++ b/gdb/python/py-objfile.c
-@@ -158,7 +158,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
- 
-   try
-     {
--      build_id = build_id_bfd_get (objfile->obfd.get ());
-+      build_id = build_id_bfd_shdr_get (objfile->obfd.get ());
-     }
-   catch (const gdb_exception &except)
-     {
-@@ -629,7 +629,7 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
- 	   if (obfd == nullptr)
- 	     return 0;
- 
--	   const bfd_build_id *obfd_build_id = build_id_bfd_get (obfd);
-+	   const bfd_build_id *obfd_build_id = build_id_bfd_shdr_get (obfd);
- 	   if (obfd_build_id == nullptr)
- 	     return 0;
- 
 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
 --- a/gdb/solib-svr4.c
 +++ b/gdb/solib-svr4.c
@@ -1777,29 +1648,10 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
  
        /* If this entry has no name, or its name matches the name
  	 for the main executable, don't include it in the list.  */
-diff --git a/gdb/source.c b/gdb/source.c
---- a/gdb/source.c
-+++ b/gdb/source.c
-@@ -1167,7 +1167,7 @@ open_source_file (struct symtab *s)
- 	    }
- 
- 	  const struct bfd_build_id *build_id
--	    = build_id_bfd_get (ofp->obfd.get ());
-+	    = build_id_bfd_shdr_get (ofp->obfd.get ());
- 
- 	  /* Query debuginfod for the source file.  */
- 	  if (build_id != nullptr && !srcpath.empty ())
 diff --git a/gdb/symfile.h b/gdb/symfile.h
 --- a/gdb/symfile.h
 +++ b/gdb/symfile.h
-@@ -357,12 +357,18 @@ bool expand_symtabs_matching
- void map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
- 			   bool need_fullname);
- 
-+
- /* Target-agnostic function to load the sections of an executable into memory.
- 
-    ARGS should be in the form "EXECUTABLE [OFFSET]", where OFFSET is an
+@@ -363,6 +363,11 @@ void map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
     optional offset to apply to each section.  */
  extern void generic_load (const char *args, int from_tty);
  

diff --git a/gdb.spec b/gdb.spec
index af9f93b..65f720c 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -57,7 +57,7 @@ Version: 14.2
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 License: GPL-3.0-or-later AND BSD-3-Clause AND FSFAP AND LGPL-2.1-or-later AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain AND GFDL-1.3-or-later AND LGPL-2.0-or-later WITH GCC-exception-2.0 AND GPL-3.0-or-later WITH GCC-exception-3.1 AND GPL-2.0-or-later WITH GNU-compiler-exception
 # Do not provide URL for snapshots as the file lasts there only for 2 days.
@@ -1250,6 +1250,11 @@ fi
 %endif
 
 %changelog
+* Fri Mar  8 2024 Andrew Burgess <aburgess@redhat.com>
+- Reduce gdb-6.6-buildid-locate.patch by removing the build_id_bfd_get
+  to build_id_bfd_shdr_get change.  This was only changing the name of
+  a function, so seems pointless.
+
 * Wed Mar 6 2024 Alexandra Hájková <ahajkova@redhat.com> - 14.2-1
 - Rebase to FSF GDB 14.2.
 

                 reply	other threads:[~2026-06-28  0:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=178260489366.1.114487245412060706.rpms-gdb-e27fd6f38806@fedoraproject.org \
    --to=aburgess@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /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