]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-bz575292-delayed-physname.patch
- updated (performance fixes).
[packages/gdb.git] / gdb-bz575292-delayed-physname.patch
1 Made more safe (but less effective) by using a linked list.
2
3 Based on:
4         Re: [RFA] Delayed physname computation
5         http://sourceware.org/ml/gdb-patches/2010-05/msg00248.html
6
7 Neither its obstack-leak.patch nor
8         [patch] Fix duplicate types for single DIE
9         http://sourceware.org/ml/gdb-patches/2010-05/msg00271.html
10 is needed as the linked list is used instead.
11
12 Index: gdb-7.1.90.20100721/gdb/dwarf2read.c
13 ===================================================================
14 --- gdb-7.1.90.20100721.orig/gdb/dwarf2read.c   2010-07-22 11:59:19.000000000 +0200
15 +++ gdb-7.1.90.20100721/gdb/dwarf2read.c        2010-07-22 12:00:08.000000000 +0200
16 @@ -253,6 +253,28 @@ struct comp_unit_head
17    unsigned int first_die_offset;
18  };
19  
20 +/* Type used for delaying computation of method physnames.
21 +   See comments for compute_delayed_physnames.  */
22 +struct delayed_method_info
23 +{
24 +  struct delayed_method_info *next;
25 +
26 +  /* The type to which the method is attached, i.e., its parent class.  */
27 +  struct type *type;
28 +
29 +  /* The index of the method in the type's function fieldlists.  */
30 +  int fnfield_index;
31 +
32 +  /* The index of the method in the fieldlist.  */
33 +  int index;
34 +
35 +  /* The name of the DIE.  */
36 +  const char *name;
37 +
38 +  /*  The DIE associated with this method.  */
39 +  struct die_info *die;
40 +};
41 +
42  /* Internal state when decoding a particular compilation unit.  */
43  struct dwarf2_cu
44  {
45 @@ -331,6 +353,10 @@ struct dwarf2_cu
46    /* Header data from the line table, during full symbol processing.  */
47    struct line_header *line_header;
48  
49 +  /* A list of methods which need to have physnames computed
50 +     after all type information has been read.  */
51 +  struct delayed_method_info *method_list;
52 +
53    /* Mark used when releasing cached dies.  */
54    unsigned int mark : 1;
55  
56 @@ -1239,6 +1265,9 @@ static gdb_byte *partial_read_comp_unit_
57  static void init_cu_die_reader (struct die_reader_specs *reader,
58                                 struct dwarf2_cu *cu);
59  
60 +static const char *dwarf2_physname (char *name, struct die_info *die,
61 +                                   struct dwarf2_cu *cu);
62 +
63  #if WORDS_BIGENDIAN
64  
65  /* Convert VALUE between big- and little-endian.  */
66 @@ -4103,6 +4132,58 @@ load_full_comp_unit (struct dwarf2_per_c
67    discard_cleanups (free_cu_cleanup);
68  }
69  
70 +/* Add a DIE to the delayed physname list.  */
71 +static void
72 +add_to_method_list (struct type *type, int fnfield_index, int index,
73 +                   const char *name, struct die_info *die,
74 +                   struct dwarf2_cu *cu)
75 +{
76 +  struct delayed_method_info *mi;
77 +
78 +  mi = xmalloc (sizeof (*mi));
79 +  mi->next = cu->method_list;
80 +  cu->method_list = mi;
81 +  mi->type = type;
82 +  mi->fnfield_index = fnfield_index;
83 +  mi->index = index;
84 +  mi->name = name;
85 +  mi->die = die;
86 +}
87 +
88 +/* Compute the physnames of any methods on the CU's method list.
89 +
90 +   The computation of method physnames is delayed in order to avoid the
91 +   (bad) condition that one of the method's formal parameters is of an as yet
92 +   incomplete type.  */
93 +static void
94 +compute_delayed_physnames (struct dwarf2_cu *cu)
95 +{
96 +  struct delayed_method_info *mi;
97 +  
98 +  for (mi = cu->method_list; mi; mi = mi->next)
99 +    {
100 +      char *physname;
101 +      struct fn_fieldlist *fn_flp
102 +       = &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
103 +      physname = (char *) dwarf2_physname ((char *) mi->name, mi->die, cu);
104 +      fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
105 +    }
106 +}
107 +
108 +static void
109 +method_list_cleanup (void *arg)
110 +{
111 +  struct delayed_method_info **method_list_pointer = arg;
112 +
113 +  while (*method_list_pointer)
114 +    {
115 +      struct delayed_method_info *mi = *method_list_pointer;
116 +
117 +      *method_list_pointer = mi->next;
118 +      xfree (mi);
119 +    }
120 +}
121 +
122  /* Generate full symbol information for PST and CU, whose DIEs have
123     already been loaded into memory.  */
124  
125 @@ -4113,7 +4194,7 @@ process_full_comp_unit (struct dwarf2_pe
126    struct objfile *objfile = per_cu->objfile;
127    CORE_ADDR lowpc, highpc;
128    struct symtab *symtab;
129 -  struct cleanup *back_to;
130 +  struct cleanup *back_to, *delayed_list_cleanup;
131    CORE_ADDR baseaddr;
132  
133    baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
134 @@ -4123,11 +4204,22 @@ process_full_comp_unit (struct dwarf2_pe
135  
136    cu->list_in_scope = &file_symbols;
137  
138 +  /* If methods were found in the partial symbol table, we allocate one
139 +     big buffer to hold the entire delayed list for the CU.  */
140 +  delayed_list_cleanup = make_cleanup (method_list_cleanup,
141 +                                      &cu->method_list);
142 +
143    dwarf2_find_base_address (cu->dies, cu);
144  
145    /* Do line number decoding in read_file_scope () */
146    process_die (cu->dies, cu);
147  
148 +  /* Now that we have processed all the DIEs in the CU, all the types 
149 +     should be complete, and it should now be safe to compute all of the
150 +     physnames.  */
151 +  compute_delayed_physnames (cu);
152 +  do_cleanups (delayed_list_cleanup);
153 +
154    /* Some compilers don't define a DW_AT_high_pc attribute for the
155       compilation unit.  If the DW_AT_high_pc is missing, synthesize
156       it, by scanning the DIE's below the compilation unit.  */
157 @@ -5838,7 +5930,6 @@ dwarf2_add_member_fn (struct field_info 
158    int i;
159    struct fn_field *fnp;
160    char *fieldname;
161 -  char *physname;
162    struct nextfnfield *new_fnfield;
163    struct type *this_type;
164  
165 @@ -5850,9 +5941,6 @@ dwarf2_add_member_fn (struct field_info 
166    if (fieldname == NULL)
167      return;
168  
169 -  /* Get the mangled name.  */
170 -  physname = (char *) dwarf2_physname (fieldname, die, cu);
171 -
172    /* Look up member function name in fieldlist.  */
173    for (i = 0; i < fip->nfnfields; i++)
174      {
175 @@ -5878,7 +5966,7 @@ dwarf2_add_member_fn (struct field_info 
176        flp->name = fieldname;
177        flp->length = 0;
178        flp->head = NULL;
179 -      fip->nfnfields++;
180 +      i = fip->nfnfields++;
181      }
182  
183    /* Create a new member function field and chain it to the field list
184 @@ -5892,9 +5980,19 @@ dwarf2_add_member_fn (struct field_info 
185  
186    /* Fill in the member function field info.  */
187    fnp = &new_fnfield->fnfield;
188 -  /* The name is already allocated along with this objfile, so we don't
189 -     need to duplicate it for the type.  */
190 -  fnp->physname = physname ? physname : "";
191 +
192 +  /* Delay processing of the physname until later.  */
193 +  if (cu->language == language_cplus || cu->language == language_java)
194 +    {
195 +      add_to_method_list (type, i, flp->length - 1, fieldname,
196 +                         die, cu);
197 +    }
198 +  else
199 +    {
200 +      char *physname = (char *) dwarf2_physname (fieldname, die, cu);
201 +      fnp->physname = physname ? physname : "";
202 +    }
203 +
204    fnp->type = alloc_type (objfile);
205    this_type = read_type_die (die, cu);
206    if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC)
207 @@ -5920,7 +6018,7 @@ dwarf2_add_member_fn (struct field_info 
208      }
209    else
210      complaint (&symfile_complaints, _("member function type missing for '%s'"),
211 -              physname);
212 +              dwarf2_full_name (fieldname, die, cu));
213  
214    /* Get fcontext from DW_AT_containing_type if present.  */
215    if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL)
216 @@ -8299,7 +8397,9 @@ load_partial_dies (bfd *abfd, gdb_byte *
217                       || last_die->tag == DW_TAG_interface_type
218                       || last_die->tag == DW_TAG_structure_type
219                       || last_die->tag == DW_TAG_union_type))
220 -             || (cu->language == language_ada
221 +             || ((cu->language == language_ada
222 +                  || cu->language == language_cplus
223 +                  || cu->language == language_java)
224                   && (last_die->tag == DW_TAG_subprogram
225                       || last_die->tag == DW_TAG_lexical_block))))
226         {
227 Index: gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.S
228 ===================================================================
229 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
230 +++ gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.S      2010-07-22 11:59:29.000000000 +0200
231 @@ -0,0 +1,355 @@
232 +/* Copyright 2010 Free Software Foundation, Inc.
233 +
234 +   This program is free software; you can redistribute it and/or modify
235 +   it under the terms of the GNU General Public License as published by
236 +   the Free Software Foundation; either version 3 of the License, or
237 +   (at your option) any later version.
238 +
239 +   This program is distributed in the hope that it will be useful,
240 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
241 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
242 +   GNU General Public License for more details.
243 +
244 +   You should have received a copy of the GNU General Public License
245 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
246 +
247 +/* Compiled from:
248 +
249 +    namespace N
250 +    {
251 +      class C
252 +      {
253 +      public:
254 +        typedef void (*t) (C);
255 +        C (t) {}
256 +      };
257 +      typedef C::t u;
258 +      u f;
259 +      C c (f);
260 +    };
261 +
262 +    int
263 +    main ()
264 +    {
265 +      return 0;
266 +    }
267 +*/
268 +
269 +       .text
270 +_ZN1N1cE:      
271 +       .section        .debug_info
272 +d:
273 +       .long   .Ldebug_info_end - 1f /* Length of CU info */
274 +1:
275 +       .2byte  0x2             /* DWARF version number */
276 +       .long   .Ldebug_abbrev0 /* Abbrev offset */
277 +       .byte   0x4             /* Pointer size */
278 +dieb:  .uleb128 0x1            /* DW_TAG_compile_unit */
279 +       .long   .LASF4          /* DW_AT_producer */
280 +       .byte   0x4             /* DW_AT_language */
281 +       .long   .LASF5          /* DW_AT_name */
282 +       .long   .LASF6          /* DW_AT_comp_dir */
283 +       .long   0x0             /* DW_AT_low_pc */
284 +       .long   0x0             /* DW_AT_high_pc */
285 +       .long   0x0             /* DW_AT_entry_pc */
286 +die29: .uleb128 0x2            /* DW_TAG_namespace */
287 +       .string "N"             /* DW_AT_name */
288 +die32: .uleb128 0x3            /* DW_TAG_class_type */
289 +       .string "C"             /* DW_AT_name */
290 +       .byte   0x1             /* DW_AT_declaration */
291 +die36: .uleb128 0x4            /* DW_TAG_typedef */
292 +       .string "u"             /* DW_AT_name */
293 +       .long   die7e-d         /* DW_AT_type */
294 +die3f: .uleb128 0x5            /* DW_TAG_variable */
295 +       .string "f"             /* DW_AT_name */
296 +       .long   .LASF0          /* DW_AT_MIPS_linkage_name */
297 +       .long   die36-d         /* DW_AT_type */
298 +       .byte   0x1             /* DW_AT_external */
299 +       .byte   0x1             /* DW_AT_declaration */
300 +die4e: .uleb128 0x5            /* DW_TAG_variable */
301 +       .string "c"             /* DW_AT_name */
302 +       .long   .LASF1          /* DW_AT_MIPS_linkage_name */
303 +       .long   die5e-d         /* DW_AT_type */
304 +       .byte   0x1             /* DW_AT_external */
305 +       .byte   0x1             /* DW_AT_declaration */
306 +       .byte   0x0
307 +die5e: .uleb128 0x6            /* DW_TAG_class_type */
308 +       .long   die32-d         /* DW_AT_specification */
309 +       .byte   0x1             /* DW_AT_byte_size */
310 +die6a: .uleb128 0x7            /* DW_TAG_subprogram */
311 +       .byte   0x1             /* DW_AT_external */
312 +       .string "C"             /* DW_AT_name */
313 +       .byte   0x1             /* DW_AT_declaration */
314 +die71: .uleb128 0x8            /* DW_TAG_formal_parameter */
315 +       .long   die8f-d         /* DW_AT_type */
316 +       .byte   0x1             /* DW_AT_artificial */
317 +die77: .uleb128 0x9            /* DW_TAG_formal_parameter */
318 +       .long   die7e-d         /* DW_AT_type */
319 +       .byte   0x0
320 +       .byte   0x0
321 +die7e: .uleb128 0xa            /* DW_TAG_pointer_type */
322 +       .byte   0x4             /* DW_AT_byte_size */
323 +       .long   die84-d         /* DW_AT_type */
324 +die84: .uleb128 0xb            /* DW_TAG_subroutine_type */
325 +die89: .uleb128 0x9            /* DW_TAG_formal_parameter */
326 +       .long   die5e-d         /* DW_AT_type */
327 +       .byte   0x0
328 +die8f: .uleb128 0xa            /* DW_TAG_pointer_type */
329 +       .byte   0x4             /* DW_AT_byte_size */
330 +       .long   die5e-d         /* DW_AT_type */
331 +die95: .uleb128 0xc            /* DW_TAG_subprogram */
332 +       .long   die6a-d         /* DW_AT_specification */
333 +       .byte   0x2             /* DW_AT_inline */
334 +die9f: .uleb128 0xd            /* DW_TAG_formal_parameter */
335 +       .long   .LASF7          /* DW_AT_name */
336 +       .long   dieaf-d         /* DW_AT_type */
337 +       .byte   0x1             /* DW_AT_artificial */
338 +diea9: .uleb128 0x9            /* DW_TAG_formal_parameter */
339 +       .long   die7e-d         /* DW_AT_type */
340 +       .byte   0x0
341 +dieaf: .uleb128 0xe            /* DW_TAG_const_type */
342 +       .long   die8f-d         /* DW_AT_type */
343 +dieb4: .uleb128 0xf            /* DW_TAG_subprogram */
344 +       .long   die95-d         /* DW_AT_abstract_origin */
345 +       .long   _ZN1N1cE        /* DW_AT_low_pc */
346 +       .long   _ZN1N1cE        /* DW_AT_high_pc */
347 +diec9: .uleb128 0x10           /* DW_TAG_subprogram */
348 +       .long   die9f-d         /* DW_AT_abstract_origin */
349 +       .byte   2f-1f           /* DW_AT_location */
350 +1:
351 +       .byte   0x50            /* DW_OP_reg0 */
352 +2:
353 +died1: .uleb128 0x10           /* DW_TAG_formal_parameter */
354 +       .long   diea9-d         /* DW_AT_abstract_origin */
355 +       .byte   2f-1f           /* DW_AT_location */
356 +1:
357 +       .byte   0x51            /* DW_OP_reg1 */
358 +2:
359 +       .byte   0x0
360 +dieda: .uleb128 0x11           /* DW_TAG_subprogram */
361 +       .byte   0x1             /* DW_AT_external */
362 +       .long   .LASF8          /* DW_AT_name */
363 +       .long   dief2-d         /* DW_AT_type */
364 +       .long   _ZN1N1cE        /* DW_AT_low_pc */
365 +       .long   _ZN1N1cE        /* DW_AT_high_pc */
366 +dief2: .uleb128 0x12           /* DW_TAG_base_type */
367 +       .byte   0x4             /* DW_AT_byte_size */
368 +       .byte   0x5             /* DW_AT_encoding */
369 +       .string "int"           /* DW_AT_name */
370 +die149:        .uleb128 0x16           /* DW_TAG_variable */
371 +       .long   die4e-d         /* DW_AT_specification */
372 +       .byte   0x5             /* DW_AT_location */
373 +       .byte   0x3
374 +       .long   _ZN1N1cE
375 +       .byte   0x0
376 +.Ldebug_info_end:
377 +       .section        .debug_abbrev
378 +.Ldebug_abbrev0:
379 +       .uleb128 0x1            /* abbrev code*/
380 +       .uleb128 0x11           /* DW_TAG_compile_unit */
381 +       .byte   0x1             /* DW_children_yes */
382 +       .uleb128 0x25           /* DW_AT_producer*/
383 +       .uleb128 0xe            /* DW_FORM_strp */
384 +       .uleb128 0x13           /* DW_AT_language */
385 +       .uleb128 0xb            /* DW_FORM_data1 */
386 +       .uleb128 0x3            /* DW_AT_name */
387 +       .uleb128 0xe            /* DW_FORM_strp */
388 +       .uleb128 0x1b           /* DW_AT_comp_dir */
389 +       .uleb128 0xe            /* DW_FORM_strp */
390 +       .uleb128 0x11           /* DW_AT_low_pc */
391 +       .uleb128 0x1            /* DW_FORM_addr */
392 +       .uleb128 0x12           /* DW_AT_high_pc */
393 +       .uleb128 0x1            /* DW_FORM_addr */
394 +       .uleb128 0x52           /* DW_AT_entry_pc */
395 +       .uleb128 0x1            /* DW_FORM_addr */
396 +       .byte   0x0
397 +       .byte   0x0
398 +       .uleb128 0x2            /* abbrev code */
399 +       .uleb128 0x39           /* DW_TAG_namespace */
400 +       .byte   0x1             /* DW_children_yes */
401 +       .uleb128 0x3            /* DW_AT_name */
402 +       .uleb128 0x8            /* DW_FORM_string */
403 +       .byte   0x0
404 +       .byte   0x0
405 +       .uleb128 0x3            /* abbrev code */
406 +       .uleb128 0x2            /* DW_TAG_class_type */
407 +       .byte   0x0             /* DW_has_children_no */
408 +       .uleb128 0x3            /* DW_AT_name */
409 +       .uleb128 0x8            /* DW_FORM_string */
410 +       .uleb128 0x3c           /* DW_AT_declaration */
411 +       .uleb128 0xc            /* DW_FORM_flag */
412 +       .byte   0x0
413 +       .byte   0x0
414 +       .uleb128 0x4            /* abbrev code */
415 +       .uleb128 0x16           /* DW_TAG_typedef */
416 +       .byte   0x0             /* DW_has_children_no */
417 +       .uleb128 0x3            /* DW_AT_name */
418 +       .uleb128 0x8            /* DW_FORM_string */
419 +       .uleb128 0x49           /* DW_AT_type */
420 +       .uleb128 0x13           /* DW_FORM_ref4 */
421 +       .byte   0x0
422 +       .byte   0x0
423 +       .uleb128 0x5            /* abbrev code */
424 +       .uleb128 0x34           /* DW_TAG_variable */
425 +       .byte   0x0             /* DW_has_children_no */
426 +       .uleb128 0x3            /* DW_AT_name */
427 +       .uleb128 0x8            /* DW_FORM_string */
428 +       .uleb128 0x2007         /* DW_AT_MIPS_linkage_name */
429 +       .uleb128 0xe            /* DW_FORM_strp */
430 +       .uleb128 0x49           /* DW_AT_TYPE */
431 +       .uleb128 0x13           /* DW_FORM_ref4 */
432 +       .uleb128 0x3f           /* DW_AT_external */
433 +       .uleb128 0xc            /* DW_FORM_flag */
434 +       .uleb128 0x3c           /* DW_AT_declaration */
435 +       .uleb128 0xc            /* DW_FORM_flag */
436 +       .byte   0x0
437 +       .byte   0x0
438 +       .uleb128 0x6            /* abbrev code */
439 +       .uleb128 0x2            /* DW_TAG_class_type */
440 +       .byte   0x1             /* DW_has_children_yes */
441 +       .uleb128 0x47           /* DW_AT_specification */
442 +       .uleb128 0x13           /* DW_FORM_ref4 */
443 +       .uleb128 0xb            /* DW_AT_byte_size */
444 +       .uleb128 0xb            /* DW_FORM_data1 */
445 +       .byte   0x0
446 +       .byte   0x0
447 +       .uleb128 0x7            /* abbrev code */
448 +       .uleb128 0x2e           /* DW_TAG_subprogra */
449 +       .byte   0x1             /* DW_has_children_yes */
450 +       .uleb128 0x3f           /* DW_AT_external */
451 +       .uleb128 0xc            /* DW_FORM_flag */
452 +       .uleb128 0x3            /* DW_AT_name */
453 +       .uleb128 0x8            /* DW_FORM_string */
454 +       .uleb128 0x3c           /* DW_AT_declaration */
455 +       .uleb128 0xc            /* DW_FORM_flag */
456 +       .byte   0x0
457 +       .byte   0x0
458 +       .uleb128 0x8            /* abbrev code */
459 +       .uleb128 0x5            /* DW_TAG_formal_parameter */
460 +       .byte   0x0             /* DW_has_children_no */
461 +       .uleb128 0x49           /* DW_AT_type */
462 +       .uleb128 0x13           /* DW_FORM_ref4 */
463 +       .uleb128 0x34           /* DW_AT_artificial */
464 +       .uleb128 0xc            /* DW_FORM_flag */
465 +       .byte   0x0
466 +       .byte   0x0
467 +       .uleb128 0x9            /* abbrev code */
468 +       .uleb128 0x5            /* DW_TAG_formal_parameter */
469 +       .byte   0x0             /* DW_has_children_no */
470 +       .uleb128 0x49           /* DW_AT_type */
471 +       .uleb128 0x13           /* DW_FORM_ref4 */
472 +       .byte   0x0
473 +       .byte   0x0
474 +       .uleb128 0xa            /* abbrev code */
475 +       .uleb128 0xf            /* DW_TAG_pointer_type */
476 +       .byte   0x0             /* DW_has_children_no */
477 +       .uleb128 0xb            /* DW_AT_byte_size */
478 +       .uleb128 0xb            /* DW_FORM_data1 */
479 +       .uleb128 0x49           /* DW_AT_type */
480 +       .uleb128 0x13           /* DW_FORM_ref4 */
481 +       .byte   0x0
482 +       .byte   0x0
483 +       .uleb128 0xb            /* abbrev code */
484 +       .uleb128 0x15           /* DW_TAG_subroutine_type */
485 +       .byte   0x1             /* DW_has_children_yes */
486 +       .byte   0x0
487 +       .byte   0x0
488 +       .uleb128 0xc            /* abbrev code */
489 +       .uleb128 0x2e           /* DW_TAG_subprogram */
490 +       .byte   0x1             /* DW_has_children_yes */
491 +       .uleb128 0x47           /* DW_AT_specification */
492 +       .uleb128 0x13           /* DW_FORM_ref4 */
493 +       .uleb128 0x20           /* DW_AT_inline */
494 +       .uleb128 0xb            /* DW_FORM_data1 */
495 +       .byte   0x0
496 +       .byte   0x0
497 +       .uleb128 0xd            /* abbrev code */
498 +       .uleb128 0x5            /* DW_TAG_formal_parameter */
499 +       .byte   0x0             /* DW_has_children_no */
500 +       .uleb128 0x3            /* DW_AT_name */
501 +       .uleb128 0xe            /* DW_FORM_strp */
502 +       .uleb128 0x49           /* DW_AT_type */
503 +       .uleb128 0x13           /* DW_FORM_ref4 */
504 +       .uleb128 0x34           /* DW_AT_artificial */
505 +       .uleb128 0xc            /* DW_FORM_flag */
506 +       .byte   0x0
507 +       .byte   0x0
508 +       .uleb128 0xe            /* abbrev code */
509 +       .uleb128 0x26           /* DW_TAG_const_type */
510 +       .byte   0x0             /* DW_has_children_no */
511 +       .uleb128 0x49           /* DW_AT_type */
512 +       .uleb128 0x13           /* DW_FORM_ref4 */
513 +       .byte   0x0
514 +       .byte   0x0
515 +       .uleb128 0xf            /* abbrev code */
516 +       .uleb128 0x2e           /* DW_TAG_subprogram */
517 +       .byte   0x1             /* DW_has_children_yes */
518 +       .uleb128 0x31           /* DW_AT_abstract_origin */
519 +       .uleb128 0x13           /* DW_FORM_ref4 */
520 +       .uleb128 0x11           /* DW_AT_low_pc */
521 +       .uleb128 0x1            /* DW_FORM_addr */
522 +       .uleb128 0x12           /* DW_AT_high_pc */
523 +       .uleb128 0x1            /* DW_FORM_addr */
524 +       .byte   0x0
525 +       .byte   0x0
526 +       .uleb128 0x10           /* abbrev code */
527 +       .uleb128 0x5            /* DW_TAG_formal_parameter */
528 +       .byte   0x0             /* DW_has_children_no */
529 +       .uleb128 0x31           /* DW_AT_abstract_origin */
530 +       .uleb128 0x13           /* DW_FORM_ref4 */
531 +       .uleb128 0x2            /* DW_AT_location */
532 +       .uleb128 0xa            /* DW_FORM_block1 */
533 +       .byte   0x0
534 +       .byte   0x0
535 +       .uleb128 0x11           /* abbrev code */
536 +       .uleb128 0x2e           /* DW_TAG_subprogram */
537 +       .byte   0x0             /* DW_has_children_no */
538 +       .uleb128 0x3f           /* DW_AT_external */
539 +       .uleb128 0xc            /* DW_FORM_flag */
540 +       .uleb128 0x3            /* DW_AT_name */
541 +       .uleb128 0xe            /* DW_FORM_strp */
542 +       .uleb128 0x49           /* DW_AT_type */
543 +       .uleb128 0x13           /* DW_FORM_ref4 */
544 +       .uleb128 0x11           /* DW_AT_low_pc */
545 +       .uleb128 0x1            /* DW_FORM_addr */
546 +       .uleb128 0x12           /* DW_AT_high_pc */
547 +       .uleb128 0x1            /* DW_FORM_addr */
548 +       .byte   0x0
549 +       .byte   0x0
550 +       .uleb128 0x12           /* abbrev code */
551 +       .uleb128 0x24           /* DW_TAG_base_type */
552 +       .byte   0x0             /* DW_has_children_no */
553 +       .uleb128 0xb            /* DW_AT_byte_size */
554 +       .uleb128 0xb            /* DW_FORM_data1 */
555 +       .uleb128 0x3e           /* DW_AT_encoding */
556 +       .uleb128 0xb            /* DW_FORM_data1 */
557 +       .uleb128 0x3            /* DW_AT_name */
558 +       .uleb128 0x8            /* DW_FORM_string */
559 +       .byte   0x0
560 +       .byte   0x0
561 +       .uleb128 0x16           /* abbrev code */
562 +       .uleb128 0x34           /* DW_TAG_variable */
563 +       .byte   0x0             /* DW_has_children_no */
564 +       .uleb128 0x47           /* DW_AT_specification */
565 +       .uleb128 0x13           /* DW_FORM_ref4 */
566 +       .uleb128 0x2            /* DW_AT_location */
567 +       .uleb128 0xa            /* DW_FORM_block1 */
568 +       .byte   0x0
569 +       .byte   0x0
570 +       .byte   0x0
571 +       .section        .debug_str
572 +.LASF0:
573 +       .string "_ZN1N1fE"
574 +.LASF7:
575 +       .string "this"
576 +.LASF6:
577 +       .string ""
578 +.LASF8:
579 +       .string "main"
580 +.LASF1:
581 +       .string "_ZN1N1cE"
582 +.LASF5:
583 +       .string "pr11465.cc"
584 +.LASF4:
585 +       .string "GNU C++ 4.4.2"
586 +       .ident  "GCC: (GNU) 4.4.2"
587 Index: gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.exp
588 ===================================================================
589 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
590 +++ gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.exp    2010-07-22 11:59:29.000000000 +0200
591 @@ -0,0 +1,39 @@
592 +# Copyright 2010 Free Software Foundation, Inc.
593 +
594 +# This program is free software; you can redistribute it and/or modify
595 +# it under the terms of the GNU General Public License as published by
596 +# the Free Software Foundation; either version 3 of the License, or
597 +# (at your option) any later version.
598 +#
599 +# This program is distributed in the hope that it will be useful,
600 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
601 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
602 +# GNU General Public License for more details.
603 +#
604 +# You should have received a copy of the GNU General Public License
605 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
606 +
607 +# This test can only be run on targets which support DWARF-2 and use gas.
608 +# For now pick a sampling of likely targets.
609 +if {![istarget *-*-linux*]
610 +    && ![istarget *-*-gnu*]
611 +    && ![istarget *-*-elf*]
612 +    && ![istarget *-*-openbsd*]
613 +    && ![istarget arm-*-eabi*]
614 +    && ![istarget powerpc-*-eabi*]} {
615 +    return 0  
616 +}
617 +
618 +set testfile "pr11465"
619 +set srcfile ${testfile}.S
620 +set executable ${testfile}.x
621 +set binfile ${objdir}/${subdir}/${executable}
622 +
623 +if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
624 +    return -1
625 +}
626 +
627 +clean_restart $executable
628 +
629 +# Test delayed physname computations
630 +gdb_test "p N::c.C" { = {void \(N::C \*, void \(\*\)\(N::C\)\)}.*}
This page took 0.646686 seconds and 3 git commands to generate.