]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-6.8-bz466901-backtrace-full-prelinked.patch
- updated (performance fixes).
[packages/gdb.git] / gdb-6.8-bz466901-backtrace-full-prelinked.patch
1 Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
2
3 Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
4 ===================================================================
5 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6 +++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp      2009-09-09 20:10:35.000000000 +0200
7 @@ -0,0 +1,102 @@
8 +# Copyright 2008 Free Software Foundation, Inc.
9 +
10 +# This program is free software; you can redistribute it and/or modify
11 +# it under the terms of the GNU General Public License as published by
12 +# the Free Software Foundation; either version 2 of the License, or
13 +# (at your option) any later version.
14 +# 
15 +# This program is distributed in the hope that it will be useful,
16 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
17 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 +# GNU General Public License for more details.
19 +# 
20 +# You should have received a copy of the GNU General Public License
21 +# along with this program; if not, write to the Free Software
22 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 +
24 +# Minimal DWARF-2 unit test
25 +
26 +# This test can only be run on i386/x86_64 targets which support DWARF-2.
27 +# For now pick a sampling of likely targets.
28 +if {(![istarget *-*-linux*]
29 +     && ![istarget *-*-gnu*]
30 +     && ![istarget *-*-elf*]
31 +     && ![istarget *-*-openbsd*])
32 +    || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
33 +    return 0  
34 +}
35 +
36 +set testfile "dw2-loclist-prelinked"
37 +set srcfuncfile ${testfile}-func.S
38 +set binsharedfuncfile ${objdir}/${subdir}/${testfile}.so
39 +set srcmainfile ${testfile}-main.c
40 +set binfile ${objdir}/${subdir}/${testfile}
41 +
42 +remote_exec build "rm -f ${binfile}"
43 +
44 +# get the value of gcc_compiled
45 +if [get_compiler_info ${binfile}] {
46 +    return -1
47 +}
48 +
49 +# This test can only be run on gcc as we use additional_flags=FIXME
50 +if {$gcc_compiled == 0} {
51 +    return 0
52 +}
53 +
54 +if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfuncfile}" "${binsharedfuncfile}" {debug additional_flags=-m32}] != "" } {
55 +    untested "Couldn't compile test library"
56 +    return -1
57 +}
58 +
59 +# The new separate debug info file will be stored in the .debug subdirectory.
60 +
61 +if [gdb_gnu_strip_debug ${binsharedfuncfile}] {
62 +    # check that you have a recent version of strip and objcopy installed
63 +    unsupported "cannot produce separate debug info files"
64 +    return -1
65 +}
66 +
67 +if {[catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${binsharedfuncfile}\""] != 0} {
68 +    # Maybe we don't have prelink.
69 +    return -1
70 +}
71 +
72 +if  { [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" \
73 +                  "${binfile}" executable [list debug additional_flags=-m32 shlib=${binsharedfuncfile}]] != "" } {
74 +    return -1
75 +}
76 +
77 +gdb_exit
78 +gdb_start
79 +gdb_reinitialize_dir $srcdir/$subdir
80 +gdb_load ${binfile}
81 +
82 +gdb_run_cmd
83 +
84 +gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
85 +
86 +# Incorrect:
87 +# #0  0x00110430 in __kernel_vsyscall ()
88 +# No symbol table info available.
89 +# #1  0x003d44c0 in raise () from /lib/libc.so.6
90 +# No symbol table info available.
91 +# #2  0x003d5e88 in abort () from /lib/libc.so.6
92 +# No symbol table info available.
93 +# #3  0x44f10437 in func () at dw2-loclist-prelinked.c:8
94 +#      i = Could not find the frame base for "func".
95 +
96 +# Correct:
97 +# #0  0x00110430 in __kernel_vsyscall ()
98 +# No symbol table info available.
99 +# #1  0x003d44c0 in raise () from /lib/libc.so.6
100 +# No symbol table info available.
101 +# #2  0x003d5e88 in abort () from /lib/libc.so.6
102 +# No symbol table info available.
103 +# #3  0x4ae36437 in func () at dw2-loclist-prelinked.c:8
104 +#      i = 3827288
105 +# #4  0x0804851a in main () at ../../../gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c:24
106 +# No locals.
107 +
108 +# `abort' can get expressed as `*__GI_abort'.
109 +gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()"
110 Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
111 ===================================================================
112 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
113 +++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c   2009-09-09 20:10:35.000000000 +0200
114 @@ -0,0 +1,26 @@
115 +/* This testcase is part of GDB, the GNU debugger.
116 +
117 +   Copyright 2008 Free Software Foundation, Inc.
118 +
119 +   This program is free software; you can redistribute it and/or modify
120 +   it under the terms of the GNU General Public License as published by
121 +   the Free Software Foundation; either version 3 of the License, or
122 +   (at your option) any later version.
123 +
124 +   This program is distributed in the hope that it will be useful,
125 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
126 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
127 +   GNU General Public License for more details.
128 +
129 +   You should have received a copy of the GNU General Public License
130 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
131 +
132 +/* dw2-loclist-prelinked-func.S */
133 +extern void func (void);
134 +
135 +int
136 +main (void)
137 +{
138 +  func ();
139 +  return 0;
140 +}
141 Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
142 ===================================================================
143 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
144 +++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S   2009-09-09 20:10:35.000000000 +0200
145 @@ -0,0 +1,328 @@
146 +/* This testcase is part of GDB, the GNU debugger.
147 +
148 +   Copyright 2008 Free Software Foundation, Inc.
149 +
150 +   This program is free software; you can redistribute it and/or modify
151 +   it under the terms of the GNU General Public License as published by
152 +   the Free Software Foundation; either version 3 of the License, or
153 +   (at your option) any later version.
154 +
155 +   This program is distributed in the hope that it will be useful,
156 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
157 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
158 +   GNU General Public License for more details.
159 +
160 +   You should have received a copy of the GNU General Public License
161 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
162 +
163 +/*
164 +#include <stdlib.h>
165 +
166 +void
167 +func (void)
168 +{
169 +  int i;
170 +
171 +  abort ();
172 +}
173 +*/
174 +       .file   "dw2-loclist-prelinked.c"
175 +       .section        .debug_abbrev,"",@progbits
176 +.Ldebug_abbrev0:
177 +       .section        .debug_info,"",@progbits
178 +.Ldebug_info0:
179 +       .section        .debug_line,"",@progbits
180 +.Ldebug_line0:
181 +       .text
182 +.Ltext0:
183 +.globl func
184 +       .type   func, @function
185 +func:
186 +.LFB2:
187 +       .file 1 "dw2-loclist-prelinked.c"
188 +       .loc 1 5 0
189 +       pushl   %ebp
190 +.LCFI0:
191 +       movl    %esp, %ebp
192 +.LCFI1:
193 +       subl    $24, %esp
194 +.LCFI2:
195 +       .loc 1 8 0
196 +       call    abort
197 +.LFE2:
198 +       .size   func, .-func
199 +       .section        .debug_frame,"",@progbits
200 +.Lframe0:
201 +       .long   .LECIE0-.LSCIE0
202 +.LSCIE0:
203 +       .long   0xffffffff
204 +       .byte   0x1
205 +       .string ""
206 +       .uleb128 0x1
207 +       .sleb128 -4
208 +       .byte   0x8
209 +       .byte   0xc
210 +       .uleb128 0x4
211 +       .uleb128 0x4
212 +       .byte   0x88
213 +       .uleb128 0x1
214 +       .align 4
215 +.LECIE0:
216 +.LSFDE0:
217 +       .long   .LEFDE0-.LASFDE0
218 +.LASFDE0:
219 +       .long   .Lframe0
220 +       .long   .LFB2
221 +       .long   .LFE2-.LFB2
222 +       .byte   0x4
223 +       .long   .LCFI0-.LFB2
224 +       .byte   0xe
225 +       .uleb128 0x8
226 +       .byte   0x85
227 +       .uleb128 0x2
228 +       .byte   0x4
229 +       .long   .LCFI1-.LCFI0
230 +       .byte   0xd
231 +       .uleb128 0x5
232 +       .align 4
233 +.LEFDE0:
234 +       .text
235 +.Letext0:
236 +       .section        .debug_loc,"",@progbits
237 +.Ldebug_loc0:
238 +.LLST0:
239 +       .long   .LFB2-.Ltext0
240 +       .long   .LCFI0-.Ltext0
241 +       .value  0x2
242 +       .byte   0x74
243 +       .sleb128 4
244 +       .long   .LCFI0-.Ltext0
245 +       .long   .LCFI1-.Ltext0
246 +       .value  0x2
247 +       .byte   0x74
248 +       .sleb128 8
249 +       .long   .LCFI1-.Ltext0
250 +       .long   .LFE2-.Ltext0
251 +       .value  0x2
252 +       .byte   0x75
253 +       .sleb128 8
254 +       .long   0x0
255 +       .long   0x0
256 +       .section        .debug_info
257 +       .long   0x94
258 +       .value  0x2
259 +       .long   .Ldebug_abbrev0
260 +       .byte   0x4
261 +       .uleb128 0x1
262 +       .long   .LASF10
263 +       .byte   0x1
264 +       .long   .LASF11
265 +       .long   .LASF12
266 +       .long   .Ltext0
267 +       .long   .Letext0
268 +       .long   .Ldebug_line0
269 +       .uleb128 0x2
270 +       .byte   0x4
271 +       .byte   0x7
272 +       .long   .LASF0
273 +       .uleb128 0x3
274 +       .byte   0x4
275 +       .byte   0x5
276 +       .string "int"
277 +       .uleb128 0x2
278 +       .byte   0x4
279 +       .byte   0x5
280 +       .long   .LASF1
281 +       .uleb128 0x2
282 +       .byte   0x1
283 +       .byte   0x8
284 +       .long   .LASF2
285 +       .uleb128 0x2
286 +       .byte   0x2
287 +       .byte   0x7
288 +       .long   .LASF3
289 +       .uleb128 0x2
290 +       .byte   0x4
291 +       .byte   0x7
292 +       .long   .LASF4
293 +       .uleb128 0x2
294 +       .byte   0x1
295 +       .byte   0x6
296 +       .long   .LASF5
297 +       .uleb128 0x2
298 +       .byte   0x2
299 +       .byte   0x5
300 +       .long   .LASF6
301 +       .uleb128 0x2
302 +       .byte   0x8
303 +       .byte   0x5
304 +       .long   .LASF7
305 +       .uleb128 0x2
306 +       .byte   0x8
307 +       .byte   0x7
308 +       .long   .LASF8
309 +       .uleb128 0x4
310 +       .byte   0x4
311 +       .byte   0x7
312 +       .uleb128 0x2
313 +       .byte   0x1
314 +       .byte   0x6
315 +       .long   .LASF9
316 +       .uleb128 0x5
317 +       .byte   0x1
318 +       .long   .LASF13
319 +       .byte   0x1
320 +       .byte   0x5
321 +       .byte   0x1
322 +       .long   .LFB2
323 +       .long   .LFE2
324 +       .long   .LLST0
325 +       .uleb128 0x6
326 +       .string "i"
327 +       .byte   0x1
328 +       .byte   0x6
329 +       .long   0x2c
330 +       .byte   0x2
331 +       .byte   0x91
332 +       .sleb128 -12
333 +       .byte   0x0
334 +       .byte   0x0
335 +       .section        .debug_abbrev
336 +       .uleb128 0x1
337 +       .uleb128 0x11
338 +       .byte   0x1
339 +       .uleb128 0x25
340 +       .uleb128 0xe
341 +       .uleb128 0x13
342 +       .uleb128 0xb
343 +       .uleb128 0x3
344 +       .uleb128 0xe
345 +       .uleb128 0x1b
346 +       .uleb128 0xe
347 +       .uleb128 0x11
348 +       .uleb128 0x1
349 +       .uleb128 0x12
350 +       .uleb128 0x1
351 +       .uleb128 0x10
352 +       .uleb128 0x6
353 +       .byte   0x0
354 +       .byte   0x0
355 +       .uleb128 0x2
356 +       .uleb128 0x24
357 +       .byte   0x0
358 +       .uleb128 0xb
359 +       .uleb128 0xb
360 +       .uleb128 0x3e
361 +       .uleb128 0xb
362 +       .uleb128 0x3
363 +       .uleb128 0xe
364 +       .byte   0x0
365 +       .byte   0x0
366 +       .uleb128 0x3
367 +       .uleb128 0x24
368 +       .byte   0x0
369 +       .uleb128 0xb
370 +       .uleb128 0xb
371 +       .uleb128 0x3e
372 +       .uleb128 0xb
373 +       .uleb128 0x3
374 +       .uleb128 0x8
375 +       .byte   0x0
376 +       .byte   0x0
377 +       .uleb128 0x4
378 +       .uleb128 0x24
379 +       .byte   0x0
380 +       .uleb128 0xb
381 +       .uleb128 0xb
382 +       .uleb128 0x3e
383 +       .uleb128 0xb
384 +       .byte   0x0
385 +       .byte   0x0
386 +       .uleb128 0x5
387 +       .uleb128 0x2e
388 +       .byte   0x1
389 +       .uleb128 0x3f
390 +       .uleb128 0xc
391 +       .uleb128 0x3
392 +       .uleb128 0xe
393 +       .uleb128 0x3a
394 +       .uleb128 0xb
395 +       .uleb128 0x3b
396 +       .uleb128 0xb
397 +       .uleb128 0x27
398 +       .uleb128 0xc
399 +       .uleb128 0x11
400 +       .uleb128 0x1
401 +       .uleb128 0x12
402 +       .uleb128 0x1
403 +       .uleb128 0x40
404 +       .uleb128 0x6
405 +       .byte   0x0
406 +       .byte   0x0
407 +       .uleb128 0x6
408 +       .uleb128 0x34
409 +       .byte   0x0
410 +       .uleb128 0x3
411 +       .uleb128 0x8
412 +       .uleb128 0x3a
413 +       .uleb128 0xb
414 +       .uleb128 0x3b
415 +       .uleb128 0xb
416 +       .uleb128 0x49
417 +       .uleb128 0x13
418 +       .uleb128 0x2
419 +       .uleb128 0xa
420 +       .byte   0x0
421 +       .byte   0x0
422 +       .byte   0x0
423 +       .section        .debug_pubnames,"",@progbits
424 +       .long   0x17
425 +       .value  0x2
426 +       .long   .Ldebug_info0
427 +       .long   0x98
428 +       .long   0x75
429 +       .string "func"
430 +       .long   0x0
431 +       .section        .debug_aranges,"",@progbits
432 +       .long   0x1c
433 +       .value  0x2
434 +       .long   .Ldebug_info0
435 +       .byte   0x4
436 +       .byte   0x0
437 +       .value  0x0
438 +       .value  0x0
439 +       .long   .Ltext0
440 +       .long   .Letext0-.Ltext0
441 +       .long   0x0
442 +       .long   0x0
443 +       .section        .debug_str,"MS",@progbits,1
444 +.LASF7:
445 +       .string "long long int"
446 +.LASF0:
447 +       .string "unsigned int"
448 +.LASF11:
449 +       .string "dw2-loclist-prelinked.c"
450 +.LASF12:
451 +       .string "gdb-6.8/gdb/testsuite/gdb.dwarf2"
452 +.LASF4:
453 +       .string "long unsigned int"
454 +.LASF8:
455 +       .string "long long unsigned int"
456 +.LASF2:
457 +       .string "unsigned char"
458 +.LASF9:
459 +       .string "char"
460 +.LASF1:
461 +       .string "long int"
462 +.LASF3:
463 +       .string "short unsigned int"
464 +.LASF5:
465 +       .string "signed char"
466 +.LASF10:
467 +       .string "GNU C 4.3.2 20081007 (Red Hat 4.3.2-6)"
468 +.LASF13:
469 +       .string "func"
470 +.LASF6:
471 +       .string "short int"
472 +       .ident  "GCC: (GNU) 4.3.2 20081007 (Red Hat 4.3.2-6)"
473 +       .section        .note.GNU-stack,"",@progbits
This page took 0.06586 seconds and 3 git commands to generate.