]>
Commit | Line | Data |
---|---|---|
4b0e5c1b AM |
1 | From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 |
2 | From: Fedora GDB patches <invalid@email.com> | |
3 | Date: Fri, 27 Oct 2017 21:07:50 +0200 | |
4 | Subject: 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 |
9 | warning: Skipping deprecated .gdb_index section |
10 | https://bugzilla.redhat.com/show_bug.cgi?id=953585 | |
11 | ||
4b0e5c1b | 12 | diff --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 | |
174fe25c | 15 | @@ -742,7 +742,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; | |
174fe25c | 27 | @@ -849,7 +853,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; | |
174fe25c | 39 | @@ -967,6 +975,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 | } | |
174fe25c | 77 | @@ -976,6 +1015,20 @@ missing_rpm_enlist (const char *filename) |
e28f2cc1 | 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 | { |
174fe25c JP |
98 | diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c |
99 | --- a/gdb/dwarf2/read.c | |
100 | +++ b/gdb/dwarf2/read.c | |
101 | @@ -3022,6 +3022,16 @@ read_gdb_index_from_buffer (const char *filename, | |
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 | { | |
174fe25c | 118 | @@ -3033,6 +3043,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), |