blarsen / rpms / gdb

Forked from rpms/gdb 2 years ago
Clone
ee681d3
Made more safe (but less effective) by using a linked list.
ee681d3
ee681d3
Based on:
ee681d3
	Re: [RFA] Delayed physname computation
ee681d3
	http://sourceware.org/ml/gdb-patches/2010-05/msg00248.html
ee681d3
ee681d3
Neither its obstack-leak.patch nor
ee681d3
	[patch] Fix duplicate types for single DIE
ee681d3
	http://sourceware.org/ml/gdb-patches/2010-05/msg00271.html
ee681d3
is needed as the linked list is used instead.
ee681d3
20f9f67
Index: gdb-7.1.90.20100721/gdb/dwarf2read.c
dd46ae6
===================================================================
20f9f67
--- gdb-7.1.90.20100721.orig/gdb/dwarf2read.c	2010-07-22 11:59:19.000000000 +0200
20f9f67
+++ gdb-7.1.90.20100721/gdb/dwarf2read.c	2010-07-22 12:00:08.000000000 +0200
20f9f67
@@ -253,6 +253,28 @@ struct comp_unit_head
ee681d3
   unsigned int first_die_offset;
ee681d3
 };
ee681d3
 
ee681d3
+/* Type used for delaying computation of method physnames.
ee681d3
+   See comments for compute_delayed_physnames.  */
ee681d3
+struct delayed_method_info
ee681d3
+{
ee681d3
+  struct delayed_method_info *next;
ee681d3
+
ee681d3
+  /* The type to which the method is attached, i.e., its parent class.  */
ee681d3
+  struct type *type;
ee681d3
+
ee681d3
+  /* The index of the method in the type's function fieldlists.  */
ee681d3
+  int fnfield_index;
ee681d3
+
ee681d3
+  /* The index of the method in the fieldlist.  */
ee681d3
+  int index;
ee681d3
+
ee681d3
+  /* The name of the DIE.  */
ee681d3
+  const char *name;
ee681d3
+
ee681d3
+  /*  The DIE associated with this method.  */
ee681d3
+  struct die_info *die;
ee681d3
+};
ee681d3
+
ee681d3
 /* Internal state when decoding a particular compilation unit.  */
ee681d3
 struct dwarf2_cu
