]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-die-cu-offset-1of2.patch
- updated (performance fixes).
[packages/gdb.git] / gdb-die-cu-offset-1of2.patch
1 [commit] [patch] Fix CU relative vs. absolute offsets [Re: RFC: problem with DW_OP_GNU_deref_type and dwarf's get_base_type callback]
2 http://sourceware.org/ml/gdb-patches/2012-03/msg00284.html
3 http://sourceware.org/ml/gdb-cvs/2012-03/msg00134.html
4
5 ### src/gdb/ChangeLog   2012/03/08 19:08:09     1.13979
6 ### src/gdb/ChangeLog   2012/03/08 19:37:04     1.13980
7 ## -1,5 +1,15 @@
8  2012-03-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
9  
10 +       Fix CU relative vs. absolute DIE offsets.
11 +       * dwarf2loc.h (dwarf2_fetch_die_location_block): Rename parameter
12 +       offset to offset_in_cu.
13 +       * dwarf2read.c (process_enumeration_scope): Add CU offset to
14 +       TYPE_OFFSET.
15 +       (dwarf2_fetch_die_location_block): Rename parameter offset to
16 +       offset_in_cu.  New variable offset, add CU offset to OFFSET_IN_CU.
17 +
18 +2012-03-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
19 +
20         * libunwind-frame.c: Rename to ...
21         * ia64-libunwind-tdep.c: ... here.
22         * libunwind-frame.h: Rename to ...
23 --- src/gdb/dwarf2loc.h 2012/01/05 21:53:14     1.29
24 +++ src/gdb/dwarf2loc.h 2012/03/08 19:37:07     1.30
25 @@ -61,7 +61,7 @@
26     CORE_ADDR pc);
27  
28  struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block
29 -  (unsigned int offset, struct dwarf2_per_cu_data *per_cu,
30 +  (unsigned int offset_in_cu, struct dwarf2_per_cu_data *per_cu,
31     CORE_ADDR (*get_frame_pc) (void *baton),
32     void *baton);
33  
34 --- src/gdb/dwarf2read.c        2012/03/06 23:41:50     1.619
35 +++ src/gdb/dwarf2read.c        2012/03/08 19:37:07     1.620
36 @@ -8031,7 +8031,8 @@
37         = lookup_signatured_type_at_offset (dwarf2_per_objfile->objfile,
38                                             cu->per_cu->debug_types_section,
39                                             cu->per_cu->offset);
40 -      if (type_sig->type_offset != die->offset)
41 +      if (type_sig->per_cu.offset + type_sig->type_offset
42 +         != die->offset)
43         return;
44      }
45  
46 @@ -14202,11 +14203,12 @@
47     dwarf2_locexpr_baton->data has lifetime of PER_CU->OBJFILE.  */
48  
49  struct dwarf2_locexpr_baton
50 -dwarf2_fetch_die_location_block (unsigned int offset,
51 +dwarf2_fetch_die_location_block (unsigned int offset_in_cu,
52                                  struct dwarf2_per_cu_data *per_cu,
53                                  CORE_ADDR (*get_frame_pc) (void *baton),
54                                  void *baton)
55  {
56 +  unsigned int offset = per_cu->offset + offset_in_cu;
57    struct dwarf2_cu *cu;
58    struct die_info *die;
59    struct attribute *attr;
60 ### src/gdb/testsuite/ChangeLog 2012/03/08 07:42:50     1.3127
61 ### src/gdb/testsuite/ChangeLog 2012/03/08 19:37:07     1.3128
62 ## -1,5 +1,11 @@
63  2012-03-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
64  
65 +       Fix CU relative vs. absolute DIE offsets.
66 +       * gdb.dwarf2/dw2-op-call.S: New compilation unit preceding the existing
67 +       one.
68 +
69 +2012-03-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
70 +
71         Fix false FAIL on distros with relro linkage as default.
72         * gdb.reverse/solib-precsave.exp: Try to compile the test using
73         -Wl,-z,norelro first.
74 --- src/gdb/testsuite/gdb.dwarf2/dw2-op-call.S  2012/01/04 08:17:51     1.5
75 +++ src/gdb/testsuite/gdb.dwarf2/dw2-op-call.S  2012/03/08 19:37:08     1.6
76 @@ -23,6 +23,23 @@
77  array3:        .2byte  3
78  
79         .section .debug_info
80 +.Lcu0_begin:
81 +       /* CU header */
82 +       .4byte  .Lcu0_end - .Lcu0_start         /* Length of Compilation Unit */
83 +.Lcu0_start:
84 +       .2byte  2                               /* DWARF Version */
85 +       .4byte  .Labbrev1_begin                 /* Offset into abbrev section */
86 +       .byte   4                               /* Pointer size */
87 +
88 +       /* CU die */
89 +       .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
90 +       .ascii  "file0.txt\0"                   /* DW_AT_name */
91 +       .ascii  "GNU C 3.3.3\0"                 /* DW_AT_producer */
92 +       .byte   2                               /* DW_LANG_C (C) */
93 +
94 +       .byte   0                               /* End of children of CU */
95 +.Lcu0_end:
96 +
97  .Lcu1_begin:
98         /* CU header */
99         .4byte  .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
This page took 0.679325 seconds and 3 git commands to generate.