rpms/gdb/F-13 gdb-archer-vla-ref-optimizedout.patch, NONE, 1.1 gdb-bz575292-delayed-physname.patch, 1.1, 1.2 gdb.spec, 1.437, 1.438

Jan Kratochvil jkratoch at fedoraproject.org
Thu May 13 17:25:20 UTC 2010


Author: jkratoch

Update of /cvs/pkgs/rpms/gdb/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv23620

Modified Files:
	gdb-bz575292-delayed-physname.patch gdb.spec 
Added Files:
	gdb-archer-vla-ref-optimizedout.patch 
Log Message:
* Thu May 13 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1-20.fc13
- Fix crash on VLA bound referencing an optimized-out variable (BZ 591879).
- Re-enable the BZ 575292 and BZ 585445 C++ fix using an updated patch.


gdb-archer-vla-ref-optimizedout.patch:
 dwarf2loc.c                                |    3 ++
 dwarf2read.c                               |    5 +++
 testsuite/gdb.dwarf2/dw2-bound-loclist.S   |   38 ++++++++++++++++++++++++++++-
 testsuite/gdb.dwarf2/dw2-bound-loclist.exp |    3 ++
 4 files changed, 48 insertions(+), 1 deletion(-)

--- NEW FILE gdb-archer-vla-ref-optimizedout.patch ---
commit a683bac73af74a757591672d89d720169c0b5ec9
Author: Jan Kratochvil <jan.kratochvil at redhat.com>
Date:   Thu May 13 18:08:30 2010 +0200

    Support DW_AT_upper_bound is referencing an optimized-out variable.
    https://bugzilla.redhat.com/show_bug.cgi?id=591879

--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -383,6 +383,9 @@ dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton,
   size_t size;
   struct value *val;
 
