]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-6.6-buildid-locate-rpm-scl.patch
- up to 8.1
[packages/gdb.git] / gdb-6.6-buildid-locate-rpm-scl.patch
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
6 FileName: gdb-6.6-buildid-locate-rpm-scl.patch
7
8 ;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
9 ;;=push+jan
10
11 warning: Skipping deprecated .gdb_index section
12 https://bugzilla.redhat.com/show_bug.cgi?id=953585
13 ---
14  gdb/build-id.c   | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
15  gdb/dwarf2read.c | 14 ++++++++++++++
16  2 files changed, 68 insertions(+)
17
18 diff --git a/gdb/build-id.c b/gdb/build-id.c
19 index e2c1e81266..1b75530f91 100644
20 --- a/gdb/build-id.c
21 +++ b/gdb/build-id.c
22 @@ -715,7 +715,11 @@ static int missing_rpm_list_entries;
23  /* Returns the count of newly added rpms.  */
24  
25  static int
26 +#ifndef GDB_INDEX_VERIFY_VENDOR
27  missing_rpm_enlist (const char *filename)
28 +#else
29 +missing_rpm_enlist_1 (const char *filename, int verify_vendor)
30 +#endif
31  {
32    static int rpm_init_done = 0;
33    rpmts ts;
34 @@ -822,7 +826,11 @@ missing_rpm_enlist (const char *filename)
35    mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
36    if (mi != NULL)
37      {
38 +#ifndef GDB_INDEX_VERIFY_VENDOR
39        for (;;)
40 +#else
41 +      if (!verify_vendor) for (;;)
42 +#endif
43         {
44           Header h;
45           char *debuginfo, **slot, *s, *s2;
46 @@ -940,6 +948,37 @@ missing_rpm_enlist (const char *filename)
47             xfree (debuginfo);
48           count++;
49         }
50 +#ifdef GDB_INDEX_VERIFY_VENDOR
51 +      else /* verify_vendor */
52 +       {
53 +         int vendor_pass = 0, vendor_fail = 0;
54 +
55 +         for (;;)
56 +           {
57 +             Header h;
58 +             errmsg_t err;
59 +             char *vendor;
60 +
61 +             h = rpmdbNextIterator_p (mi);
62 +             if (h == NULL)
63 +               break;
64 +
65 +             vendor = headerFormat_p (h, "%{vendor}", &err);
66 +             if (!vendor)
67 +               {
68 +                 warning (_("Error querying the rpm file `%s': %s"), filename,
69 +                          err);
70 +                 continue;
71 +               }
72 +             if (strcmp (vendor, "Red Hat, Inc.") == 0)
73 +               vendor_pass = 1;
74 +             else
75 +               vendor_fail = 1;
76 +             xfree (vendor);
77 +           }
78 +         count = vendor_pass != 0 && vendor_fail == 0;
79 +       }
80 +#endif
81  
82        rpmdbFreeIterator_p (mi);
83      }
84 @@ -950,6 +989,21 @@ missing_rpm_enlist (const char *filename)
85  }
86  
87  static int
88 +#ifdef GDB_INDEX_VERIFY_VENDOR
89 +missing_rpm_enlist (const char *filename)
90 +{
91 +  return missing_rpm_enlist_1 (filename, 0);
92 +}
93 +
94 +extern int rpm_verify_vendor (const char *filename);
95 +int
96 +rpm_verify_vendor (const char *filename)
97 +{
98 +  return missing_rpm_enlist_1 (filename, 1);
99 +}
100 +
101 +static int
102 +#endif
103  missing_rpm_list_compar (const char *const *ap, const char *const *bp)
104  {
105    return strcoll (*ap, *bp);
106 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
107 index 2c972d5e74..64329af71e 100644
108 --- a/gdb/dwarf2read.c
109 +++ b/gdb/dwarf2read.c
110 @@ -3725,6 +3725,16 @@ read_index_from_section (struct objfile *objfile,
111       "set use-deprecated-index-sections on".  */
112    if (version < 6 && !deprecated_ok)
113      {
114 +#ifdef GDB_INDEX_VERIFY_VENDOR
115 +      extern int rpm_verify_vendor (const char *filename);
116 +
117 +      /* Red Hat Developer Toolset exception.  */
118 +      if (rpm_verify_vendor (filename))
119 +       {}
120 +      else
121 +      {
122 +
123 +#endif
124        static int warning_printed = 0;
125        if (!warning_printed)
126         {
127 @@ -3736,6 +3746,10 @@ to use the section anyway."),
128           warning_printed = 1;
129         }
130        return 0;
131 +#ifdef GDB_INDEX_VERIFY_VENDOR
132 +
133 +      }
134 +#endif
135      }
136    /* Version 7 indices generated by gold refer to the CU for a symbol instead
137       of the TU (for symbols coming from TUs),
138 -- 
139 2.14.3
140
This page took 0.049493 seconds and 4 git commands to generate.