]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.6-buildid-locate-rpm-scl.patch
updated source url to https
[packages/gdb.git] / gdb-6.6-buildid-locate-rpm-scl.patch
CommitLineData
4b0e5c1b
AM
1From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
2From: Fedora GDB patches <invalid@email.com>
3Date: Fri, 27 Oct 2017 21:07:50 +0200
4Subject: gdb-6.6-buildid-locate-rpm-scl.patch
5
4b0e5c1b
AM
6;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
7;;=push+jan
8
140f8057
JR
9warning: Skipping deprecated .gdb_index section
10https://bugzilla.redhat.com/show_bug.cgi?id=953585
11
4b0e5c1b 12diff --git a/gdb/build-id.c b/gdb/build-id.c
4b0e5c1b
AM
13--- a/gdb/build-id.c
14+++ b/gdb/build-id.c
e28f2cc1 15@@ -743,7 +743,11 @@ static int missing_rpm_list_entries;
140f8057
JR
16 /* Returns the count of newly added rpms. */
17
18 static int
19+#ifndef GDB_INDEX_VERIFY_VENDOR
20 missing_rpm_enlist (const char *filename)
21+#else
22+missing_rpm_enlist_1 (const char *filename, int verify_vendor)
23+#endif
24 {
25 static int rpm_init_done = 0;
26 rpmts ts;
e28f2cc1 27@@ -850,7 +854,11 @@ missing_rpm_enlist (const char *filename)
140f8057
JR
28 mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
29 if (mi != NULL)
30 {
31+#ifndef GDB_INDEX_VERIFY_VENDOR
32 for (;;)
33+#else
34+ if (!verify_vendor) for (;;)
35+#endif
36 {
37 Header h;
38 char *debuginfo, **slot, *s, *s2;
e28f2cc1 39@@ -968,6 +976,37 @@ missing_rpm_enlist (const char *filename)
140f8057
JR
40 xfree (debuginfo);
41 count++;
42 }
43+#ifdef GDB_INDEX_VERIFY_VENDOR
44+ else /* verify_vendor */
45+ {
46+ int vendor_pass = 0, vendor_fail = 0;
47+
48+ for (;;)
49+ {
50+ Header h;
51+ errmsg_t err;
52+ char *vendor;
53+
54+ h = rpmdbNextIterator_p (mi);
55+ if (h == NULL)
56+ break;
57+
58+ vendor = headerFormat_p (h, "%{vendor}", &err);
59+ if (!vendor)
60+ {
61+ warning (_("Error querying the rpm file `%s': %s"), filename,
62+ err);
63+ continue;
64+ }
65+ if (strcmp (vendor, "Red Hat, Inc.") == 0)
66+ vendor_pass = 1;
67+ else
68+ vendor_fail = 1;
69+ xfree (vendor);
70+ }
71+ count = vendor_pass != 0 && vendor_fail == 0;
72+ }
73+#endif
74
75 rpmdbFreeIterator_p (mi);
76 }
e28f2cc1
AM
77@@ -977,6 +1016,20 @@ missing_rpm_enlist (const char *filename)
78 return count;
140f8057
JR
79 }
80
140f8057
JR
81+#ifdef GDB_INDEX_VERIFY_VENDOR
82+missing_rpm_enlist (const char *filename)
83+{
84+ return missing_rpm_enlist_1 (filename, 0);
85+}
86+
87+extern int rpm_verify_vendor (const char *filename);
88+int
89+rpm_verify_vendor (const char *filename)
90+{
91+ return missing_rpm_enlist_1 (filename, 1);
92+}
140f8057 93+#endif
e28f2cc1
AM
94+
95 static bool
96 missing_rpm_list_compar (const char *ap, const char *bp)
140f8057 97 {
4b0e5c1b 98diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
4b0e5c1b
AM
99--- a/gdb/dwarf2read.c
100+++ b/gdb/dwarf2read.c
e28f2cc1 101@@ -3497,6 +3497,16 @@ read_gdb_index_from_buffer (struct objfile *objfile,
140f8057
JR
102 "set use-deprecated-index-sections on". */
103 if (version < 6 && !deprecated_ok)
104 {
105+#ifdef GDB_INDEX_VERIFY_VENDOR
106+ extern int rpm_verify_vendor (const char *filename);
107+
108+ /* Red Hat Developer Toolset exception. */
109+ if (rpm_verify_vendor (filename))
110+ {}
111+ else
112+ {
113+
114+#endif
115 static int warning_printed = 0;
116 if (!warning_printed)
117 {
e28f2cc1 118@@ -3508,6 +3518,10 @@ to use the section anyway."),
140f8057
JR
119 warning_printed = 1;
120 }
121 return 0;
122+#ifdef GDB_INDEX_VERIFY_VENDOR
123+
124+ }
125+#endif
126 }
127 /* Version 7 indices generated by gold refer to the CU for a symbol instead
128 of the TU (for symbols coming from TUs),
This page took 0.06649 seconds and 4 git commands to generate.