Update gdb-6.6-buildid-locate.patch to fix RHBZ 2181221.

This commit is contained in:
Alexandra Hájková 2023-03-30 16:20:10 +02:00
parent 240ac8eb89
commit 5b461b9481
2 changed files with 24 additions and 16 deletions

View File

@ -561,7 +561,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
- if (separate_debug_file_debug) - if (separate_debug_file_debug)
- gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); - gdb_printf (gdb_stdlog, _(" no, unable to open.\n"));
+ struct stat statbuf_trash; + struct stat statbuf_trash;
+
- return {};
+ /* `access' automatically dereferences LINK. */ + /* `access' automatically dereferences LINK. */
+ if (lstat (link.c_str (), &statbuf_trash) != 0) + if (lstat (link.c_str (), &statbuf_trash) != 0)
+ { + {
@ -596,8 +597,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ { + {
+ if (separate_debug_file_debug) + if (separate_debug_file_debug)
+ gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); + gdb_printf (gdb_stdlog, _(" no, unable to open.\n"));
+
- return {};
+ continue; + continue;
+ } + }
+ +
@ -628,13 +628,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ /* If none of the real files is found report as missing file + /* If none of the real files is found report as missing file
+ always the non-.%u-suffixed file. */ + always the non-.%u-suffixed file. */
+ std::string link0 = orig_link; + std::string link0 = orig_link;
+
- return {};
+ /* If the symlink has target request to install the target. + /* If the symlink has target request to install the target.
+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing. + BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */ + https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
+ std::string link0_resolved (link_resolve (link0.c_str (), 0)); + std::string link0_resolved (link_resolve (link0.c_str (), 0));
+
- return {};
+ if (link_all.empty ()) + if (link_all.empty ())
+ link_all = link0_resolved; + link_all = link0_resolved;
+ else + else
@ -703,7 +703,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (debug_bfd != NULL) if (debug_bfd != NULL)
return debug_bfd; return debug_bfd;
} }
@@ -183,30 +687,655 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, @@ -183,30 +687,660 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
return {}; return {};
} }
@ -1313,15 +1313,20 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ already requires its own separate lines. */ + already requires its own separate lines. */
+ +
+ gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog,
+ _("Missing separate debuginfo for %s\n"), binary); + _("Missing separate debuginfo for %s.\n"), binary);
+ if (debug != NULL) + if (debug != NULL)
+ gdb_printf (gdb_stdlog, _("Try: %s %s\n"), + {
+ if (access (debug, F_OK) == 0) {
+ gdb_printf (gdb_stdlog, _("Try: %s %s\n"),
+#ifdef DNF_DEBUGINFO_INSTALL +#ifdef DNF_DEBUGINFO_INSTALL
+ "dnf" + "dnf"
+#else +#else
+ "yum" + "yum"
+#endif +#endif
+ " --enablerepo='*debug*' install", debug); + " --enablerepo='*debug*' install", debug);
+ } else
+ gdb_printf (gdb_stdlog, _("The debuginfo package for this file is probably broken.\n"));
+ }
+ } + }
+} +}
+ +
@ -1365,7 +1370,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (build_id != NULL) if (build_id != NULL)
{ {
if (separate_debug_file_debug) if (separate_debug_file_debug)
@@ -214,8 +1343,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) @@ -214,8 +1348,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
_("\nLooking for separate debug info (build-id) for " _("\nLooking for separate debug info (build-id) for "
"%s\n"), objfile_name (objfile)); "%s\n"), objfile_name (objfile));
@ -1388,7 +1393,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */ /* Prevent looping on a stripped .debug file. */
if (abfd != NULL if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd.get ()), && filename_cmp (bfd_get_filename (abfd.get ()),
@@ -228,3 +1370,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) @@ -228,3 +1375,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
return std::string (); return std::string ();
} }

View File

@ -57,7 +57,7 @@ Version: 13.1
# The release always contains a leading reserved number, start it at 1. # 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. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
# Do not provide URL for snapshots as the file lasts there only for 2 days. # Do not provide URL for snapshots as the file lasts there only for 2 days.
@ -1244,6 +1244,9 @@ fi
%endif %endif
%changelog %changelog
* Thu Mar 30 2023 Alexandra Hájková <ahajkova@redhat.com> - 12.1-3
- Update gdb-6.6-buildid-locate.patch to fix RHBZ 2181221.
* Wed Mar 29 2023 Andrew Burgess <aburgess@redhat.com> * Wed Mar 29 2023 Andrew Burgess <aburgess@redhat.com>
- Used --with-pkgversion to place the distribution name in the version - Used --with-pkgversion to place the distribution name in the version
string rather than placing the string directly into the version.in string rather than placing the string directly into the version.in