- Update to fedora rawhide @ e27fd6f.

- Patches modified:
  * gdb-6.6-buildid-locate-rpm.patch
  * gdb-6.6-buildid-locate.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=407
This commit is contained in:
2025-01-23 09:12:33 +00:00
committed by Git OBS Bridge
parent 10596c59bb
commit e572ca82d0
3 changed files with 17 additions and 157 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Jan 23 09:07:47 UTC 2025 - Tom de Vries <tdevries@suse.com>
- Update to fedora rawhide @ e27fd6f.
- Patches modified:
* gdb-6.6-buildid-locate-rpm.patch
* gdb-6.6-buildid-locate.patch
-------------------------------------------------------------------
Thu Jan 23 08:11:26 UTC 2025 - Tom de Vries <tdevries@suse.com>