]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-upstream.patch
- updated (performance fixes).
[packages/gdb.git] / gdb-upstream.patch
CommitLineData
f412e1b4
PS
1FYI: fix possible crash in find_charset_names
2http://sourceware.org/ml/gdb-patches/2012-02/msg00073.html
3http://sourceware.org/ml/gdb-cvs/2012-02/msg00037.html
4https://bugzilla.redhat.com/show_bug.cgi?id=786091
51a5ef0f 5
f412e1b4
PS
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>
51a5ef0f 10+
f412e1b4 11+ * charset.c (find_charset_names): Check 'in' against NULL.
51a5ef0f 12+
f412e1b4 13 2012-02-06 Doug Evans <dje@google.com>
51a5ef0f 14
f412e1b4
PS
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. */
51a5ef0f 21
f412e1b4
PS
22- while (!feof (in))
23+ while (in != NULL && !feof (in))
24 {
25 /* The size of buf is chosen arbitrarily. */
26 char buf[1024];
51a5ef0f
PS
27
28
29
f412e1b4
PS
30http://sourceware.org/ml/gdb-patches/2012-02/msg00151.html
31Subject: [patch] ppc-linux-nat.c: Fix gcc-4.7 aliasing warnings
51a5ef0f 32
f412e1b4 33Hi,
51a5ef0f 34
f412e1b4
PS
35ppc-linux-nat.c: In function 'fetch_register':
36ppc-linux-nat.c:598:9: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
37ppc-linux-nat.c: In function 'store_register':
38ppc-linux-nat.c:1078:8: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
51a5ef0f 39
f412e1b4 40gcc-4.7.0-0.10.fc17.ppc64
51a5ef0f 41
f412e1b4
PS
42Probably clear, I looked at making it using union instead of memcpy but that
43would be too ugly.
51a5ef0f 44
f412e1b4 45No regressions on ppc64-fedorarawhide-linux-gnu only for gdb.base/*.exp.
51a5ef0f 46
f412e1b4 47I will check it in.
51a5ef0f 48
51a5ef0f 49
f412e1b4
PS
50Thanks,
51Jan
e5178960
PS
52
53
f412e1b4
PS
54gdb/
552012-02-09 Jan Kratochvil <jan.kratochvil@redhat.com>
e5178960 56
f412e1b4
PS
57 * ppc-linux-nat.c (fetch_register, store_register): Fix GCC aliasing
58 compilation warning.
e5178960 59
f412e1b4
PS
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))
e5178960 65 {
f412e1b4
PS
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);
e5178960 78 }
f412e1b4 79+ memcpy (&buf[bytes_transferred], &l, sizeof (l));
e5178960
PS
80 }
81
f412e1b4
PS
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)
e5178960 84
f412e1b4
PS
85 for (i = 0; i < bytes_to_transfer; i += sizeof (long))
86 {
87+ long l;
e5178960 88+
f412e1b4
PS
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);
e5178960 95
f412e1b4
PS
96 if (errno == EIO
97
36d511ae
PS
98
99
100http://sourceware.org/ml/gdb-patches/2012-02/msg00409.html
101Subject: FYI: remove extraneous block from dw2_map_symtabs_matching_filename
102http://sourceware.org/ml/gdb-cvs/2012-02/msg00117.html
103commit 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
135FYI: fix some performance bugs with .gdb_index
136http://sourceware.org/ml/gdb-patches/2012-02/msg00413.html
137http://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.162681 seconds and 4 git commands to generate.