]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-upstream.patch
- updated (performance fixes).
[packages/gdb.git] / gdb-upstream.patch
1 FYI: fix possible crash in find_charset_names
2 http://sourceware.org/ml/gdb-patches/2012-02/msg00073.html
3 http://sourceware.org/ml/gdb-cvs/2012-02/msg00037.html
4 https://bugzilla.redhat.com/show_bug.cgi?id=786091
5
6 ### src/gdb/ChangeLog   2012/02/07 04:48:14     1.13810
7 ### src/gdb/ChangeLog   2012/02/07 15:42:33     1.13811
8 ## -1,3 +1,7 @@
9 +2012-02-07  Tom Tromey  <tromey@redhat.com>
10 +
11 +       * charset.c (find_charset_names): Check 'in' against NULL.
12 +
13  2012-02-06  Doug Evans  <dje@google.com>
14  
15         * gdbtypes.h (struct main_type): Change type of name,tag_name,
16 --- src/gdb/charset.c   2012/01/24 21:36:37     1.47
17 +++ src/gdb/charset.c   2012/02/07 15:42:39     1.48
18 @@ -839,7 +839,7 @@
19          parse the glibc and libiconv formats; feel free to add others
20          as needed.  */
21  
22 -      while (!feof (in))
23 +      while (in != NULL && !feof (in))
24         {
25           /* The size of buf is chosen arbitrarily.  */
26           char buf[1024];
27
28
29
30 http://sourceware.org/ml/gdb-patches/2012-02/msg00151.html
31 Subject: [patch] ppc-linux-nat.c: Fix gcc-4.7 aliasing warnings
32
33 Hi,
34
35 ppc-linux-nat.c: In function 'fetch_register':
36 ppc-linux-nat.c:598:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
37 ppc-linux-nat.c: In function 'store_register':
38 ppc-linux-nat.c:1078:8: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
39
40 gcc-4.7.0-0.10.fc17.ppc64
41
42 Probably clear, I looked at making it using union instead of memcpy but that
43 would be too ugly.
44
45 No regressions on ppc64-fedorarawhide-linux-gnu only for gdb.base/*.exp.
46
47 I will check it in.
48
49
50 Thanks,
51 Jan
52
53
54 gdb/
55 2012-02-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
56
57         * ppc-linux-nat.c (fetch_register, store_register): Fix GCC aliasing
58         compilation warning.
59
60 --- a/gdb/ppc-linux-nat.c
61 +++ b/gdb/ppc-linux-nat.c
62 @@ -593,9 +593,10 @@ fetch_register (struct regcache *regcache, int tid, int regno)
63         bytes_transferred < register_size (gdbarch, regno);
64         bytes_transferred += sizeof (long))
65      {
66 +      long l;
67 +
68        errno = 0;
69 -      *(long *) &buf[bytes_transferred]
70 -        = ptrace (PTRACE_PEEKUSER, tid, (PTRACE_TYPE_ARG3) regaddr, 0);
71 +      l = ptrace (PTRACE_PEEKUSER, tid, (PTRACE_TYPE_ARG3) regaddr, 0);
72        regaddr += sizeof (long);
73        if (errno != 0)
74         {
75 @@ -604,6 +605,7 @@ fetch_register (struct regcache *regcache, int tid, int regno)
76                    gdbarch_register_name (gdbarch, regno), regno);
77           perror_with_name (message);
78         }
79 +      memcpy (&buf[bytes_transferred], &l, sizeof (l));
80      }
81  
82    /* Now supply the register.  Keep in mind that the regcache's idea
83 @@ -1073,9 +1075,11 @@ store_register (const struct regcache *regcache, int tid, int regno)
84  
85    for (i = 0; i < bytes_to_transfer; i += sizeof (long))
86      {
87 +      long l;
88 +
89 +      memcpy (&l, &buf[i], sizeof (l));
90        errno = 0;
91 -      ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr,
92 -             *(long *) &buf[i]);
93 +      ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr, l);
94        regaddr += sizeof (long);
95  
96        if (errno == EIO 
97
98
99
100 http://sourceware.org/ml/gdb-patches/2012-02/msg00409.html
101 Subject: FYI: remove extraneous block from dw2_map_symtabs_matching_filename
102 http://sourceware.org/ml/gdb-cvs/2012-02/msg00117.html
103 commit 61d8161b33b1e7dbc80ba6f7a92500a1594da55c
104
105 ### src/gdb/ChangeLog   2012/02/20 09:42:34     1.13845
106 ### src/gdb/ChangeLog   2012/02/20 19:24:34     1.13846
107 ## -1,3 +1,8 @@
108 +2012-02-20  Tom Tromey  <tromey@redhat.com>
109 +
110 +       * dwarf2read.c (dw2_map_symtabs_matching_filename): Remove
111 +       extraneous block.
112 +
113  2012-02-20  Tristan Gingold  <gingold@adacore.com>
114  
115         * darwin-nat.h (enum darwin_msg_state): Add comments.
116 --- src/gdb/dwarf2read.c        2012/02/07 04:48:19     1.612
117 +++ src/gdb/dwarf2read.c        2012/02/20 19:24:39     1.613
118 @@ -2437,13 +2437,6 @@
119                 return 1;
120             }
121  
122 -           {
123 -             if (dw2_map_expand_apply (objfile, per_cu,
124 -                                       name, full_path, real_path,
125 -                                       callback, data))
126 -               return 1;
127 -           }
128 -
129           /* Before we invoke realpath, which can get expensive when many
130              files are involved, do a quick comparison of the basenames.  */
131           if (! basenames_may_differ
132
133
134
135 FYI: fix some performance bugs with .gdb_index
136 http://sourceware.org/ml/gdb-patches/2012-02/msg00413.html
137 http://sourceware.org/ml/gdb-cvs/2012-02/msg00119.html
138
139 ### src/gdb/ChangeLog   2012/02/20 19:44:00     1.13847
140 ### src/gdb/ChangeLog   2012/02/20 20:56:12     1.13848
141 ## -1,3 +1,10 @@
142 +2012-02-20  Tom Tromey  <tromey@redhat.com>
143 +
144 +       PR gdb/13498:
145 +       * dwarf2read.c (dw2_expand_symtabs_matching): Only visit a
146 +       particular set of file names once.
147 +       (dw2_map_symbol_filenames): Likewise.
148 +
149  2012-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
150  
151         Code cleanup.
152 --- src/gdb/dwarf2read.c        2012/02/20 19:24:39     1.613
153 +++ src/gdb/dwarf2read.c        2012/02/20 20:56:12     1.614
154 @@ -2700,32 +2700,63 @@
155    index = dwarf2_per_objfile->index_table;
156  
157    if (file_matcher != NULL)
158 -    for (i = 0; i < (dwarf2_per_objfile->n_comp_units
159 -                    + dwarf2_per_objfile->n_type_units); ++i)
160 -      {
161 -       int j;
162 -       struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
163 -       struct quick_file_names *file_data;
164 +    {
165 +      struct cleanup *cleanup;
166 +      htab_t visited_found, visited_not_found;
167  
168 -       per_cu->v.quick->mark = 0;
169 +      visited_found = htab_create_alloc (10,
170 +                                        htab_hash_pointer, htab_eq_pointer,
171 +                                        NULL, xcalloc, xfree);
172 +      cleanup = make_cleanup_htab_delete (visited_found);
173 +      visited_not_found = htab_create_alloc (10,
174 +                                            htab_hash_pointer, htab_eq_pointer,
175 +                                            NULL, xcalloc, xfree);
176 +      make_cleanup_htab_delete (visited_not_found);
177  
178 -       /* We only need to look at symtabs not already expanded.  */
179 -       if (per_cu->v.quick->symtab)
180 -         continue;
181 +      for (i = 0; i < (dwarf2_per_objfile->n_comp_units
182 +                      + dwarf2_per_objfile->n_type_units); ++i)
183 +       {
184 +         int j;
185 +         struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
186 +         struct quick_file_names *file_data;
187 +         void **slot;
188  
189 -       file_data = dw2_get_file_names (objfile, per_cu);
190 -       if (file_data == NULL)
191 -         continue;
192 +         per_cu->v.quick->mark = 0;
193  
194 -       for (j = 0; j < file_data->num_file_names; ++j)
195 -         {
196 -           if (file_matcher (file_data->file_names[j], data))
197 -             {
198 -               per_cu->v.quick->mark = 1;
199 -               break;
200 -             }
201 -         }
202 -      }
203 +         /* We only need to look at symtabs not already expanded.  */
204 +         if (per_cu->v.quick->symtab)
205 +           continue;
206 +
207 +         file_data = dw2_get_file_names (objfile, per_cu);
208 +         if (file_data == NULL)
209 +           continue;
210 +
211 +         if (htab_find (visited_not_found, file_data) != NULL)
212 +           continue;
213 +         else if (htab_find (visited_found, file_data) != NULL)
214 +           {
215 +             per_cu->v.quick->mark = 1;
216 +             continue;
217 +           }
218 +
219 +         for (j = 0; j < file_data->num_file_names; ++j)
220 +           {
221 +             if (file_matcher (file_data->file_names[j], data))
222 +               {
223 +                 per_cu->v.quick->mark = 1;
224 +                 break;
225 +               }
226 +           }
227 +
228 +         slot = htab_find_slot (per_cu->v.quick->mark
229 +                                ? visited_found
230 +                                : visited_not_found,
231 +                                file_data, INSERT);
232 +         *slot = file_data;
233 +       }
234 +
235 +      do_cleanups (cleanup);
236 +    }
237  
238    for (iter = 0; iter < index->symbol_table_slots; ++iter)
239      {
240 @@ -2787,15 +2818,35 @@
241                           void *data, int need_fullname)
242  {
243    int i;
244 +  struct cleanup *cleanup;
245 +  htab_t visited = htab_create_alloc (10, htab_hash_pointer, htab_eq_pointer,
246 +                                     NULL, xcalloc, xfree);
247  
248 +  cleanup = make_cleanup_htab_delete (visited);
249    dw2_setup (objfile);
250  
251 +  /* We can ignore file names coming from already-expanded CUs.  */
252 +  for (i = 0; i < (dwarf2_per_objfile->n_comp_units
253 +                  + dwarf2_per_objfile->n_type_units); ++i)
254 +    {
255 +      struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
256 +
257 +      if (per_cu->v.quick->symtab)
258 +       {
259 +         void **slot = htab_find_slot (visited, per_cu->v.quick->file_names,
260 +                                       INSERT);
261 +
262 +         *slot = per_cu->v.quick->file_names;
263 +       }
264 +    }
265 +
266    for (i = 0; i < (dwarf2_per_objfile->n_comp_units
267                    + dwarf2_per_objfile->n_type_units); ++i)
268      {
269        int j;
270        struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
271        struct quick_file_names *file_data;
272 +      void **slot;
273  
274        /* We only need to look at symtabs not already expanded.  */
275        if (per_cu->v.quick->symtab)
276 @@ -2805,6 +2856,14 @@
277        if (file_data == NULL)
278         continue;
279  
280 +      slot = htab_find_slot (visited, file_data, INSERT);
281 +      if (*slot)
282 +       {
283 +         /* Already visited.  */
284 +         continue;
285 +       }
286 +      *slot = file_data;
287 +
288        for (j = 0; j < file_data->num_file_names; ++j)
289         {
290           const char *this_real_name;
291 @@ -2816,6 +2875,8 @@
292           (*fun) (file_data->file_names[j], this_real_name, data);
293         }
294      }
295 +
296 +  do_cleanups (cleanup);
297  }
298  
299  static int
This page took 0.072442 seconds and 3 git commands to generate.