gdb/gdb-6.6-buildid-locate-rpm-suse.patch
Tom de Vries 4a53ebe1ed - Patch added (swo#31524, bsc#1222188):
* make-pascal_language-print_type-handle-varstring-nul.patch
- Renable gcc-fortran for SLE-11.
- Use system compiler (gcc 4.3.4) for testing all languages on
  SLE-11.
- Maintenance script qa.sh:
  * Ignore all fails for SLE-11.
- Maintenance script import-fedora.sh:
  * Use %patch -P N instead of deprecated %patchN.
  * Drop patch skips:
    * gdb-6.5-readline-long-line-crash-test.patch
    * gdb-6.7-charsign-test.patch
    * gdb-test-ivy-bridge.patch
    * gdb-ppc-power7-test.patch
    * gdb-6.3-bz140532-ppc-unwinding-test.patch
- Patches added (import from fedora rawhide @ a27201b):
  * gdb-bz2196395-debuginfod-legacy-openssl-crash.patch
  * gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
  * gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
  * gdb-rhbz-2232086-generate-gdb-index-consistently.patch
  * gdb-rhbz-2232086-reduce-size-of-gdb-index.patch
  * gdb-rhbz2232086-refactor-selftest-support.patch
- Patches updated (import from fedora rawhide @ a27201b):
  * gdb-6.6-buildid-locate-rpm.patch
  * gdb-6.6-buildid-locate.patch
  * gdb-fedora-libncursesw.patch
  * gdb-rhbz2233961-CVE-2022-4806.patch
  * gdb-rhbz2233965-memory-leak.patch
- Patches updated:  
  * gdb-6.6-buildid-locate-rpm-suse.patch
- Patches deleted (import from fedora rawhide @ a27201b):
  * gdb-rhbz1553104-s390x-arch12-test.patch
  * gdb-lineno-makeup-test.patch
  * gdb-6.3-bz202689-exec-from-pthread-test.patch
  * gdb-6.5-bz109921-DW_AT_decl_file-test.patch
  * gdb-6.5-ia64-libunwind-leak-test.patch
  * gdb-6.5-last-address-space-byte-test.patch
  * gdb-6.5-missed-trap-on-step-test.patch
  * gdb-6.5-sharedlibrary-path.patch
  * gdb-6.7-testsuite-stable-results.patch
  * gdb-6.8-bz442765-threaded-exec-test.patch
  * gdb-ccache-workaround.patch
  * gdb-opcodes-clflushopt-test.patch
  * gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
  * gdb-rhbz1350436-type-printers-error.patch
  * gdb-rhbz2196395-debuginfod-legacy-openssl-crash.patch
  * gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
  * gdb-test-pid0-core.patch
- Patches deleted:
  * fixup-gdb-rhbz1553104-s390x-arch12-test.patch
  * fixup-2-gdb-rhbz1553104-s390x-arch12-test.patch
  * fixup-gdb-lineno-makeup-test.patch
  * fixup-gdb-6.6-buildid-locate-rpm.patch
- Remove commented out mention of dropped patch
  gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=383
2024-04-24 09:31:51 +00:00

124 lines
4.1 KiB
Diff

diff --git a/gdb/build-id.c b/gdb/build-id.c
index 059a72fc050..58d73e70bad 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -863,10 +863,8 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor)
#endif
{
Header h;
- char *debuginfo, **slot, *s, *s2;
+ char *debuginfo, **slot;
errmsg_t err;
- size_t srcrpmlen = sizeof (".src.rpm") - 1;
- size_t debuginfolen = sizeof ("-debuginfo") - 1;
rpmdbMatchIterator mi_debuginfo;
h = rpmdbNextIterator_p (mi);
@@ -875,7 +873,9 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor)
/* Verify the debuginfo file is not already installed. */
- debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
+ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
+ debuginfo = headerFormat_p (h,
+ "%{name}-debuginfo-%{version}-%{release}.%{arch}",
&err);
if (!debuginfo)
{
@@ -883,60 +883,19 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor)
err);
continue;
}
- /* s = `.src.rpm-debuginfo.%{arch}' */
- s = strrchr (debuginfo, '-') - srcrpmlen;
- s2 = NULL;
- if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
- {
- /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
- s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
- }
- if (s2)
- {
- /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
- s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
- }
- if (!s2)
- {
- warning (_("Error querying the rpm file `%s': %s"), filename,
- debuginfo);
- xfree (debuginfo);
- continue;
- }
- /* s = `.src.rpm-debuginfo.%{arch}' */
- /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
- memmove (s2 + debuginfolen, s2, s - s2);
- memcpy (s2, "-debuginfo", debuginfolen);
- /* s = `XXXX.%{arch}' */
- /* strlen ("XXXX") == srcrpmlen + debuginfolen */
- /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
- /* strlen ("XX") == srcrpmlen */
- memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
- strlen (s + srcrpmlen + debuginfolen) + 1);
- /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
+ /* Verify the debuginfo file is not already installed. */
/* RPMDBI_PACKAGES requires keylen == sizeof (int). */
/* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0);
- xfree (debuginfo);
if (mi_debuginfo)
{
+ xfree (debuginfo);
rpmdbFreeIterator_p (mi_debuginfo);
count = 0;
break;
}
- /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
- debuginfo = headerFormat_p (h,
- "%{name}-%{version}-%{release}.%{arch}",
- &err);
- if (!debuginfo)
- {
- warning (_("Error querying the rpm file `%s': %s"), filename,
- err);
- continue;
- }
-
/* Base package name for `debuginfo-install'. We do not use the
`yum' command directly as the line
yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
@@ -1085,10 +1044,7 @@ missing_rpm_list_print (void)
missing_rpm_list_entries = 0;
gdb_printf (_("Missing separate debuginfos, use: %s"),
-#ifdef DNF_DEBUGINFO_INSTALL
- "dnf "
-#endif
- "debuginfo-install");
+ "zypper install");
for (const char *el : array)
{
gdb_printf (" %s", el);
@@ -1296,14 +1252,15 @@ debug_print_missing (const char *binary, const char *debug)
_("Missing separate debuginfo for %s.\n"), binary);
if (debug != NULL)
{
+#ifdef HAVE_LIBRPM
if (access (debug, F_OK) == 0) {
- gdb_printf (gdb_stdlog, _("Try: %s %s\n"),
-#ifdef DNF_DEBUGINFO_INSTALL
- "dnf"
#else
- "yum"
+ if (1) {
#endif
- " --enablerepo='*debug*' install", debug);
+ const char *p = strrchr (debug, '/');
+ gdb_printf (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"),
+ "zypper install -C \"debuginfo(build-id)=",
+ p - 2, p + 1);
} else
gdb_printf (gdb_stdlog, _("The debuginfo package for this file is probably broken.\n"));
}