]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.6-buildid-locate-rpm-scl.patch
- fix build on x32
[packages/gdb.git] / gdb-6.6-buildid-locate-rpm-scl.patch
CommitLineData
140f8057
JR
1warning: Skipping deprecated .gdb_index section
2https://bugzilla.redhat.com/show_bug.cgi?id=953585
3
4diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb/build-id.c
5--- gdb-7.10.50.20160106-orig/gdb/build-id.c 2016-01-09 14:40:39.420385241 +0100
6+++ gdb-7.10.50.20160106/gdb/build-id.c 2016-01-09 14:41:05.944549393 +0100
7@@ -713,7 +713,11 @@ static int missing_rpm_list_entries;
8 /* Returns the count of newly added rpms. */
9
10 static int
11+#ifndef GDB_INDEX_VERIFY_VENDOR
12 missing_rpm_enlist (const char *filename)
13+#else
14+missing_rpm_enlist_1 (const char *filename, int verify_vendor)
15+#endif
16 {
17 static int rpm_init_done = 0;
18 rpmts ts;
19@@ -817,7 +821,11 @@ missing_rpm_enlist (const char *filename
20 mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
21 if (mi != NULL)
22 {
23+#ifndef GDB_INDEX_VERIFY_VENDOR
24 for (;;)
25+#else
26+ if (!verify_vendor) for (;;)
27+#endif
28 {
29 Header h;
30 char *debuginfo, **slot, *s, *s2;
31@@ -935,6 +943,37 @@ missing_rpm_enlist (const char *filename
32 xfree (debuginfo);
33 count++;
34 }
35+#ifdef GDB_INDEX_VERIFY_VENDOR
36+ else /* verify_vendor */
37+ {
38+ int vendor_pass = 0, vendor_fail = 0;
39+
40+ for (;;)
41+ {
42+ Header h;
43+ errmsg_t err;
44+ char *vendor;
45+
46+ h = rpmdbNextIterator_p (mi);
47+ if (h == NULL)
48+ break;
49+
50+ vendor = headerFormat_p (h, "%{vendor}", &err);
51+ if (!vendor)
52+ {
53+ warning (_("Error querying the rpm file `%s': %s"), filename,
54+ err);
55+ continue;
56+ }
57+ if (strcmp (vendor, "Red Hat, Inc.") == 0)
58+ vendor_pass = 1;
59+ else
60+ vendor_fail = 1;
61+ xfree (vendor);
62+ }
63+ count = vendor_pass != 0 && vendor_fail == 0;
64+ }
65+#endif
66
67 rpmdbFreeIterator_p (mi);
68 }
69@@ -945,6 +984,21 @@ missing_rpm_enlist (const char *filename
70 }
71
72 static int
73+#ifdef GDB_INDEX_VERIFY_VENDOR
74+missing_rpm_enlist (const char *filename)
75+{
76+ return missing_rpm_enlist_1 (filename, 0);
77+}
78+
79+extern int rpm_verify_vendor (const char *filename);
80+int
81+rpm_verify_vendor (const char *filename)
82+{
83+ return missing_rpm_enlist_1 (filename, 1);
84+}
85+
86+static int
87+#endif
88 missing_rpm_list_compar (const char *const *ap, const char *const *bp)
89 {
90 return strcoll (*ap, *bp);
91diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/gdb/dwarf2read.c
92--- gdb-7.10.50.20160106-orig/gdb/dwarf2read.c 2016-01-09 14:40:39.416385216 +0100
93+++ gdb-7.10.50.20160106/gdb/dwarf2read.c 2016-01-09 14:41:05.942549381 +0100
94@@ -3111,6 +3111,16 @@ read_index_from_section (struct objfile
95 "set use-deprecated-index-sections on". */
96 if (version < 6 && !deprecated_ok)
97 {
98+#ifdef GDB_INDEX_VERIFY_VENDOR
99+ extern int rpm_verify_vendor (const char *filename);
100+
101+ /* Red Hat Developer Toolset exception. */
102+ if (rpm_verify_vendor (filename))
103+ {}
104+ else
105+ {
106+
107+#endif
108 static int warning_printed = 0;
109 if (!warning_printed)
110 {
111@@ -3122,6 +3132,10 @@ to use the section anyway."),
112 warning_printed = 1;
113 }
114 return 0;
115+#ifdef GDB_INDEX_VERIFY_VENDOR
116+
117+ }
118+#endif
119 }
120 /* Version 7 indices generated by gold refer to the CU for a symbol instead
121 of the TU (for symbols coming from TUs),
This page took 0.031547 seconds and 4 git commands to generate.