2020-07-23 12:21:48 +00:00
|
|
|
Index: gdb-9.1/gdb/build-id.c
|
2009-05-07 15:40:45 +00:00
|
|
|
===================================================================
|
2020-07-23 12:21:48 +00:00
|
|
|
--- gdb-9.1.orig/gdb/build-id.c
|
|
|
|
+++ gdb-9.1/gdb/build-id.c
|
|
|
|
@@ -861,19 +861,17 @@ missing_rpm_enlist_1 (const char *filena
|
|
|
|
#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);
|
2012-06-16 04:55:29 +00:00
|
|
|
if (h == NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
- /* 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)
|
|
|
|
{
|
2020-07-23 12:21:48 +00:00
|
|
|
@@ -881,60 +879,19 @@ missing_rpm_enlist_1 (const char *filena
|
2012-06-16 04:55:29 +00:00
|
|
|
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}' */
|
2017-02-15 16:05:56 +00:00
|
|
|
- s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
|
2012-06-16 04:55:29 +00:00
|
|
|
- }
|
|
|
|
- if (s2)
|
|
|
|
- {
|
|
|
|
- /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
|
2017-02-15 16:05:56 +00:00
|
|
|
- s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
|
2012-06-16 04:55:29 +00:00
|
|
|
- }
|
|
|
|
- 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(). */
|
2017-02-15 16:05:56 +00:00
|
|
|
mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
|
2012-06-16 04:55:29 +00:00
|
|
|
- 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
|
2013-09-11 13:42:29 +00:00
|
|
|
yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
|
2020-07-23 12:21:48 +00:00
|
|
|
@@ -1076,10 +1033,7 @@ missing_rpm_list_print (void)
|
|
|
|
missing_rpm_list_entries = 0;
|
2012-06-16 04:55:29 +00:00
|
|
|
|
|
|
|
printf_unfiltered (_("Missing separate debuginfos, use: %s"),
|
2015-07-10 14:22:52 +00:00
|
|
|
-#ifdef DNF_DEBUGINFO_INSTALL
|
|
|
|
- "dnf "
|
|
|
|
-#endif
|
2012-06-16 04:55:29 +00:00
|
|
|
- "debuginfo-install");
|
|
|
|
+ "zypper install");
|
2020-07-23 12:21:48 +00:00
|
|
|
for (const char *el : array)
|
2012-06-16 04:55:29 +00:00
|
|
|
{
|
2020-07-23 12:21:48 +00:00
|
|
|
puts_unfiltered (" ");
|
|
|
|
@@ -1287,13 +1241,12 @@ debug_print_missing (const char *binary,
|
2012-06-16 04:55:29 +00:00
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
_("Missing separate debuginfo for %s\n"), binary);
|
|
|
|
if (debug != NULL)
|
|
|
|
- fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
|
2016-01-14 17:05:52 +00:00
|
|
|
-#ifdef DNF_DEBUGINFO_INSTALL
|
|
|
|
- "dnf"
|
|
|
|
-#else
|
|
|
|
- "yum"
|
|
|
|
-#endif
|
|
|
|
- " --enablerepo='*debug*' install", debug);
|
2012-06-16 04:55:29 +00:00
|
|
|
+ {
|
|
|
|
+ const char *p = strrchr (debug, '/');
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"),
|
|
|
|
+ "zypper install -C \"debuginfo(build-id)=",
|
|
|
|
+ p - 2, p + 1);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|