+  if (!dllbaton)
+    return 0;
+
   data = find_location_expression (dllbaton, &size,
 				   get_frame_address_in_block (frame));
   if (data == NULL)
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -11693,6 +11693,11 @@ dwarf2_attr_to_loclist_baton (struct attribute *attr, struct dwarf2_cu *cu)
 {
   struct dwarf2_loclist_baton *baton;
 
+  /* DW_AT_location of the referenced DIE may be missing if the referenced
+     variable has been optimized out.  */
+  if (!attr)
+    return NULL;
+
   if (!(attr_form_is_section_offset (attr)
 	/* ".debug_loc" may not exist at all, or the offset may be outside
 	   the section.  If so, fall through to the complaint in the
--- a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
@@ -51,6 +51,17 @@ vardata:
 	.4byte		.Llen_var-.Lcu1_begin	/* DW_AT_upper_bound */
 	.byte		0			/* End of children of die */
 
+	/* DW_AT_upper_bound is referencing an optimized-out variable.  */
+.Larrayb_type:
+	.uleb128	2			/* Abbrev: DW_TAG_array_type */
+	.4byte		.Lchar_type-.Lcu1_begin	/* DW_AT_type */
+
+	.uleb128	3			/* Abbrev: DW_TAG_subrange_type */
+	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
+	.byte		0			/* DW_AT_lower_bound */
+	.4byte		.Llenb_var-.Lcu1_begin	/* DW_AT_upper_bound */
+	.byte		0			/* End of children of die */
+
 .Luint_type:
 	.uleb128	4			/* Abbrev: DW_TAG_base_type */
 	.4byte		.Luint_str		/* DW_AT_name */
@@ -69,9 +80,24 @@ vardata:
 	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
 	.4byte		.Llen_loclist-.Lloclist	/* DW_AT_location */
 
+	/* optimized-out variable for b_string.  */
+.Llenb_var:
+	.uleb128	7			/* Abbrev: DW_TAG_variable artificial no DW_AT_location */
+	.byte		1			/* DW_AT_artificial */
+	.4byte		.Luint_type-.Lcu1_begin	/* DW_AT_type */
+
 	.uleb128	6			/* Abbrev: DW_TAG_variable DW_FORM_string */
 	.string		"a_string"		/* DW_AT_name */
-	.4byte		.Larray_type-.Lcu1_begin/* DW_AT_type */
+	.4byte		.Larray_type-.Lcu1_begin /* DW_AT_type */
+	.byte		2f - 1f			/* DW_AT_location */
+1:	.byte		3			/*   DW_OP_addr */
+	.4byte		vardata			/*   <addr> */
+2:
+
+	/* DW_AT_upper_bound is referencing an optimized-out variable.  */
+	.uleb128	6			/* Abbrev: DW_TAG_variable DW_FORM_string */
+	.string		"b_string"		/* DW_AT_name */
+	.4byte		.Larrayb_type-.Lcu1_begin /* DW_AT_type */
 	.byte		2f - 1f			/* DW_AT_location */
 1:	.byte		3			/*   DW_OP_addr */
 	.4byte		vardata			/*   <addr> */
@@ -164,6 +190,16 @@ vardata:
 	.byte		0x0			/* Terminator */
 	.byte		0x0			/* Terminator */
 
+	.uleb128	7			/* Abbrev code */
+	.uleb128	0x34			/* DW_TAG_variable */
+	.byte		0x0			/* no_children */
+	.uleb128	0x34			/* DW_AT_artificial */
+	.uleb128	0x0c			/* DW_FORM_flag */
+	.uleb128	0x49			/* DW_AT_type */
+	.uleb128	0x13			/* DW_FORM_ref4 */
+	.byte		0x0			/* Terminator */
+	.byte		0x0			/* Terminator */
+
 	.byte		0x0			/* Terminator */
 
 /* String table */
--- a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
@@ -46,3 +46,6 @@ if ![runto "*main"] {
 
 gdb_test "p a_string" { = "seen"}
 gdb_test "ptype a_string" {type = char \[4\]}
+
+gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"}
+gdb_test "ptype b_string" {type = char \[\]}

gdb-bz575292-delayed-physname.patch:
 dwarf2read.c                     |  122 ++++++++++++-
 testsuite/gdb.dwarf2/pr11465.S   |  355 +++++++++++++++++++++++++++++++++++++++
 testsuite/gdb.dwarf2/pr11465.exp |   39 ++++
 3 files changed, 505 insertions(+), 11 deletions(-)

Index: gdb-bz575292-delayed-physname.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/F-13/gdb-bz575292-delayed-physname.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- gdb-bz575292-delayed-physname.patch	22 Apr 2010 17:30:03 -0000	1.1
+++ gdb-bz575292-delayed-physname.patch	13 May 2010 17:25:19 -0000	1.2
@@ -1,61 +1,17 @@
-http://sourceware.org/ml/gdb-patches/2010-04/msg00641.html
-Subject: [RFA] Delayed physname computation
+Made more safe (but less effective) by using a linked list.
 
-Hi,
-
-This is actually a patch for symtab/11465.
-
-Basically, dwarf2_physname is constructing the name of a class method in 
-which one of the method's parameters is of a type that has not yet been 
-fully processed. (c_type_print_args will say "<incomplete type>"). Bad 
-things happen in/under c_type_print_args when you give it an incomplete 
-type like this.
-
-The solution I've implemented is to simply delay processing of method 
-physnames until the entire CU has been read/processed.
-
-Unfortunately, this is another example in which the compiler used may 
-alter the test outcome. As a result, I've had to hack in a test case 
-which is independent of the compiler. I would appreciate special 
-attention to the test source file (pr11465.S), which is an edited 
-version of gcc's --save-temps output.
-
-I have regression tested this on x86 and x86_64 linux. There aer no 
-regressions, and the new test now passes.
-
-Keith
-
-ChangeLog
-2010-04-20  Keith Seitz  <keiths at redhat.com>
-
-	* dwarf2read.c (struct delayed_method_info): New struct.
-	(struct dwarf2_cu): Add members method_index and method_list.
-	(struct dwarf2_per_cu_data): Add member num_methods.
-	(count_partial_methods): New function.
-	(scan_partial_symbols): Count methods for union, class, structure,
-	and interface types.
-	(add_partial_subprogram): Count methods here, too.
-	(add_to_method_list): New function.
-	(compute_delayed_physnames): New function.
-	(process_full_comp_unit): Allocate the CU's methods list,
-	compute delayed physnames, and free the method list.
-	(dwarf2_add_member_fn): For C++ and Java, delay the computation
-	of the physname until after the CU is read.
-	(load_partial_dies): Add subprogram and lexical block DIEs
-	for Java and C++, too.
-
-testsuite/ChangeLog
-2010-04-20  Keith Seitz  <keiths at redhat.com>
-
-	* gdb.dwarf2/pr11465.exp: New test.
-	* gdb.dwarf2/pr11465.S: New file.
-
-[ Ported for Fedora.  ]
-
-
---- ./gdb/dwarf2read.c	2010-04-22 18:53:51.000000000 +0200
-+++ ./gdb/dwarf2read.c	2010-04-22 18:53:16.000000000 +0200
-@@ -251,6 +251,26 @@ struct comp_unit_head
+Based on:
+	Re: [RFA] Delayed physname computation
+	http://sourceware.org/ml/gdb-patches/2010-05/msg00248.html
+
+Neither its obstack-leak.patch nor
+	[patch] Fix duplicate types for single DIE
+	http://sourceware.org/ml/gdb-patches/2010-05/msg00271.html
+is needed as the linked list is used instead.
+
+--- ./gdb/dwarf2read.c	2010-05-13 18:26:22.000000000 +0200
++++ ./gdb/dwarf2read.c	2010-05-13 18:45:04.000000000 +0200
+@@ -251,6 +251,28 @@ struct comp_unit_head
    unsigned int first_die_offset;
  };
  
@@ -63,6 +19,8 @@ testsuite/ChangeLog
 +   See comments for compute_delayed_physnames.  */
 +struct delayed_method_info
 +{
++  struct delayed_method_info *next;
++
 +  /* The type to which the method is attached, i.e., its parent class.  */
 +  struct type *type;
 +
@@ -82,30 +40,18 @@ testsuite/ChangeLog
  /* Internal state when decoding a particular compilation unit.  */
  struct dwarf2_cu
  {
-@@ -329,6 +349,11 @@ struct dwarf2_cu
+@@ -329,6 +351,10 @@ struct dwarf2_cu
    /* Header data from the line table, during full symbol processing.  */
    struct line_header *line_header;
  
 +  /* A list of methods which need to have physnames computed
 +     after all type information has been read.  */
-+  int method_index;
 +  struct delayed_method_info *method_list;
 +
    /* Mark used when releasing cached dies.  */
    unsigned int mark : 1;
  
-@@ -399,6 +424,10 @@ struct dwarf2_per_cu_data
-      or NULL for partial units (which do not have an associated
-      symtab).  */
-   struct partial_symtab *psymtab;
-+
-+  /* The total number of methods found in the CU.  This field is
-+     used to allocate memory for delayed physname processing.  */
-+  int num_methods;
- };
- 
- /* Entry in the signatured_types hash table.  */
-@@ -1208,6 +1237,9 @@ static void destroy_section (struct dwar
+@@ -1208,6 +1234,9 @@ static void destroy_section (struct dwar
  static struct dwarf2_locexpr_baton *dwarf2_attr_to_locexpr_baton
    (struct attribute *attr, struct dwarf2_cu *cu);
  
@@ -115,78 +61,21 @@ testsuite/ChangeLog
  /* Try to locate the sections we need for DWARF 2 debugging
     information and return true if we have enough to do something.  */
  
-@@ -2509,6 +2541,24 @@ create_all_comp_units (struct objfile *o
-   dwarf2_per_objfile->n_comp_units = n_comp_units;
- }
- 
-+/* Count the number of methods in partial die PDI and its children, if any.
-+   The result is recorded in CU.  This is used to give an upper bound
-+   for the number of slots needed in the delayed method list in the CU.
-+   See compute_delayed_physnames.  */
-+static void
-+count_partial_methods (struct partial_die_info *pdi, struct dwarf2_cu *cu)
-+{
-+  struct partial_die_info *die;
-+  for (die = pdi->die_child; die; die = die->die_sibling)
-+    {
-+      if (die->tag == DW_TAG_subprogram)
-+	++(cu->per_cu->num_methods);
-+
-+      if (die->has_children)
-+	count_partial_methods (die, cu);
-+    }
-+}
-+
- /* Process all loaded DIEs for compilation unit CU, starting at
-    FIRST_DIE.  The caller should pass NEED_PC == 1 if the compilation
-    unit DIE did not have PC info (DW_AT_low_pc and DW_AT_high_pc, or
-@@ -2546,10 +2596,12 @@ scan_partial_symbols (struct partial_die
- 	    case DW_TAG_subprogram:
- 	      add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu);
- 	      break;
-+	    case DW_TAG_union_type:
-+	      count_partial_methods (pdi, cu);
-+	      /* fall through */
- 	    case DW_TAG_variable:
- 	    case DW_TAG_constant:
- 	    case DW_TAG_typedef:
--	    case DW_TAG_union_type:
- 	      if (!pdi->is_declaration)
- 		{
- 		  add_partial_symbol (pdi, cu);
-@@ -2558,10 +2610,9 @@ scan_partial_symbols (struct partial_die
- 	    case DW_TAG_class_type:
- 	    case DW_TAG_interface_type:
- 	    case DW_TAG_structure_type:
-+	      count_partial_methods (pdi, cu);
- 	      if (!pdi->is_declaration)
--		{
--		  add_partial_symbol (pdi, cu);
--		}
-+		add_partial_symbol (pdi, cu);
- 	      break;
- 	    case DW_TAG_enumeration_type:
- 	      if (!pdi->is_declaration)
-@@ -2921,6 +2972,7 @@ add_partial_subprogram (struct partial_d
- {
-   if (pdi->tag == DW_TAG_subprogram)
-     {
-+      count_partial_methods (pdi, cu);
-       if (pdi->has_pc_info)
-         {
-           if (pdi->lowpc < *lowpc)
-@@ -3435,6 +3487,41 @@ load_full_comp_unit (struct dwarf2_per_c
+@@ -3435,6 +3464,58 @@ load_full_comp_unit (struct dwarf2_per_c
    discard_cleanups (free_cu_cleanup);
  }
  
++/* Add a DIE to the delayed physname list.  */
 +static void
 +add_to_method_list (struct type *type, int fnfield_index, int index,
 +		    const char *name, struct die_info *die,
 +		    struct dwarf2_cu *cu)
 +{
 +  struct delayed_method_info *mi;
-+  gdb_assert (cu->method_index < cu->per_cu->num_methods);
-+  mi = &cu->method_list[cu->method_index++];
++
++  mi = xmalloc (sizeof (*mi));
++  mi->next = cu->method_list;
++  cu->method_list = mi;
 +  mi->type = type;
 +  mi->fnfield_index = fnfield_index;
 +  mi->index = index;
@@ -202,32 +91,52 @@ testsuite/ChangeLog
 +static void
 +compute_delayed_physnames (struct dwarf2_cu *cu)
 +{
-+  int i;
-+  for (i = 0; i < cu->method_index; ++i)
++  struct delayed_method_info *mi;
++  
++  for (mi = cu->method_list; mi; mi = mi->next)
 +    {
 +      char *physname;
-+      struct delayed_method_info *mi = &cu->method_list[i];
 +      struct fn_fieldlist *fn_flp
 +	= &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
 +      physname = (char *) dwarf2_physname ((char *) mi->name, mi->die, cu);
-+      fn_flp->fn_fields[mi->index].physname = physname ? physname : "";      
++      fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
++    }
++}
++
++static void
++method_list_cleanup (void *arg)
++{
++  struct delayed_method_info **method_list_pointer = arg;
++
++  while (*method_list_pointer)
++    {
++      struct delayed_method_info *mi = *method_list_pointer;
++
++      *method_list_pointer = mi->next;
++      xfree (mi);
 +    }
 +}
 +
  /* Generate full symbol information for PST and CU, whose DIEs have
     already been loaded into memory.  */
  
-@@ -3457,11 +3544,29 @@ process_full_comp_unit (struct dwarf2_pe
+@@ -3447,7 +3528,7 @@ process_full_comp_unit (struct dwarf2_pe
+   bfd *abfd = objfile->obfd;
+   CORE_ADDR lowpc, highpc;
+   struct symtab *symtab;
+-  struct cleanup *back_to;
++  struct cleanup *back_to, *delayed_list_cleanup;
+   CORE_ADDR baseaddr;
+ 
+   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+@@ -3457,11 +3538,22 @@ process_full_comp_unit (struct dwarf2_pe
  
    cu->list_in_scope = &file_symbols;
  
 +  /* If methods were found in the partial symbol table, we allocate one
 +     big buffer to hold the entire delayed list for the CU.  */
-+  if (per_cu->num_methods)
-+    {
-+      cu->method_list
-+	= xmalloc (per_cu->num_methods * sizeof (struct delayed_method_info));
-+    }
++  delayed_list_cleanup = make_cleanup (method_list_cleanup,
++				       &cu->method_list);
 +
    dwarf2_find_base_address (cu->dies, cu);
  
@@ -237,17 +146,13 @@ testsuite/ChangeLog
 +  /* Now that we have processed all the DIEs in the CU, all the types 
 +     should be complete, and it should now be safe to compute all of the
 +     physnames.  */
-+  if (per_cu->num_methods)
-+    {
-+      compute_delayed_physnames (cu);
-+      xfree (cu->method_list);
-+      cu->method_list = NULL;
-+    }
++  compute_delayed_physnames (cu);
++  do_cleanups (delayed_list_cleanup);
 +
    /* Some compilers don't define a DW_AT_high_pc attribute for the
       compilation unit.  If the DW_AT_high_pc is missing, synthesize
       it, by scanning the DIE's below the compilation unit.  */
-@@ -5093,7 +5198,6 @@ dwarf2_add_member_fn (struct field_info 
+@@ -5093,7 +5185,6 @@ dwarf2_add_member_fn (struct field_info 
    int i;
    struct fn_field *fnp;
    char *fieldname;
@@ -255,7 +160,7 @@ testsuite/ChangeLog
    struct nextfnfield *new_fnfield;
    struct type *this_type;
  
-@@ -5105,9 +5209,6 @@ dwarf2_add_member_fn (struct field_info 
+@@ -5105,9 +5196,6 @@ dwarf2_add_member_fn (struct field_info 
    if (fieldname == NULL)
      return;
  
@@ -265,7 +170,7 @@ testsuite/ChangeLog
    /* Look up member function name in fieldlist.  */
    for (i = 0; i < fip->nfnfields; i++)
      {
-@@ -5133,7 +5234,7 @@ dwarf2_add_member_fn (struct field_info 
+@@ -5133,7 +5221,7 @@ dwarf2_add_member_fn (struct field_info 
        flp->name = fieldname;
        flp->length = 0;
        flp->head = NULL;
@@ -274,7 +179,7 @@ testsuite/ChangeLog
      }
  
    /* Create a new member function field and chain it to the field list
-@@ -5147,9 +5248,19 @@ dwarf2_add_member_fn (struct field_info 
+@@ -5147,9 +5235,19 @@ dwarf2_add_member_fn (struct field_info 
  
    /* Fill in the member function field info.  */
    fnp = &new_fnfield->fnfield;
@@ -297,16 +202,16 @@ testsuite/ChangeLog
    fnp->type = alloc_type (objfile);
    this_type = read_type_die (die, cu);
    if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC)
-@@ -5175,7 +5286,7 @@ dwarf2_add_member_fn (struct field_info 
+@@ -5175,7 +5273,7 @@ dwarf2_add_member_fn (struct field_info 
      }
    else
      complaint (&symfile_complaints, _("member function type missing for '%s'"),
 -	       physname);
-+	       dwarf2_physname (fieldname, die, cu));
++	       dwarf2_full_name (fieldname, die, cu));
  
    /* Get fcontext from DW_AT_containing_type if present.  */
    if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL)
-@@ -7493,7 +7604,9 @@ load_partial_dies (bfd *abfd, gdb_byte *
+@@ -7500,7 +7598,9 @@ load_partial_dies (bfd *abfd, gdb_byte *
  		      || last_die->tag == DW_TAG_interface_type
  		      || last_die->tag == DW_TAG_structure_type
  		      || last_die->tag == DW_TAG_union_type))
@@ -318,8 +223,8 @@ testsuite/ChangeLog
  		      || last_die->tag == DW_TAG_lexical_block))))
  	{
 --- ./gdb/testsuite/gdb.dwarf2/pr11465.S	1970-01-01 01:00:00.000000000 +0100
-+++ ./gdb/testsuite/gdb.dwarf2/pr11465.S	2010-04-22 18:52:36.000000000 +0200
-@@ -0,0 +1,415 @@
++++ ./gdb/testsuite/gdb.dwarf2/pr11465.S	2010-05-13 18:39:00.000000000 +0200
+@@ -0,0 +1,355 @@
 +/* Copyright 2010 Free Software Foundation, Inc.
 +
 +   This program is free software; you can redistribute it and/or modify
@@ -357,14 +262,14 @@ testsuite/ChangeLog
 +    }
 +*/
 +
-+	.section	.text
++	.text
 +_ZN1N1cE:	
 +	.section	.debug_info
 +d:
 +	.long	.Ldebug_info_end - 1f /* Length of CU info */
 +1:
-+	.value	0x2		/* DWARF version number */
-+	.Long	.Ldebug_abbrev0	/* Abbrev offset */
++	.2byte	0x2		/* DWARF version number */
++	.long	.Ldebug_abbrev0	/* Abbrev offset */
 +	.byte	0x4		/* Pointer size */
 +dieb:	.uleb128 0x1		/* DW_TAG_compile_unit */
 +	.long	.LASF4		/* DW_AT_producer */
@@ -372,114 +277,94 @@ testsuite/ChangeLog
 +	.long	.LASF5		/* DW_AT_name */
 +	.long	.LASF6		/* DW_AT_comp_dir */
 +	.long	0x0		/* DW_AT_low_pc */
++	.long	0x0		/* DW_AT_high_pc */
 +	.long	0x0		/* DW_AT_entry_pc */
-+	.long	0x0		/* DW_AT_ranges */
-+	.long	0x0		/* DW_AT_stmt_list */
 +die29:	.uleb128 0x2		/* DW_TAG_namespace */
 +	.string	"N"		/* DW_AT_name */
-+	.byte	0x1		/* DW_AT_decl_file */
-+	.byte	0x1		/* DW_AT_decl_line */
-+	.long	die5e		/* DW_AT_sibling */
 +die32:	.uleb128 0x3		/* DW_TAG_class_type */
 +	.string	"C"		/* DW_AT_name */
 +	.byte	0x1		/* DW_AT_declaration */
 +die36:	.uleb128 0x4		/* DW_TAG_typedef */
 +	.string	"u"		/* DW_AT_name */
-+	.byte	0x1		/* DW_AT_decl_file */
-+	.byte	0x7		/* DW_AT_decl_line */
-+	.long	die7e		/* DW_AT_type */
++	.long	die7e-d		/* DW_AT_type */
 +die3f:	.uleb128 0x5		/* DW_TAG_variable */
 +	.string	"f"		/* DW_AT_name */
-+	.byte	0x1		/* DW_AT_decl_file */
-+	.byte	0x8		/* DW_AT_decl_line */
 +	.long	.LASF0		/* DW_AT_MIPS_linkage_name */
-+	.long	die36		/* DW_AT_type */
++	.long	die36-d		/* DW_AT_type */
 +	.byte	0x1		/* DW_AT_external */
 +	.byte	0x1		/* DW_AT_declaration */
 +die4e:	.uleb128 0x5		/* DW_TAG_variable */
 +	.string	"c"		/* DW_AT_name */
-+	.byte	0x1		/* DW_AT_decl_file */
-+	.byte	0x9		/* DW_AT_decl_line */
 +	.long	.LASF1		/* DW_AT_MIPS_linkage_name */
-+	.long	die5e		/* DW_AT_type */
++	.long	die5e-d		/* DW_AT_type */
 +	.byte	0x1		/* DW_AT_external */
 +	.byte	0x1		/* DW_AT_declaration */
 +	.byte	0x0
 +die5e:	.uleb128 0x6		/* DW_TAG_class_type */
-+	.long	die32		/* DW_AT_specification */
++	.long	die32-d		/* DW_AT_specification */
 +	.byte	0x1		/* DW_AT_byte_size */
-+	.byte	0x1		/* DW_AT_decl_file */
-+	.byte	0x2		/* DW_AT_decl_line */
-+	.long	die7e		/* DW_AT_sibling */
 +die6a:	.uleb128 0x7		/* DW_TAG_subprogram */
 +	.byte	0x1		/* DW_AT_external */
 +	.string	"C"		/* DW_AT_name */
-+	.byte	0x1		/* DW_AT_decl_file */
-+	.byte	0x5		/* DW_AT_decl_line */
 +	.byte	0x1		/* DW_AT_declaration */
 +die71:	.uleb128 0x8		/* DW_TAG_formal_parameter */
-+	.long	die8f		/* DW_AT_type */
++	.long	die8f-d		/* DW_AT_type */
 +	.byte	0x1		/* DW_AT_artificial */
 +die77:	.uleb128 0x9		/* DW_TAG_formal_parameter */
-+	.long	die7e		/* DW_AT_type */
++	.long	die7e-d		/* DW_AT_type */
 +	.byte	0x0
 +	.byte	0x0
 +die7e:	.uleb128 0xa		/* DW_TAG_pointer_type */
 +	.byte	0x4		/* DW_AT_byte_size */
-+	.long	die84		/* DW_AT_type */
++	.long	die84-d		/* DW_AT_type */
 +die84:	.uleb128 0xb		/* DW_TAG_subroutine_type */
-+	.long	die8f		/* DW_AT_sibling */
 +die89:	.uleb128 0x9		/* DW_TAG_formal_parameter */
-+	.long	die5e		/* DW_AT_type */
++	.long	die5e-d		/* DW_AT_type */
 +	.byte	0x0
 +die8f:	.uleb128 0xa		/* DW_TAG_pointer_type */
 +	.byte	0x4		/* DW_AT_byte_size */
-+	.long	die5e		/* DW_AT_type */
++	.long	die5e-d		/* DW_AT_type */
 +die95:	.uleb128 0xc		/* DW_TAG_subprogram */
-+	.long	die6a		/* DW_AT_specification */
++	.long	die6a-d		/* DW_AT_specification */
 +	.byte	0x2		/* DW_AT_inline */
-+	.long	dieaf		/* DW_AT_sibling */
 +die9f:	.uleb128 0xd		/* DW_TAG_formal_parameter */
 +	.long	.LASF7		/* DW_AT_name */
-+	.long	dieaf		/* DW_AT_type */
++	.long	dieaf-d		/* DW_AT_type */
 +	.byte	0x1		/* DW_AT_artificial */
 +diea9:	.uleb128 0x9		/* DW_TAG_formal_parameter */
-+	.long	die7e		/* DW_AT_type */
++	.long	die7e-d		/* DW_AT_type */
 +	.byte	0x0
 +dieaf:	.uleb128 0xe		/* DW_TAG_const_type */
-+	.long	die8f		/* DW_AT_type */
++	.long	die8f-d		/* DW_AT_type */
 +dieb4:	.uleb128 0xf		/* DW_TAG_subprogram */
-+	.long	0x95		/* DW_AT_abstract_origin */
-+	.long	.LFB2		/* DW_AT_low_pc */
-+	.long	.LFE2		/* DW_AT_high_pc */
-+	.long	.LLST0		/* DW_AT_frame_base */
-+	.long	dieda		/* DW_AT_sibling */
++	.long	die95-d		/* DW_AT_abstract_origin */
++	.long	_ZN1N1cE	/* DW_AT_low_pc */
++	.long	_ZN1N1cE	/* DW_AT_high_pc */
 +diec9:	.uleb128 0x10		/* DW_TAG_subprogram */
-+	.long	0x9f		/* DW_AT_abstract_origin */
-+	.byte	0x2		/* DW_AT_location */
-+	.byte	0x91
-+	.sleb128 0
++	.long	die9f-d		/* DW_AT_abstract_origin */
++	.byte	2f-1f		/* DW_AT_location */
++1:
++	.byte	0x50		/* DW_OP_reg0 */
++2:
 +died1:	.uleb128 0x10		/* DW_TAG_formal_parameter */
-+	.long	0xa9		/* DW_AT_abstract_origin */
-+	.byte	0x2		/* DW_AT_location */
-+	.byte	0x91
-+	.sleb128 4
++	.long	diea9-d		/* DW_AT_abstract_origin */
++	.byte	2f-1f		/* DW_AT_location */
++1:
++	.byte	0x51		/* DW_OP_reg1 */
++2:
 +	.byte	0x0
 +dieda:	.uleb128 0x11		/* DW_TAG_subprogram */
 +	.byte	0x1		/* DW_AT_external */
 +	.long	.LASF8		/* DW_AT_name */
-+	.byte	0x1		/* DW_AT_decl_file */
-+	.byte	0xc		/* DW_AT_decl_line */
-+	.long	dief2		/* DW_AT_type */
-+	.long	.LFB3		/* DW_AT_low_pc */
-+	.long	.LFE3		/* DW_AT_high_pc */
-+	.long	.LLST1		/* DW_AT_frame_base */
++	.long	dief2-d		/* DW_AT_type */
++	.long	_ZN1N1cE	/* DW_AT_low_pc */
++	.long	_ZN1N1cE	/* DW_AT_high_pc */
 +dief2:	.uleb128 0x12		/* DW_TAG_base_type */
 +	.byte	0x4		/* DW_AT_byte_size */
 +	.byte	0x5		/* DW_AT_encoding */
 +	.string	"int"		/* DW_AT_name */
 +die149:	.uleb128 0x16		/* DW_TAG_variable */
-+	.long	die4e		/* DW_AT_specification */
++	.long	die4e-d		/* DW_AT_specification */
 +	.byte	0x5		/* DW_AT_location */
 +	.byte	0x3
 +	.long	_ZN1N1cE
@@ -500,12 +385,10 @@ testsuite/ChangeLog
 +	.uleb128 0xe		/* DW_FORM_strp */
 +	.uleb128 0x11		/* DW_AT_low_pc */
 +	.uleb128 0x1		/* DW_FORM_addr */
++	.uleb128 0x12		/* DW_AT_high_pc */
++	.uleb128 0x1		/* DW_FORM_addr */
 +	.uleb128 0x52		/* DW_AT_entry_pc */
 +	.uleb128 0x1		/* DW_FORM_addr */
-+	.uleb128 0x55		/* DW_AT_ranges */
-+	.uleb128 0x6		/* DW_FORM_data4 */
-+	.uleb128 0x10		/* DW_AT_stmt_list */
-+	.uleb128 0x6		/* DW_FORM_data4 */
 +	.byte	0x0
 +	.byte	0x0
 +	.uleb128 0x2		/* abbrev code */
@@ -513,12 +396,6 @@ testsuite/ChangeLog
 +	.byte	0x1		/* DW_children_yes */
 +	.uleb128 0x3		/* DW_AT_name */
 +	.uleb128 0x8		/* DW_FORM_string */
-+	.uleb128 0x3a		/* DW_AT_decl_file */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x3b		/* DW_AT_decl_line */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x1		/* DW_AT_sibling */
-+	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.byte	0x0
 +	.byte	0x0
 +	.uleb128 0x3		/* abbrev code */
@@ -535,10 +412,6 @@ testsuite/ChangeLog
 +	.byte	0x0		/* DW_has_children_no */
 +	.uleb128 0x3		/* DW_AT_name */
 +	.uleb128 0x8		/* DW_FORM_string */
-+	.uleb128 0x3a		/* DW_AT_decl_file */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x3b		/* DW_AT_decl_line */
-+	.uleb128 0xb		/* DW_FORM_data1 */
 +	.uleb128 0x49		/* DW_AT_type */
 +	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.byte	0x0
@@ -548,10 +421,6 @@ testsuite/ChangeLog
 +	.byte	0x0		/* DW_has_children_no */
 +	.uleb128 0x3		/* DW_AT_name */
 +	.uleb128 0x8		/* DW_FORM_string */
-+	.uleb128 0x3a		/* DW_AT_decl_file */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x3b		/* DW_AT_decl_line */
-+	.uleb128 0xb		/* DW_FORM_data1 */
 +	.uleb128 0x2007		/* DW_AT_MIPS_linkage_name */
 +	.uleb128 0xe		/* DW_FORM_strp */
 +	.uleb128 0x49		/* DW_AT_TYPE */
@@ -569,12 +438,6 @@ testsuite/ChangeLog
 +	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.uleb128 0xb		/* DW_AT_byte_size */
 +	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x3a		/* DW_AT_decl_file */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x3b		/* DW_AT_decl_line */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x1		/* DW_AT_sibling */
-+	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.byte	0x0
 +	.byte	0x0
 +	.uleb128 0x7		/* abbrev code */
@@ -584,10 +447,6 @@ testsuite/ChangeLog
 +	.uleb128 0xc		/* DW_FORM_flag */
 +	.uleb128 0x3		/* DW_AT_name */
 +	.uleb128 0x8		/* DW_FORM_string */
-+	.uleb128 0x3a		/* DW_AT_decl_file */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x3b		/* DW_AT_decl_line */
-+	.uleb128 0xb		/* DW_FORM_data1 */
 +	.uleb128 0x3c		/* DW_AT_declaration */
 +	.uleb128 0xc		/* DW_FORM_flag */
 +	.byte	0x0
@@ -620,8 +479,6 @@ testsuite/ChangeLog
 +	.uleb128 0xb		/* abbrev code */
 +	.uleb128 0x15		/* DW_TAG_subroutine_type */
 +	.byte	0x1		/* DW_has_children_yes */
-+	.uleb128 0x1		/* DW_AT_sibling */
-+	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.byte	0x0
 +	.byte	0x0
 +	.uleb128 0xc		/* abbrev code */
@@ -631,8 +488,6 @@ testsuite/ChangeLog
 +	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.uleb128 0x20		/* DW_AT_inline */
 +	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x1		/* DW_AT_sibling */
-+	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.byte	0x0
 +	.byte	0x0
 +	.uleb128 0xd		/* abbrev code */
@@ -662,10 +517,6 @@ testsuite/ChangeLog
 +	.uleb128 0x1		/* DW_FORM_addr */
 +	.uleb128 0x12		/* DW_AT_high_pc */
 +	.uleb128 0x1		/* DW_FORM_addr */
-+	.uleb128 0x40		/* DW_AT_frame_base */
-+	.uleb128 0x6		/* DW_FORM_data4 */
-+	.uleb128 0x1		/* DW_AT_sibling */
-+	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.byte	0x0
 +	.byte	0x0
 +	.uleb128 0x10		/* abbrev code */
@@ -684,18 +535,12 @@ testsuite/ChangeLog
 +	.uleb128 0xc		/* DW_FORM_flag */
 +	.uleb128 0x3		/* DW_AT_name */
 +	.uleb128 0xe		/* DW_FORM_strp */
-+	.uleb128 0x3a		/* DW_AT_decl_file */
-+	.uleb128 0xb		/* DW_FORM_data1 */
-+	.uleb128 0x3b		/* DW_AT_decl_line */
-+	.uleb128 0xb		/* DW_FORM_data1 */
 +	.uleb128 0x49		/* DW_AT_type */
 +	.uleb128 0x13		/* DW_FORM_ref4 */
 +	.uleb128 0x11		/* DW_AT_low_pc */
 +	.uleb128 0x1		/* DW_FORM_addr */
 +	.uleb128 0x12		/* DW_AT_high_pc */
 +	.uleb128 0x1		/* DW_FORM_addr */
-+	.uleb128 0x40		/* DW_AT_frame_base */
-+	.uleb128 0x6		/* DW_FORM_data4 */
 +	.byte	0x0
 +	.byte	0x0
 +	.uleb128 0x12		/* abbrev code */
@@ -736,8 +581,8 @@ testsuite/ChangeLog
 +	.string	"GNU C++ 4.4.2"
 +	.ident	"GCC: (GNU) 4.4.2"
 --- ./gdb/testsuite/gdb.dwarf2/pr11465.exp	1970-01-01 01:00:00.000000000 +0100
-+++ ./gdb/testsuite/gdb.dwarf2/pr11465.exp	2010-04-22 18:52:36.000000000 +0200
-@@ -0,0 +1,40 @@
++++ ./gdb/testsuite/gdb.dwarf2/pr11465.exp	2010-05-13 18:39:00.000000000 +0200
+@@ -0,0 +1,39 @@
 +# Copyright 2010 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
@@ -769,7 +614,6 @@ testsuite/ChangeLog
 +set executable ${testfile}.x
 +set binfile ${objdir}/${subdir}/${executable}
 +
-+# First try referencing DW_AT_frame_base which is not defined.
 +if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
 +    return -1
 +}
@@ -777,4 +621,4 @@ testsuite/ChangeLog
 +clean_restart $executable
 +
 +# Test delayed physname computations
-+gdb_test "p N::c.C" "\\$\[0-9]+ = \\{void \\(N::C \\*, void \\(\\*\\)\\(N::C\\)\\)\\}.*"
++gdb_test "p N::c.C" { = {void \(N::C \*, void \(\*\)\(N::C\)\)}.*}


Index: gdb.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/F-13/gdb.spec,v
retrieving revision 1.437
retrieving revision 1.438
diff -u -p -r1.437 -r1.438
--- gdb.spec	12 May 2010 20:33:28 -0000	1.437
+++ gdb.spec	13 May 2010 17:25:19 -0000	1.438
@@ -36,7 +36,7 @@ Version: 7.1
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 19%{?_with_upstream:.upstream}%{dist}
+Release: 20%{?_with_upstream:.upstream}%{dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain
 Group: Development/Debuggers
@@ -455,6 +455,7 @@ Patch449: gdb-bz578250-avx-10of10-ppc.pa
 
 # Fix crash on C++ types in some debug info files (BZ 575292, Keith Seitz).
 # Temporarily workaround the crash of BZ 575292 as there was now BZ 585445.
+# Re-enable the BZ 575292 and BZ 585445 C++ fix using an updated patch.
 Patch451: gdb-bz575292-delayed-physname.patch
 Patch455: gdb-bz575292-void-workaround.patch
 
@@ -476,6 +477,9 @@ Patch458: gdb-archer-vla-test-oom.patch
 # Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623).
 Patch459: gdb-moribund-utrace-workaround.patch
 
+# Fix crash on VLA bound referencing an optimized-out variable (BZ 591879).
+Patch460: gdb-archer-vla-ref-optimizedout.patch
+
 BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
 Requires: readline%{?_isa}
 BuildRequires: readline-devel%{?_isa}
@@ -741,8 +745,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc
 %patch447 -p1
 %patch448 -p1
 %patch449 -p1
-# Avoid internal error by disabling the previous BZ 575292 fix (BZ 585445).
-#patch451 -p1
+%patch451 -p1
 %patch452 -p1
 %patch453 -p1
 %patch454 -p1
@@ -751,6 +754,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc
 %patch457 -p1
 %patch458 -p1
 %patch459 -p1
+%patch460 -p1
 
 %patch415 -p1
 %patch393 -p1
@@ -1083,6 +1087,10 @@ fi
 %endif
 
 %changelog
+* Thu May 13 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1-20.fc13
+- Fix crash on VLA bound referencing an optimized-out variable (BZ 591879).
+- Re-enable the BZ 575292 and BZ 585445 C++ fix using an updated patch.
+
 * Wed May 12 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1-19.fc13
 - Backport <tab>-completion bug on anonymous structure fields (BZ 590648).
 - testsuite: Fix gdb.base/vla-overflow.exp FAILing on s390x (BZ 590635).



More information about the scm-commits mailing list