]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-prologue-not-skipped.patch
- updated (performance fixes).
[packages/gdb.git] / gdb-prologue-not-skipped.patch
1 http://sourceware.org/ml/gdb-patches/2012-02/msg00673.html
2 Subject: [patch] Fix regression by me for gcc-4.0...gcc-4.4 i386 -O2 -g parameters (PR 13777)
3
4 Hi,
5
6 http://sourceware.org/bugzilla/show_bug.cgi?id=13777
7
8 for CentOS-5 i386 ls:
9
10 $ gdb ls
11 (gdb) start
12 Temporary breakpoint 1, main (argc=Cannot access memory at address 0x81b7c7cd
13
14 instead of GDB before my PR 12573 fix/change:
15
16 Temporary breakpoint 1, main (argc=1, ...
17
18 I asked before on #gcc since which versions GCC produced DW_AT_location which
19 is for any PC either optimized-out or it has valid value.  I was told since
20 gcc-4.0.  But that is not true.
21
22 I have bisected gcc and I found 4.4.0 was still broken, 4.5.0 was correct,
23 thanks to:
24 commit 25e880b1917bd6bbf07e86b5574c698f3e9472d9
25 Author: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
26 Date:   Sat May 30 00:33:46 2009 +0000
27 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147995 138bc75d-0d04-0410-961f-82ee72b054a4
28 unwind info for epilogues
29
30 Curiously 4.4.x branch got later also fixed in this case by:
31 commit 61db8bd232daeed3751b43570fab16146145e096
32 Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
33 Date:   Tue Jun 2 07:18:16 2009 +0000
34 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_4-branch@148070 138bc75d-0d04-0410-961f-82ee72b054a4
35 (but that missed 4.4.0)
36
37 As 4.5.0 was first FSF GCC with VTA I was trusting more the validity only
38 after VTA and these heuristic results seems to confirm that.
39
40 I find the change below definitely safe.
41
42 Someone may object the original PR 12573 (do not try to skip prologue for -O2
43 -g code as it may cause more confusion than anything else) as while it fixed
44 some GDB crashes there is no such purpose anymore with Tom's
45 ambiguous-linespec patch.  Still I believe PR 12573 was right to do.
46
47 No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.
48
49 I will check it in.
50
51
52 Thanks,
53 Jan
54
55
56 gdb/
57 2012-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
58
59         PR symtab/13777
60         * dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for
61         GCC >=4.5.
62
63 gdb/testsuite/
64 2012-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
65
66         PR symtab/13777
67         * gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0.
68
69 --- a/gdb/dwarf2read.c
70 +++ b/gdb/dwarf2read.c
71 @@ -4841,7 +4841,9 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
72  
73        /* GCC-4.0 has started to support -fvar-tracking.  GCC-3.x still can
74          produce DW_AT_location with location lists but it can be possibly
75 -        invalid without -fvar-tracking.
76 +        invalid without -fvar-tracking.  Still up to GCC-4.4.x incl. 4.4.0
77 +        there were bugs in prologue debug info, fixed later in GCC-4.5
78 +        by "unwind info for epilogues" patch (which is not directly related).
79  
80          For -gdwarf-4 type units LOCATIONS_VALID indication is fortunately not
81          needed, it would be wrong due to missing DW_AT_producer there.
82 @@ -4849,7 +4851,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
83          Still one can confuse GDB by using non-standard GCC compilation
84          options - this waits on GCC PR other/32998 (-frecord-gcc-switches).
85          */ 
86 -      if (cu->has_loclist && gcc_4_minor >= 0)
87 +      if (cu->has_loclist && gcc_4_minor >= 5)
88         symtab->locations_valid = 1;
89  
90        if (gcc_4_minor >= 5)
91 --- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S
92 +++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S
93 @@ -30,7 +30,7 @@
94         .4byte  func_start                      /* DW_AT_low_pc */
95         .4byte  func_end                        /* DW_AT_high_pc */
96         .ascii  "main.c\0"                      /* DW_AT_name */
97 -       .ascii  "GNU C 4.0.0\0"                 /* DW_AT_producer must be >= 4.0  */
98 +       .ascii  "GNU C 4.5.0\0"                 /* DW_AT_producer must be >= 4.5  */
99         .byte   2                               /* DW_AT_language (DW_LANG_C) */
100  
101         .uleb128        2                       /* Abbrev: DW_TAG_subprogram */
102
This page took 0.309429 seconds and 3 git commands to generate.