ee681d3
 {
20f9f67
@@ -331,6 +353,10 @@ struct dwarf2_cu
ee681d3
   /* Header data from the line table, during full symbol processing.  */
ee681d3
   struct line_header *line_header;
ee681d3
 
ee681d3
+  /* A list of methods which need to have physnames computed
ee681d3
+     after all type information has been read.  */
ee681d3
+  struct delayed_method_info *method_list;
ee681d3
+
ee681d3
   /* Mark used when releasing cached dies.  */
ee681d3
   unsigned int mark : 1;
ee681d3
 
20f9f67
@@ -1239,6 +1265,9 @@ static gdb_byte *partial_read_comp_unit_
20f9f67
 static void init_cu_die_reader (struct die_reader_specs *reader,
20f9f67
 				struct dwarf2_cu *cu);
ee681d3
 
ee681d3
+static const char *dwarf2_physname (char *name, struct die_info *die,
ee681d3
+				    struct dwarf2_cu *cu);
ee681d3
+
20f9f67
 #if WORDS_BIGENDIAN
ee681d3
 
20f9f67
 /* Convert VALUE between big- and little-endian.  */
20f9f67
@@ -4103,6 +4132,58 @@ load_full_comp_unit (struct dwarf2_per_c
ee681d3
   discard_cleanups (free_cu_cleanup);
ee681d3
 }
ee681d3
 
ee681d3
+/* Add a DIE to the delayed physname list.  */
ee681d3
+static void
ee681d3
+add_to_method_list (struct type *type, int fnfield_index, int index,
ee681d3
+		    const char *name, struct die_info *die,
ee681d3
+		    struct dwarf2_cu *cu)
ee681d3
+{
ee681d3
+  struct delayed_method_info *mi;
ee681d3
+
ee681d3
+  mi = xmalloc (sizeof (*mi));
ee681d3
+  mi->next = cu->method_list;
ee681d3
+  cu->method_list = mi;
ee681d3
+  mi->type = type;
ee681d3
+  mi->fnfield_index = fnfield_index;
ee681d3
+  mi->index = index;
ee681d3
+  mi->name = name;
ee681d3
+  mi->die = die;
ee681d3
+}
ee681d3
+
ee681d3
+/* Compute the physnames of any methods on the CU's method list.
ee681d3
+
ee681d3
+   The computation of method physnames is delayed in order to avoid the
ee681d3
+   (bad) condition that one of the method's formal parameters is of an as yet
ee681d3
+   incomplete type.  */
ee681d3
+static void
ee681d3
+compute_delayed_physnames (struct dwarf2_cu *cu)
ee681d3
+{
ee681d3
+  struct delayed_method_info *mi;
ee681d3
+  
ee681d3
+  for (mi = cu->method_list; mi; mi = mi->next)
ee681d3
+    {
ee681d3
+      char *physname;
ee681d3
+      struct fn_fieldlist *fn_flp
ee681d3
+	= &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
ee681d3
+      physname = (char *) dwarf2_physname ((char *) mi->name, mi->die, cu);
ee681d3
+      fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
ee681d3
+    }
ee681d3
+}
ee681d3
+
ee681d3
+static void
ee681d3
+method_list_cleanup (void *arg)
ee681d3
+{
ee681d3
+  struct delayed_method_info **method_list_pointer = arg;
ee681d3
+
ee681d3
+  while (*method_list_pointer)
ee681d3
+    {
ee681d3
+      struct delayed_method_info *mi = *method_list_pointer;
ee681d3
+
ee681d3
+      *method_list_pointer = mi->next;
ee681d3
+      xfree (mi);
ee681d3
+    }
ee681d3
+}
ee681d3
+
ee681d3
 /* Generate full symbol information for PST and CU, whose DIEs have
ee681d3
    already been loaded into memory.  */
ee681d3
 
20f9f67
@@ -4113,7 +4194,7 @@ process_full_comp_unit (struct dwarf2_pe
20f9f67
   struct objfile *objfile = per_cu->objfile;
ee681d3
   CORE_ADDR lowpc, highpc;
ee681d3
   struct symtab *symtab;
ee681d3
-  struct cleanup *back_to;
ee681d3
+  struct cleanup *back_to, *delayed_list_cleanup;
ee681d3
   CORE_ADDR baseaddr;
ee681d3
 
ee681d3
   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
20f9f67
@@ -4123,11 +4204,22 @@ process_full_comp_unit (struct dwarf2_pe
ee681d3
 
ee681d3
   cu->list_in_scope = &file_symbols;
ee681d3
 
ee681d3
+  /* If methods were found in the partial symbol table, we allocate one
ee681d3
+     big buffer to hold the entire delayed list for the CU.  */
ee681d3
+  delayed_list_cleanup = make_cleanup (method_list_cleanup,
ee681d3
+				       &cu->method_list);
ee681d3
+
ee681d3
   dwarf2_find_base_address (cu->dies, cu);
ee681d3
 
ee681d3
   /* Do line number decoding in read_file_scope () */
ee681d3
   process_die (cu->dies, cu);
ee681d3
 
ee681d3
+  /* Now that we have processed all the DIEs in the CU, all the types 
ee681d3
+     should be complete, and it should now be safe to compute all of the
ee681d3
+     physnames.  */
ee681d3
+  compute_delayed_physnames (cu);
ee681d3
+  do_cleanups (delayed_list_cleanup);
ee681d3
+
ee681d3
   /* Some compilers don't define a DW_AT_high_pc attribute for the
ee681d3
      compilation unit.  If the DW_AT_high_pc is missing, synthesize
ee681d3
      it, by scanning the DIE's below the compilation unit.  */
20f9f67
@@ -5838,7 +5930,6 @@ dwarf2_add_member_fn (struct field_info 
ee681d3
   int i;
ee681d3
   struct fn_field *fnp;
ee681d3
   char *fieldname;
ee681d3
-  char *physname;
ee681d3
   struct nextfnfield *new_fnfield;
ee681d3
   struct type *this_type;
ee681d3
 
20f9f67
@@ -5850,9 +5941,6 @@ dwarf2_add_member_fn (struct field_info 
ee681d3
   if (fieldname == NULL)
ee681d3
     return;
ee681d3
 
ee681d3
-  /* Get the mangled name.  */
ee681d3
-  physname = (char *) dwarf2_physname (fieldname, die, cu);
ee681d3
-
ee681d3
   /* Look up member function name in fieldlist.  */
ee681d3
   for (i = 0; i < fip->nfnfields; i++)
ee681d3
     {
20f9f67
@@ -5878,7 +5966,7 @@ dwarf2_add_member_fn (struct field_info 
ee681d3
       flp->name = fieldname;
ee681d3
       flp->length = 0;
ee681d3
       flp->head = NULL;
ee681d3
-      fip->nfnfields++;
ee681d3
+      i = fip->nfnfields++;
ee681d3
     }
ee681d3
 
ee681d3
   /* Create a new member function field and chain it to the field list
20f9f67
@@ -5892,9 +5980,19 @@ dwarf2_add_member_fn (struct field_info 
ee681d3
 
ee681d3
   /* Fill in the member function field info.  */
ee681d3
   fnp = &new_fnfield->fnfield;
ee681d3
-  /* The name is already allocated along with this objfile, so we don't
ee681d3
-     need to duplicate it for the type.  */
ee681d3
-  fnp->physname = physname ? physname : "";
ee681d3
+
ee681d3
+  /* Delay processing of the physname until later.  */
ee681d3
+  if (cu->language == language_cplus || cu->language == language_java)
ee681d3
+    {
ee681d3
+      add_to_method_list (type, i, flp->length - 1, fieldname,
ee681d3
+			  die, cu);
ee681d3
+    }
ee681d3
+  else
ee681d3
+    {
ee681d3
+      char *physname = (char *) dwarf2_physname (fieldname, die, cu);
ee681d3
+      fnp->physname = physname ? physname : "";
ee681d3
+    }
ee681d3
+
ee681d3
   fnp->type = alloc_type (objfile);
ee681d3
   this_type = read_type_die (die, cu);
ee681d3
   if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC)
20f9f67
@@ -5920,7 +6018,7 @@ dwarf2_add_member_fn (struct field_info 
ee681d3
     }
ee681d3
   else
ee681d3
     complaint (&symfile_complaints, _("member function type missing for '%s'"),
ee681d3
-	       physname);
ee681d3
+	       dwarf2_full_name (fieldname, die, cu));
ee681d3
 
ee681d3
   /* Get fcontext from DW_AT_containing_type if present.  */
ee681d3
   if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL)
20f9f67
@@ -8299,7 +8397,9 @@ load_partial_dies (bfd *abfd, gdb_byte *
ee681d3
 		      || last_die->tag == DW_TAG_interface_type
ee681d3
 		      || last_die->tag == DW_TAG_structure_type
ee681d3
 		      || last_die->tag == DW_TAG_union_type))
ee681d3
-	      || (cu->language == language_ada
ee681d3
+	      || ((cu->language == language_ada
ee681d3
+		   || cu->language == language_cplus
ee681d3
+		   || cu->language == language_java)
ee681d3
 		  && (last_die->tag == DW_TAG_subprogram
ee681d3
 		      || last_die->tag == DW_TAG_lexical_block))))
ee681d3
 	{
20f9f67
Index: gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.S
dd46ae6
===================================================================
dd46ae6
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
20f9f67
+++ gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.S	2010-07-22 11:59:29.000000000 +0200
ee681d3
@@ -0,0 +1,355 @@
ee681d3
+/* Copyright 2010 Free Software Foundation, Inc.
ee681d3
+
ee681d3
+   This program is free software; you can redistribute it and/or modify
ee681d3
+   it under the terms of the GNU General Public License as published by
ee681d3
+   the Free Software Foundation; either version 3 of the License, or
ee681d3
+   (at your option) any later version.
ee681d3
+
ee681d3
+   This program is distributed in the hope that it will be useful,
ee681d3
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ee681d3
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee681d3
+   GNU General Public License for more details.
ee681d3
+
ee681d3
+   You should have received a copy of the GNU General Public License
ee681d3
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
ee681d3
+
ee681d3
+/* Compiled from:
ee681d3
+
ee681d3
+    namespace N
ee681d3
+    {
ee681d3
+      class C
ee681d3
+      {
ee681d3
+      public:
ee681d3
+        typedef void (*t) (C);
ee681d3
+        C (t) {}
ee681d3
+      };
ee681d3
+      typedef C::t u;
ee681d3
+      u f;
ee681d3
+      C c (f);
ee681d3
+    };
ee681d3
+
ee681d3
+    int
ee681d3
+    main ()
ee681d3
+    {
ee681d3
+      return 0;
ee681d3
+    }
ee681d3
+*/
ee681d3
+
ee681d3
+	.text
ee681d3
+_ZN1N1cE:	
ee681d3
+	.section	.debug_info
ee681d3
+d:
ee681d3
+	.long	.Ldebug_info_end - 1f /* Length of CU info */
ee681d3
+1:
ee681d3
+	.2byte	0x2		/* DWARF version number */
ee681d3
+	.long	.Ldebug_abbrev0	/* Abbrev offset */
ee681d3
+	.byte	0x4		/* Pointer size */
ee681d3
+dieb:	.uleb128 0x1		/* DW_TAG_compile_unit */
ee681d3
+	.long	.LASF4		/* DW_AT_producer */
ee681d3
+	.byte	0x4		/* DW_AT_language */
ee681d3
+	.long	.LASF5		/* DW_AT_name */
ee681d3
+	.long	.LASF6		/* DW_AT_comp_dir */
ee681d3
+	.long	0x0		/* DW_AT_low_pc */
ee681d3
+	.long	0x0		/* DW_AT_high_pc */
ee681d3
+	.long	0x0		/* DW_AT_entry_pc */
ee681d3
+die29:	.uleb128 0x2		/* DW_TAG_namespace */
ee681d3
+	.string	"N"		/* DW_AT_name */
ee681d3
+die32:	.uleb128 0x3		/* DW_TAG_class_type */
ee681d3
+	.string	"C"		/* DW_AT_name */
ee681d3
+	.byte	0x1		/* DW_AT_declaration */
ee681d3
+die36:	.uleb128 0x4		/* DW_TAG_typedef */
ee681d3
+	.string	"u"		/* DW_AT_name */
ee681d3
+	.long	die7e-d		/* DW_AT_type */
ee681d3
+die3f:	.uleb128 0x5		/* DW_TAG_variable */
ee681d3
+	.string	"f"		/* DW_AT_name */
ee681d3
+	.long	.LASF0		/* DW_AT_MIPS_linkage_name */
ee681d3
+	.long	die36-d		/* DW_AT_type */
ee681d3
+	.byte	0x1		/* DW_AT_external */
ee681d3
+	.byte	0x1		/* DW_AT_declaration */
ee681d3
+die4e:	.uleb128 0x5		/* DW_TAG_variable */
ee681d3
+	.string	"c"		/* DW_AT_name */
ee681d3
+	.long	.LASF1		/* DW_AT_MIPS_linkage_name */
ee681d3
+	.long	die5e-d		/* DW_AT_type */
ee681d3
+	.byte	0x1		/* DW_AT_external */
ee681d3
+	.byte	0x1		/* DW_AT_declaration */
ee681d3
+	.byte	0x0
ee681d3
+die5e:	.uleb128 0x6		/* DW_TAG_class_type */
ee681d3
+	.long	die32-d		/* DW_AT_specification */
ee681d3
+	.byte	0x1		/* DW_AT_byte_size */
ee681d3
+die6a:	.uleb128 0x7		/* DW_TAG_subprogram */
ee681d3
+	.byte	0x1		/* DW_AT_external */
ee681d3
+	.string	"C"		/* DW_AT_name */
ee681d3
+	.byte	0x1		/* DW_AT_declaration */
ee681d3
+die71:	.uleb128 0x8		/* DW_TAG_formal_parameter */
ee681d3
+	.long	die8f-d		/* DW_AT_type */
ee681d3
+	.byte	0x1		/* DW_AT_artificial */
ee681d3
+die77:	.uleb128 0x9		/* DW_TAG_formal_parameter */
ee681d3
+	.long	die7e-d		/* DW_AT_type */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+die7e:	.uleb128 0xa		/* DW_TAG_pointer_type */
ee681d3
+	.byte	0x4		/* DW_AT_byte_size */
ee681d3
+	.long	die84-d		/* DW_AT_type */
ee681d3
+die84:	.uleb128 0xb		/* DW_TAG_subroutine_type */
ee681d3
+die89:	.uleb128 0x9		/* DW_TAG_formal_parameter */
ee681d3
+	.long	die5e-d		/* DW_AT_type */
ee681d3
+	.byte	0x0
ee681d3
+die8f:	.uleb128 0xa		/* DW_TAG_pointer_type */
ee681d3
+	.byte	0x4		/* DW_AT_byte_size */
ee681d3
+	.long	die5e-d		/* DW_AT_type */
ee681d3
+die95:	.uleb128 0xc		/* DW_TAG_subprogram */
ee681d3
+	.long	die6a-d		/* DW_AT_specification */
ee681d3
+	.byte	0x2		/* DW_AT_inline */
ee681d3
+die9f:	.uleb128 0xd		/* DW_TAG_formal_parameter */
ee681d3
+	.long	.LASF7		/* DW_AT_name */
ee681d3
+	.long	dieaf-d		/* DW_AT_type */
ee681d3
+	.byte	0x1		/* DW_AT_artificial */
ee681d3
+diea9:	.uleb128 0x9		/* DW_TAG_formal_parameter */
ee681d3
+	.long	die7e-d		/* DW_AT_type */
ee681d3
+	.byte	0x0
ee681d3
+dieaf:	.uleb128 0xe		/* DW_TAG_const_type */
ee681d3
+	.long	die8f-d		/* DW_AT_type */
ee681d3
+dieb4:	.uleb128 0xf		/* DW_TAG_subprogram */
ee681d3
+	.long	die95-d		/* DW_AT_abstract_origin */
ee681d3
+	.long	_ZN1N1cE	/* DW_AT_low_pc */
ee681d3
+	.long	_ZN1N1cE	/* DW_AT_high_pc */
ee681d3
+diec9:	.uleb128 0x10		/* DW_TAG_subprogram */
ee681d3
+	.long	die9f-d		/* DW_AT_abstract_origin */
ee681d3
+	.byte	2f-1f		/* DW_AT_location */
ee681d3
+1:
ee681d3
+	.byte	0x50		/* DW_OP_reg0 */
ee681d3
+2:
ee681d3
+died1:	.uleb128 0x10		/* DW_TAG_formal_parameter */
ee681d3
+	.long	diea9-d		/* DW_AT_abstract_origin */
ee681d3
+	.byte	2f-1f		/* DW_AT_location */
ee681d3
+1:
ee681d3
+	.byte	0x51		/* DW_OP_reg1 */
ee681d3
+2:
ee681d3
+	.byte	0x0
ee681d3
+dieda:	.uleb128 0x11		/* DW_TAG_subprogram */
ee681d3
+	.byte	0x1		/* DW_AT_external */
ee681d3
+	.long	.LASF8		/* DW_AT_name */
ee681d3
+	.long	dief2-d		/* DW_AT_type */
ee681d3
+	.long	_ZN1N1cE	/* DW_AT_low_pc */
ee681d3
+	.long	_ZN1N1cE	/* DW_AT_high_pc */
ee681d3
+dief2:	.uleb128 0x12		/* DW_TAG_base_type */
ee681d3
+	.byte	0x4		/* DW_AT_byte_size */
ee681d3
+	.byte	0x5		/* DW_AT_encoding */
ee681d3
+	.string	"int"		/* DW_AT_name */
ee681d3
+die149:	.uleb128 0x16		/* DW_TAG_variable */
ee681d3
+	.long	die4e-d		/* DW_AT_specification */
ee681d3
+	.byte	0x5		/* DW_AT_location */
ee681d3
+	.byte	0x3
ee681d3
+	.long	_ZN1N1cE
ee681d3
+	.byte	0x0
ee681d3
+.Ldebug_info_end:
ee681d3
+	.section	.debug_abbrev
ee681d3
+.Ldebug_abbrev0:
ee681d3
+	.uleb128 0x1		/* abbrev code*/
ee681d3
+	.uleb128 0x11		/* DW_TAG_compile_unit */
ee681d3
+	.byte	0x1		/* DW_children_yes */
ee681d3
+	.uleb128 0x25		/* DW_AT_producer*/
ee681d3
+	.uleb128 0xe		/* DW_FORM_strp */
ee681d3
+	.uleb128 0x13		/* DW_AT_language */
ee681d3
+	.uleb128 0xb		/* DW_FORM_data1 */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0xe		/* DW_FORM_strp */
ee681d3
+	.uleb128 0x1b		/* DW_AT_comp_dir */
ee681d3
+	.uleb128 0xe		/* DW_FORM_strp */
ee681d3
+	.uleb128 0x11		/* DW_AT_low_pc */
ee681d3
+	.uleb128 0x1		/* DW_FORM_addr */
ee681d3
+	.uleb128 0x12		/* DW_AT_high_pc */
ee681d3
+	.uleb128 0x1		/* DW_FORM_addr */
ee681d3
+	.uleb128 0x52		/* DW_AT_entry_pc */
ee681d3
+	.uleb128 0x1		/* DW_FORM_addr */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x2		/* abbrev code */
ee681d3
+	.uleb128 0x39		/* DW_TAG_namespace */
ee681d3
+	.byte	0x1		/* DW_children_yes */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0x8		/* DW_FORM_string */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x3		/* abbrev code */
ee681d3
+	.uleb128 0x2		/* DW_TAG_class_type */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0x8		/* DW_FORM_string */
ee681d3
+	.uleb128 0x3c		/* DW_AT_declaration */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x4		/* abbrev code */
ee681d3
+	.uleb128 0x16		/* DW_TAG_typedef */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0x8		/* DW_FORM_string */
ee681d3
+	.uleb128 0x49		/* DW_AT_type */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x5		/* abbrev code */
ee681d3
+	.uleb128 0x34		/* DW_TAG_variable */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0x8		/* DW_FORM_string */
ee681d3
+	.uleb128 0x2007		/* DW_AT_MIPS_linkage_name */
ee681d3
+	.uleb128 0xe		/* DW_FORM_strp */
ee681d3
+	.uleb128 0x49		/* DW_AT_TYPE */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x3f		/* DW_AT_external */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.uleb128 0x3c		/* DW_AT_declaration */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x6		/* abbrev code */
ee681d3
+	.uleb128 0x2		/* DW_TAG_class_type */
ee681d3
+	.byte	0x1		/* DW_has_children_yes */
ee681d3
+	.uleb128 0x47		/* DW_AT_specification */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0xb		/* DW_AT_byte_size */
ee681d3
+	.uleb128 0xb		/* DW_FORM_data1 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x7		/* abbrev code */
ee681d3
+	.uleb128 0x2e		/* DW_TAG_subprogra */
ee681d3
+	.byte	0x1		/* DW_has_children_yes */
ee681d3
+	.uleb128 0x3f		/* DW_AT_external */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0x8		/* DW_FORM_string */
ee681d3
+	.uleb128 0x3c		/* DW_AT_declaration */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x8		/* abbrev code */
ee681d3
+	.uleb128 0x5		/* DW_TAG_formal_parameter */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x49		/* DW_AT_type */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x34		/* DW_AT_artificial */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x9		/* abbrev code */
ee681d3
+	.uleb128 0x5		/* DW_TAG_formal_parameter */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x49		/* DW_AT_type */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0xa		/* abbrev code */
ee681d3
+	.uleb128 0xf		/* DW_TAG_pointer_type */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0xb		/* DW_AT_byte_size */
ee681d3
+	.uleb128 0xb		/* DW_FORM_data1 */
ee681d3
+	.uleb128 0x49		/* DW_AT_type */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0xb		/* abbrev code */
ee681d3
+	.uleb128 0x15		/* DW_TAG_subroutine_type */
ee681d3
+	.byte	0x1		/* DW_has_children_yes */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0xc		/* abbrev code */
ee681d3
+	.uleb128 0x2e		/* DW_TAG_subprogram */
ee681d3
+	.byte	0x1		/* DW_has_children_yes */
ee681d3
+	.uleb128 0x47		/* DW_AT_specification */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x20		/* DW_AT_inline */
ee681d3
+	.uleb128 0xb		/* DW_FORM_data1 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0xd		/* abbrev code */
ee681d3
+	.uleb128 0x5		/* DW_TAG_formal_parameter */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0xe		/* DW_FORM_strp */
ee681d3
+	.uleb128 0x49		/* DW_AT_type */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x34		/* DW_AT_artificial */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0xe		/* abbrev code */
ee681d3
+	.uleb128 0x26		/* DW_TAG_const_type */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x49		/* DW_AT_type */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0xf		/* abbrev code */
ee681d3
+	.uleb128 0x2e		/* DW_TAG_subprogram */
ee681d3
+	.byte	0x1		/* DW_has_children_yes */
ee681d3
+	.uleb128 0x31		/* DW_AT_abstract_origin */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x11		/* DW_AT_low_pc */
ee681d3
+	.uleb128 0x1		/* DW_FORM_addr */
ee681d3
+	.uleb128 0x12		/* DW_AT_high_pc */
ee681d3
+	.uleb128 0x1		/* DW_FORM_addr */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x10		/* abbrev code */
ee681d3
+	.uleb128 0x5		/* DW_TAG_formal_parameter */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x31		/* DW_AT_abstract_origin */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x2		/* DW_AT_location */
ee681d3
+	.uleb128 0xa		/* DW_FORM_block1 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x11		/* abbrev code */
ee681d3
+	.uleb128 0x2e		/* DW_TAG_subprogram */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x3f		/* DW_AT_external */
ee681d3
+	.uleb128 0xc		/* DW_FORM_flag */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0xe		/* DW_FORM_strp */
ee681d3
+	.uleb128 0x49		/* DW_AT_type */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x11		/* DW_AT_low_pc */
ee681d3
+	.uleb128 0x1		/* DW_FORM_addr */
ee681d3
+	.uleb128 0x12		/* DW_AT_high_pc */
ee681d3
+	.uleb128 0x1		/* DW_FORM_addr */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x12		/* abbrev code */
ee681d3
+	.uleb128 0x24		/* DW_TAG_base_type */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0xb		/* DW_AT_byte_size */
ee681d3
+	.uleb128 0xb		/* DW_FORM_data1 */
ee681d3
+	.uleb128 0x3e		/* DW_AT_encoding */
ee681d3
+	.uleb128 0xb		/* DW_FORM_data1 */
ee681d3
+	.uleb128 0x3		/* DW_AT_name */
ee681d3
+	.uleb128 0x8		/* DW_FORM_string */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.uleb128 0x16		/* abbrev code */
ee681d3
+	.uleb128 0x34		/* DW_TAG_variable */
ee681d3
+	.byte	0x0		/* DW_has_children_no */
ee681d3
+	.uleb128 0x47		/* DW_AT_specification */
ee681d3
+	.uleb128 0x13		/* DW_FORM_ref4 */
ee681d3
+	.uleb128 0x2		/* DW_AT_location */
ee681d3
+	.uleb128 0xa		/* DW_FORM_block1 */
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.byte	0x0
ee681d3
+	.section	.debug_str
ee681d3
+.LASF0:
ee681d3
+	.string	"_ZN1N1fE"
ee681d3
+.LASF7:
ee681d3
+	.string	"this"
ee681d3
+.LASF6:
ee681d3
+	.string	""
ee681d3
+.LASF8:
ee681d3
+	.string	"main"
ee681d3
+.LASF1:
ee681d3
+	.string	"_ZN1N1cE"
ee681d3
+.LASF5:
ee681d3
+	.string	"pr11465.cc"
ee681d3
+.LASF4:
ee681d3
+	.string	"GNU C++ 4.4.2"
ee681d3
+	.ident	"GCC: (GNU) 4.4.2"
20f9f67
Index: gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.exp
dd46ae6
===================================================================
dd46ae6
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
20f9f67
+++ gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.exp	2010-07-22 11:59:29.000000000 +0200
ee681d3
@@ -0,0 +1,39 @@
ee681d3
+# Copyright 2010 Free Software Foundation, Inc.
ee681d3
+
ee681d3
+# This program is free software; you can redistribute it and/or modify
ee681d3
+# it under the terms of the GNU General Public License as published by
ee681d3
+# the Free Software Foundation; either version 3 of the License, or
ee681d3
+# (at your option) any later version.
ee681d3
+#
ee681d3
+# This program is distributed in the hope that it will be useful,
ee681d3
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ee681d3
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee681d3
+# GNU General Public License for more details.
ee681d3
+#
ee681d3
+# You should have received a copy of the GNU General Public License
ee681d3
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
ee681d3
+
ee681d3
+# This test can only be run on targets which support DWARF-2 and use gas.
ee681d3
+# For now pick a sampling of likely targets.
ee681d3
+if {![istarget *-*-linux*]
ee681d3
+    && ![istarget *-*-gnu*]
ee681d3
+    && ![istarget *-*-elf*]
ee681d3
+    && ![istarget *-*-openbsd*]
ee681d3
+    && ![istarget arm-*-eabi*]
ee681d3
+    && ![istarget powerpc-*-eabi*]} {
ee681d3
+    return 0  
ee681d3
+}
ee681d3
+
ee681d3
+set testfile "pr11465"
ee681d3
+set srcfile ${testfile}.S
ee681d3
+set executable ${testfile}.x
ee681d3
+set binfile ${objdir}/${subdir}/${executable}
ee681d3
+
ee681d3
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
ee681d3
+    return -1
ee681d3
+}
ee681d3
+
ee681d3
+clean_restart $executable
ee681d3
+
ee681d3
+# Test delayed physname computations
ee681d3
+gdb_test "p N::c.C" { = {void \(N::C \*, void \(\*\)\(N::C\)\)}.*}