]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.6-buildid-locate-rpm-scl.patch
- up to 8.3
[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
77d10998 15@@ -746,7 +746,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;
77d10998 27@@ -853,7 +857,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;
77d10998 39@@ -971,6 +979,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 }
77d10998 77@@ -981,6 +1020,21 @@ missing_rpm_enlist (const char *filename)
140f8057
JR
78 }
79
80 static int
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+}
93+
94+static int
95+#endif
96 missing_rpm_list_compar (const char *const *ap, const char *const *bp)
97 {
98 return strcoll (*ap, *bp);
4b0e5c1b 99diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
4b0e5c1b
AM
100--- a/gdb/dwarf2read.c
101+++ b/gdb/dwarf2read.c
77d10998 102@@ -3501,6 +3501,16 @@ read_gdb_index_from_buffer (struct objfile *objfile,
140f8057
JR
103 "set use-deprecated-index-sections on". */
104 if (version < 6 && !deprecated_ok)
105 {
106+#ifdef GDB_INDEX_VERIFY_VENDOR
107+ extern int rpm_verify_vendor (const char *filename);
108+
109+ /* Red Hat Developer Toolset exception. */
110+ if (rpm_verify_vendor (filename))
111+ {}
112+ else
113+ {
114+
115+#endif
116 static int warning_printed = 0;
117 if (!warning_printed)
118 {
77d10998 119@@ -3512,6 +3522,10 @@ to use the section anyway."),
140f8057
JR
120 warning_printed = 1;
121 }
122 return 0;
123+#ifdef GDB_INDEX_VERIFY_VENDOR
124+
125+ }
126+#endif
127 }
128 /* Version 7 indices generated by gold refer to the CU for a symbol instead
129 of the TU (for symbols coming from TUs),
This page took 0.07802 seconds and 4 git commands to generate.