public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-fedora13: Merge remote branch 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora13
@ 2010-04-16 10:08 jkratoch
  0 siblings, 0 replies; 3+ messages in thread
From: jkratoch @ 2010-04-16 10:08 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fedora13 has been updated
       via  ab5cf36c5d0ba4439f581ce1a717dcc2d8b516b4 (commit)
       via  3196f2b8da1570a72feaecc52231b469226ec779 (commit)
      from  1904b0b2e1655c3b94333f65e93887607634b4a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit ab5cf36c5d0ba4439f581ce1a717dcc2d8b516b4
Merge: 1904b0b2e1655c3b94333f65e93887607634b4a6 3196f2b8da1570a72feaecc52231b469226ec779
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Apr 16 12:08:43 2010 +0200

    Merge remote branch 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora13

-----------------------------------------------------------------------

Summary of changes:
 gdb/gdbtypes.c |   50 ++++++++++++++++++++++++++++----------------------
 1 files changed, 28 insertions(+), 22 deletions(-)

First 500 lines of diff:
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 3691331..e8e3060 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -3324,7 +3324,7 @@ copy_type_recursive_1 (struct objfile *objfile,
   TYPE_DYNAMIC (new_type) = 0;
 
   /* For range types, copy the bounds information. */
-  if (TYPE_CODE (type) == TYPE_CODE_RANGE)
+  if (TYPE_CODE (new_type) == TYPE_CODE_RANGE)
     {
       TYPE_RANGE_DATA (new_type) = xmalloc (sizeof (struct range_bounds));
       *TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type);
@@ -3335,9 +3335,10 @@ copy_type_recursive_1 (struct objfile *objfile,
 	  break;
 	case RANGE_BOUND_KIND_DWARF_BLOCK:
 	  /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.  */
-	  if (TYPE_NOT_ALLOCATED (type)
-	      || TYPE_NOT_ASSOCIATED (type))
+	     it is expected to be made constant by CHECK_TYPEDEF.
+	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	     */
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
 	    TYPE_RANGE_DATA (new_type)->low.u.dwarf_block = NULL;
 	  else
 	    {
@@ -3348,9 +3349,10 @@ copy_type_recursive_1 (struct objfile *objfile,
 	  break;
 	case RANGE_BOUND_KIND_DWARF_LOCLIST:
 	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.  */
-	  if (TYPE_NOT_ALLOCATED (type)
-	      || TYPE_NOT_ASSOCIATED (type))
+	     it is expected to be made constant by CHECK_TYPEDEF.
+	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	     */
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
 	    {
 	      TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist = NULL;
 	      TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type = NULL;
@@ -3371,9 +3373,10 @@ copy_type_recursive_1 (struct objfile *objfile,
 	  break;
 	case RANGE_BOUND_KIND_DWARF_BLOCK:
 	  /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.  */
-	  if (TYPE_NOT_ALLOCATED (type)
-	      || TYPE_NOT_ASSOCIATED (type))
+	     it is expected to be made constant by CHECK_TYPEDEF.
+	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	     */
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
 	    TYPE_RANGE_DATA (new_type)->high.u.dwarf_block = NULL;
 	  else
 	    {
@@ -3384,9 +3387,10 @@ copy_type_recursive_1 (struct objfile *objfile,
 	  break;
 	case RANGE_BOUND_KIND_DWARF_LOCLIST:
 	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.  */
-	  if (TYPE_NOT_ALLOCATED (type)
-	      || TYPE_NOT_ASSOCIATED (type))
+	     it is expected to be made constant by CHECK_TYPEDEF.
+	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	     */
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
 	    {
 	      TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.loclist = NULL;
 	      TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type = NULL;
@@ -3407,9 +3411,10 @@ copy_type_recursive_1 (struct objfile *objfile,
 	  break;
 	case RANGE_BOUND_KIND_DWARF_BLOCK:
 	  /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.  */
-	  if (TYPE_NOT_ALLOCATED (type)
-	      || TYPE_NOT_ASSOCIATED (type))
+	     it is expected to be made constant by CHECK_TYPEDEF.
+	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	     */
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
 	    TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_block = NULL;
 	  else
 	    {
@@ -3421,9 +3426,10 @@ copy_type_recursive_1 (struct objfile *objfile,
 	  break;
 	case RANGE_BOUND_KIND_DWARF_LOCLIST:
 	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.  */
-	  if (TYPE_NOT_ALLOCATED (type)
-	      || TYPE_NOT_ASSOCIATED (type))
+	     it is expected to be made constant by CHECK_TYPEDEF.
+	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	     */
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
 	    {
 	      TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.loclist
 		= NULL;
@@ -3442,10 +3448,10 @@ copy_type_recursive_1 (struct objfile *objfile,
 	}
 
       /* Convert TYPE_RANGE_HIGH_BOUND_IS_COUNT into a regular bound.  */
-      if (TYPE_RANGE_HIGH_BOUND_IS_COUNT (type))
+      if (TYPE_RANGE_HIGH_BOUND_IS_COUNT (new_type))
 	{
-	  TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (type)
-				       + TYPE_HIGH_BOUND (type) - 1;
+	  TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type)
+				       + TYPE_HIGH_BOUND (new_type) - 1;
 	  TYPE_RANGE_HIGH_BOUND_IS_COUNT (new_type) = 0;
 	}
     }


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [SCM]  archer-jankratochvil-fedora13: Merge remote branch 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora13
@ 2010-04-16 22:15 jkratoch
  0 siblings, 0 replies; 3+ messages in thread
From: jkratoch @ 2010-04-16 22:15 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fedora13 has been updated
       via  39998c496988faaa1509cc6ab76b5c4777659bf4 (commit)
       via  525771b1d923cc7d4de99440e0c826af456f8af5 (commit)
      from  ab5cf36c5d0ba4439f581ce1a717dcc2d8b516b4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 39998c496988faaa1509cc6ab76b5c4777659bf4
Merge: ab5cf36c5d0ba4439f581ce1a717dcc2d8b516b4 525771b1d923cc7d4de99440e0c826af456f8af5
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Apr 17 00:15:41 2010 +0200

    Merge remote branch 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora13

-----------------------------------------------------------------------

Summary of changes:
 gdb/dwarf2loc.c                                |   28 ++---
 gdb/dwarf2loc.h                                |    4 +-
 gdb/gdbtypes.c                                 |  148 +++++++++++++-----------
 gdb/gdbtypes.h                                 |   11 --
 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp |    9 +-
 5 files changed, 102 insertions(+), 98 deletions(-)

First 500 lines of diff:
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 7550ac6..20dcacd 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -371,31 +371,29 @@ dwarf_locexpr_baton_eval (struct dwarf2_locexpr_baton *dlbaton)
 }
 
 /* Evaluate DWARF location list at DLLBATON expecting it produces exactly one
-   CORE_ADDR result on the DWARF stack stack.  */
+   CORE_ADDR result stored to *ADDRP on the DWARF stack stack.  If the result
+   could not be found return zero and keep *ADDRP unchanged.  */
 
-CORE_ADDR
+int
 dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton,
-			  struct type *type)
+			  struct type *type, CORE_ADDR *addrp)
 {
   struct frame_info *frame = get_selected_frame (NULL);
-  CORE_ADDR frame_pc = get_frame_address_in_block (frame);
   gdb_byte *data;
   size_t size;
   struct value *val;
 
-  data = find_location_expression (dllbaton, &size, frame_pc);
-  if (data)
-    val = dwarf2_evaluate_loc_desc (type, frame, data, size,
-				    dllbaton->per_cu);
-  if (data == NULL || value_optimized_out (val))
-    {
-      struct gdbarch *frame_gdbarch = get_frame_arch (frame);
+  data = find_location_expression (dllbaton, &size,
+				   get_frame_address_in_block (frame));
+  if (data == NULL)
+    return 0;
 
-      error (_("<optimized out> at %s is unsupported for DW_FORM_(loclist)"),
-	     paddress (frame_gdbarch, frame_pc));
-    }
+  val = dwarf2_evaluate_loc_desc (type, frame, data, size, dllbaton->per_cu);
+  if (value_optimized_out (val))
+    return 0;
 
-  return value_as_address (val);
+  *addrp = value_as_address (val);
+  return 1;
 }
 
 struct piece_closure
diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
index 52da01c..3535c1f 100644
--- a/gdb/dwarf2loc.h
+++ b/gdb/dwarf2loc.h
@@ -79,7 +79,7 @@ extern void object_address_set (CORE_ADDR address);
 extern CORE_ADDR dwarf_locexpr_baton_eval
   (struct dwarf2_locexpr_baton *dlbaton);
 
-extern CORE_ADDR dwarf_loclist_baton_eval
-  (struct dwarf2_loclist_baton *dllbaton, struct type *type);
+extern int dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton,
+				     struct type *type, CORE_ADDR *addrp);
 
 #endif /* dwarf2loc.h */
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index e8e3060..95bcca4 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -3338,32 +3338,40 @@ copy_type_recursive_1 (struct objfile *objfile,
 	     it is expected to be made constant by CHECK_TYPEDEF.
 	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
 	     */
-	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
-	    TYPE_RANGE_DATA (new_type)->low.u.dwarf_block = NULL;
-	  else
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type)
+	      || ! has_stack_frames ())
 	    {
-	      TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval
-				(TYPE_RANGE_DATA (new_type)->low.u.dwarf_block);
-	      TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
+	      /* We should set 1 for Fortran but how to find the language?  */
+	      TYPE_LOW_BOUND (new_type) = 0;
+	      TYPE_LOW_BOUND_UNDEFINED (new_type) = 1;
 	    }
+	  else
+	    TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval
+				(TYPE_RANGE_DATA (new_type)->low.u.dwarf_block);
+	  TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
 	  break;
 	case RANGE_BOUND_KIND_DWARF_LOCLIST:
-	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.
-	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
-	     */
-	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
-	    {
-	      TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist = NULL;
-	      TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type = NULL;
-	    }
-	  else
-	    {
-	      TYPE_LOW_BOUND (new_type) = dwarf_loclist_baton_eval
-		       (TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist,
-			  TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type);
-	      TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
-	    }
+	  {
+	    CORE_ADDR addr;
+
+	    /* `struct dwarf2_loclist_baton' is too bound to its objfile so
+	       it is expected to be made constant by CHECK_TYPEDEF.
+	       TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	       */
+	    if (! TYPE_NOT_ALLOCATED (new_type)
+	        && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames ()
+	        && dwarf_loclist_baton_eval
+		  (TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist,
+		   TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type, &addr))
+	      TYPE_LOW_BOUND (new_type) = addr;
+	    else
+	      {
+		/* We should set 1 for Fortran but how to find the language?  */
+		TYPE_LOW_BOUND (new_type) = 0;
+		TYPE_LOW_BOUND_UNDEFINED (new_type) = 1;
+	      }
+	    TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
+	  }
 	  break;
 	}
 
@@ -3376,32 +3384,39 @@ copy_type_recursive_1 (struct objfile *objfile,
 	     it is expected to be made constant by CHECK_TYPEDEF.
 	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
 	     */
-	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
-	    TYPE_RANGE_DATA (new_type)->high.u.dwarf_block = NULL;
-	  else
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type)
+	      || ! has_stack_frames ())
 	    {
-	      TYPE_HIGH_BOUND (new_type) = dwarf_locexpr_baton_eval
-			       (TYPE_RANGE_DATA (new_type)->high.u.dwarf_block);
-	      TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
+	      TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type) - 1;
+	      TYPE_HIGH_BOUND_UNDEFINED (new_type) = 1;
 	    }
+	  else
+	    TYPE_HIGH_BOUND (new_type) = dwarf_locexpr_baton_eval
+			       (TYPE_RANGE_DATA (new_type)->high.u.dwarf_block);
+	  TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
 	  break;
 	case RANGE_BOUND_KIND_DWARF_LOCLIST:
-	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.
-	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
-	     */
-	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
-	    {
-	      TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.loclist = NULL;
-	      TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type = NULL;
-	    }
-	  else
-	    {
-	      TYPE_HIGH_BOUND (new_type) = dwarf_loclist_baton_eval
+	  {
+	    CORE_ADDR addr;
+
+	    /* `struct dwarf2_loclist_baton' is too bound to its objfile so
+	       it is expected to be made constant by CHECK_TYPEDEF.
+	       TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	       */
+	    if (! TYPE_NOT_ALLOCATED (new_type)
+	        && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames ()
+	        && dwarf_loclist_baton_eval
 		      (TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.loclist,
-			 TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type);
-	      TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
-	    }
+		       TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type,
+		       &addr))
+	      TYPE_HIGH_BOUND (new_type) = addr;
+	    else
+	      {
+		TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type) - 1;
+		TYPE_HIGH_BOUND_UNDEFINED (new_type) = 1;
+	      }
+	    TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
+	  }
 	  break;
 	}
 
@@ -3414,36 +3429,33 @@ copy_type_recursive_1 (struct objfile *objfile,
 	     it is expected to be made constant by CHECK_TYPEDEF.
 	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
 	     */
-	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
-	    TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_block = NULL;
+	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type)
+	      || ! has_stack_frames ())
+	    TYPE_BYTE_STRIDE (new_type) = 0;
 	  else
-	    {
-	      TYPE_BYTE_STRIDE (new_type) = dwarf_locexpr_baton_eval
+	    TYPE_BYTE_STRIDE (new_type) = dwarf_locexpr_baton_eval
 			(TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_block);
-	      TYPE_RANGE_DATA (new_type)->byte_stride.kind
-	        = RANGE_BOUND_KIND_CONSTANT;
-	    }
+	  TYPE_RANGE_DATA (new_type)->byte_stride.kind
+	    = RANGE_BOUND_KIND_CONSTANT;
 	  break;
 	case RANGE_BOUND_KIND_DWARF_LOCLIST:
-	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
-	     it is expected to be made constant by CHECK_TYPEDEF.
-	     TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
-	     */
-	  if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type))
-	    {
-	      TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.loclist
-		= NULL;
-	      TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.type
-		= NULL;
-	    }
-	  else
-	    {
-	      TYPE_BYTE_STRIDE (new_type) = dwarf_loclist_baton_eval
+	  {
+	    CORE_ADDR addr = 0;
+
+	    /* `struct dwarf2_loclist_baton' is too bound to its objfile so
+	       it is expected to be made constant by CHECK_TYPEDEF.
+	       TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
+	       */
+	    if (! TYPE_NOT_ALLOCATED (new_type)
+		&& ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames ())
+	      dwarf_loclist_baton_eval
 	       (TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.loclist,
-		  TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.type);
-	      TYPE_RANGE_DATA (new_type)->byte_stride.kind
-		= RANGE_BOUND_KIND_CONSTANT;
-	    }
+		TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.type,
+		&addr);
+	    TYPE_BYTE_STRIDE (new_type) = addr;
+	    TYPE_RANGE_DATA (new_type)->byte_stride.kind
+	      = RANGE_BOUND_KIND_CONSTANT;
+	  }
 	  break;
 	}
 
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index a0781bf..efe5512 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1012,12 +1012,6 @@ extern void allocate_gnat_aux_type (struct type *);
    TYPE_RANGE_DATA(range_type)->low_undefined
 #define TYPE_HIGH_BOUND_UNDEFINED(range_type) \
    TYPE_RANGE_DATA(range_type)->high_undefined
-#define TYPE_LOW_BOUND_IS_DWARF_BLOCK(range_type) \
-   TYPE_RANGE_DATA(range_type)->low.is_dwarf_block
-#define TYPE_HIGH_BOUND_IS_DWARF_BLOCK(range_type) \
-   TYPE_RANGE_DATA(range_type)->high.is_dwarf_block
-#define TYPE_BYTE_STRIDE_IS_DWARF_BLOCK(range_type) \
-   TYPE_RANGE_DATA(range_type)->byte_stride.is_dwarf_block
 
 /* Moto-specific stuff for FORTRAN arrays */
 
@@ -1026,11 +1020,6 @@ extern void allocate_gnat_aux_type (struct type *);
 #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
    TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
 
-#define TYPE_ARRAY_UPPER_BOUND_IS_DWARF_BLOCK(arraytype) \
-   TYPE_HIGH_BOUND_IS_DWARF_BLOCK(TYPE_INDEX_TYPE(arraytype))
-#define TYPE_ARRAY_LOWER_BOUND_IS_DWARF_BLOCK(arraytype) \
-   TYPE_LOW_BOUND_IS_DWARF_BLOCK(TYPE_INDEX_TYPE(arraytype))
-
 #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
    (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
index 3c8e7fd..28db005 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
@@ -34,10 +34,15 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c
     return -1
 }
 
+# Verify it behaves at least as an unbound array without inferior.
+
+gdb_test "p a_string" { = 0x[0-9a-f]+ "seennotseen"}
+gdb_test "ptype a_string" {type = char \[\]}
+
 # Not runto_main as dw2-bound-loclist.S handles only the first byte of main.
 if ![runto "*main"] {
     return -1
 }
 
-gdb_test "p a_string" " = \"seen\""
-gdb_test "ptype a_string" "type = char \\\[4\\\]"
+gdb_test "p a_string" { = "seen"}
+gdb_test "ptype a_string" {type = char \[4\]}


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [SCM]  archer-jankratochvil-fedora13: Merge remote branch 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora13
@ 2010-04-16  9:34 jkratoch
  0 siblings, 0 replies; 3+ messages in thread
From: jkratoch @ 2010-04-16  9:34 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fedora13 has been updated
       via  1904b0b2e1655c3b94333f65e93887607634b4a6 (commit)
       via  25cad2dfa00472d3fb155a173f45971e397f94ff (commit)
      from  cb854301ce799ed6c96a80a03d829f3d186e4811 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 1904b0b2e1655c3b94333f65e93887607634b4a6
Merge: cb854301ce799ed6c96a80a03d829f3d186e4811 25cad2dfa00472d3fb155a173f45971e397f94ff
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Apr 16 11:33:51 2010 +0200

    Merge remote branch 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora13

-----------------------------------------------------------------------

Summary of changes:
 gdb/c-typeprint.c                              |    3 +-
 gdb/dwarf2loc.c                                |   64 +++++++--
 gdb/dwarf2loc.h                                |    3 +
 gdb/dwarf2read.c                               |  129 ++++++++++++++----
 gdb/gdbtypes.c                                 |   98 ++++++++++++--
 gdb/gdbtypes.h                                 |   16 ++-
 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S   |  176 ++++++++++++++++++++++++
 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp |   43 ++++++
 8 files changed, 474 insertions(+), 58 deletions(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp

First 500 lines of diff:
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index a405826..3061ab7 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -584,7 +584,8 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
 	fprintf_filtered (stream, ")");
 
       fprintf_filtered (stream, "[");
-      if (TYPE_ARRAY_UPPER_BOUND_IS_DWARF_BLOCK (type))
+      if (TYPE_RANGE_DATA (TYPE_INDEX_TYPE (type))->high.kind
+	  != RANGE_BOUND_KIND_CONSTANT)
 	{
 	  /* No _() - printed sources should not be locale dependent.  */
 	  fprintf_filtered (stream, "variable");
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index ac67f22..7550ac6 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -46,6 +46,12 @@ static void
 dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc,
 			 gdb_byte **start, size_t *length);
 
+static struct value *dwarf2_evaluate_loc_desc (struct type *type,
+					       struct frame_info *frame,
+					       gdb_byte *data,
+					       unsigned short size,
+					     struct dwarf2_per_cu_data *per_cu);
+
 /* A helper function for dealing with location lists.  Given a
    symbol baton (BATON) and a pc value (PC), find the appropriate
    location expression, set *LOCEXPR_LENGTH, and return a pointer
@@ -364,6 +370,34 @@ dwarf_locexpr_baton_eval (struct dwarf2_locexpr_baton *dlbaton)
   return retval;
 }
 
+/* Evaluate DWARF location list at DLLBATON expecting it produces exactly one
+   CORE_ADDR result on the DWARF stack stack.  */
+
+CORE_ADDR
+dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton,
+			  struct type *type)
+{
+  struct frame_info *frame = get_selected_frame (NULL);
+  CORE_ADDR frame_pc = get_frame_address_in_block (frame);
+  gdb_byte *data;
+  size_t size;
+  struct value *val;
+
+  data = find_location_expression (dllbaton, &size, frame_pc);
+  if (data)
+    val = dwarf2_evaluate_loc_desc (type, frame, data, size,
+				    dllbaton->per_cu);
+  if (data == NULL || value_optimized_out (val))
+    {
+      struct gdbarch *frame_gdbarch = get_frame_arch (frame);
+
+      error (_("<optimized out> at %s is unsupported for DW_FORM_(loclist)"),
+	     paddress (frame_gdbarch, frame_pc));
+    }
+
+  return value_as_address (val);
+}
+
 struct piece_closure
 {
   /* The number of pieces used to describe this variable.  */
@@ -538,7 +572,7 @@ static struct lval_funcs pieced_value_funcs = {
    SIZE, to find the current location of variable VAR in the context
    of FRAME.  */
 static struct value *
-dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
+dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
 			  gdb_byte *data, unsigned short size,
 			  struct dwarf2_per_cu_data *per_cu)
 {
@@ -548,7 +582,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
 
   if (size == 0)
     {
-      retval = allocate_value (SYMBOL_TYPE (var));
+      retval = allocate_value (type);
       VALUE_LVAL (retval) = not_lval;
       set_value_optimized_out (retval, 1);
       return retval;
@@ -562,9 +596,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
       struct frame_id frame_id = get_frame_id (frame);
 
       c = allocate_piece_closure (ctx->num_pieces, ctx->pieces, ctx->gdbarch);
-      retval = allocate_computed_value (SYMBOL_TYPE (var),
-					&pieced_value_funcs,
-					c);
+      retval = allocate_computed_value (type, &pieced_value_funcs, c);
       VALUE_FRAME_ID (retval) = frame_id;
     }
   else
@@ -576,7 +608,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
 	    struct gdbarch *arch = get_frame_arch (frame);
 	    CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0);
 	    int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, dwarf_regnum);
-	    retval = value_from_register (SYMBOL_TYPE (var), gdb_regnum, frame);
+	    retval = value_from_register (type, gdb_regnum, frame);
 	  }
 	  break;
 
@@ -590,7 +622,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
 	       DW_OP_push_object_address.  */
 	    object_address_set (address);
 
-	    retval = allocate_value (SYMBOL_TYPE (var));
+	    retval = allocate_value (type);
 	    VALUE_LVAL (retval) = lval_memory;
 	    set_value_lazy (retval, 1);
 	    if (in_stack_memory)
@@ -605,10 +637,10 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
 	    bfd_byte *contents;
 	    size_t n = ctx->addr_size;
 
-	    retval = allocate_value (SYMBOL_TYPE (var));
+	    retval = allocate_value (type);
 	    contents = value_contents_raw (retval);
-	    if (n > TYPE_LENGTH (SYMBOL_TYPE (var)))
-	      n = TYPE_LENGTH (SYMBOL_TYPE (var));
+	    if (n > TYPE_LENGTH (type))
+	      n = TYPE_LENGTH (type);
 	    store_unsigned_integer (contents, n,
 				    gdbarch_byte_order (ctx->gdbarch),
 				    value);
@@ -620,10 +652,10 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
 	    bfd_byte *contents;
 	    size_t n = ctx->len;
 
-	    retval = allocate_value (SYMBOL_TYPE (var));
+	    retval = allocate_value (type);
 	    contents = value_contents_raw (retval);
-	    if (n > TYPE_LENGTH (SYMBOL_TYPE (var)))
-	      n = TYPE_LENGTH (SYMBOL_TYPE (var));
+	    if (n > TYPE_LENGTH (type))
+	      n = TYPE_LENGTH (type);
 	    memcpy (contents, ctx->data, n);
 	  }
 	  break;
@@ -847,8 +879,8 @@ locexpr_read_variable (struct symbol *symbol, struct frame_info *frame)
 {
   struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
   struct value *val;
-  val = dwarf2_evaluate_loc_desc (symbol, frame, dlbaton->data, dlbaton->size,
-				  dlbaton->per_cu);
+  val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, dlbaton->data,
+				  dlbaton->size, dlbaton->per_cu);
 
   return val;
 }
@@ -971,7 +1003,7 @@ loclist_read_variable (struct symbol *symbol, struct frame_info *frame)
       set_value_optimized_out (val, 1);
     }
   else
-    val = dwarf2_evaluate_loc_desc (symbol, frame, data, size,
+    val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, data, size,
 				    dlbaton->per_cu);
 
   return val;
diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
index fdea2b4..52da01c 100644
--- a/gdb/dwarf2loc.h
+++ b/gdb/dwarf2loc.h
@@ -79,4 +79,7 @@ extern void object_address_set (CORE_ADDR address);
 extern CORE_ADDR dwarf_locexpr_baton_eval
   (struct dwarf2_locexpr_baton *dlbaton);
 
+extern CORE_ADDR dwarf_loclist_baton_eval
+  (struct dwarf2_loclist_baton *dllbaton, struct type *type);
+
 #endif /* dwarf2loc.h */
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 285c58e..9452844 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1147,6 +1147,9 @@ static int attr_form_is_section_offset (struct attribute *);
 
 static int attr_form_is_constant (struct attribute *);
 
+static struct dwarf2_loclist_baton *dwarf2_attr_to_loclist_baton
+  (struct attribute *attr, struct dwarf2_cu *cu);
+
 static void dwarf2_symbol_mark_computed (struct attribute *attr,
 					 struct symbol *sym,
 					 struct dwarf2_cu *cu);
@@ -6411,7 +6414,8 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
 		}
 	    }
 
-	  TYPE_HIGH_BOUND_IS_DWARF_BLOCK (range_type) = 1;
+	  TYPE_RANGE_DATA (range_type)->high.kind
+	    = RANGE_BOUND_KIND_DWARF_BLOCK;
 	  TYPE_RANGE_DATA (range_type)->high.u.dwarf_block = length_baton;
 	  TYPE_DYNAMIC (range_type) = 1;
 	}
@@ -6430,7 +6434,8 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
       attr = dwarf2_attr (die, DW_AT_byte_size, cu);
       if (attr && attr_form_is_block (attr))
 	{
-	  TYPE_HIGH_BOUND_IS_DWARF_BLOCK (range_type) = 1;
+	  TYPE_RANGE_DATA (range_type)->high.kind
+	    = RANGE_BOUND_KIND_DWARF_BLOCK;
 	  TYPE_RANGE_DATA (range_type)->high.u.dwarf_block =
 					dwarf2_attr_to_locexpr_baton (attr, cu);
 	  TYPE_DYNAMIC (range_type) = 1;
@@ -6670,13 +6675,32 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
   attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
   if (attr && attr_form_is_block (attr))
     {
-      TYPE_LOW_BOUND_IS_DWARF_BLOCK (range_type) = 1;
+      TYPE_RANGE_DATA (range_type)->low.kind = RANGE_BOUND_KIND_DWARF_BLOCK;
       TYPE_RANGE_DATA (range_type)->low.u.dwarf_block =
 					dwarf2_attr_to_locexpr_baton (attr, cu);
       TYPE_DYNAMIC (range_type) = 1;
       /* For setting a default if DW_AT_UPPER_BOUND would be missing.  */
       low = 0;
     }
+  else if (attr && is_ref_attr (attr))
+    {
+      struct die_info *target_die;
+      struct dwarf2_cu *target_cu = cu;
+      struct attribute *target_loc_attr;
+
+      target_die = follow_die_ref_or_sig (die, attr, &target_cu);
+      gdb_assert (target_cu->objfile == cu->objfile);
+      target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu);
+
+      TYPE_RANGE_DATA (range_type)->low.kind = RANGE_BOUND_KIND_DWARF_LOCLIST;
+      TYPE_RANGE_DATA (range_type)->low.u.dwarf_loclist.loclist
+        = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu);
+      TYPE_RANGE_DATA (range_type)->low.u.dwarf_loclist.type
+        = die_type (target_die, target_cu);
+      TYPE_DYNAMIC (range_type) = 1;
+      /* For setting a default if DW_AT_UPPER_BOUND would be missing.  */
+      low = 0;
+    }
   else
     {
       if (attr && attr_form_is_constant (attr))
@@ -6703,7 +6727,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
     }
 
   attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
-  if (!attr || (!attr_form_is_block (attr) && !attr_form_is_constant (attr)))
+  if (!attr || (!attr_form_is_block (attr) && !attr_form_is_constant (attr)
+		&& !is_ref_attr (attr)))
     {
       attr = dwarf2_attr (die, DW_AT_count, cu);
       /* It does not hurt but it is needlessly ineffective in check_typedef.  */
@@ -6717,11 +6742,28 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
 
   if (attr && attr_form_is_block (attr))
     {
-      TYPE_HIGH_BOUND_IS_DWARF_BLOCK (range_type) = 1;
+      TYPE_RANGE_DATA (range_type)->high.kind = RANGE_BOUND_KIND_DWARF_BLOCK;
       TYPE_RANGE_DATA (range_type)->high.u.dwarf_block =
 					dwarf2_attr_to_locexpr_baton (attr, cu);
       TYPE_DYNAMIC (range_type) = 1;
     }
+  else if (attr && is_ref_attr (attr))
+    {
+      struct die_info *target_die;
+      struct dwarf2_cu *target_cu = cu;
+      struct attribute *target_loc_attr;
+
+      target_die = follow_die_ref_or_sig (die, attr, &target_cu);
+      gdb_assert (target_cu->objfile == cu->objfile);
+      target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu);
+
+      TYPE_RANGE_DATA (range_type)->high.kind = RANGE_BOUND_KIND_DWARF_LOCLIST;
+      TYPE_RANGE_DATA (range_type)->high.u.dwarf_loclist.loclist
+        = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu);
+      TYPE_RANGE_DATA (range_type)->high.u.dwarf_loclist.type
+        = die_type (target_die, target_cu);
+      TYPE_DYNAMIC (range_type) = 1;
+    }
   else
     {
       if (attr && attr_form_is_constant (attr))
@@ -6744,11 +6786,30 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
   attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
   if (attr && attr_form_is_block (attr))
     {
-      TYPE_BYTE_STRIDE_IS_DWARF_BLOCK (range_type) = 1;
+      TYPE_RANGE_DATA (range_type)->byte_stride.kind
+        = RANGE_BOUND_KIND_DWARF_BLOCK;
       TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_block =
 					dwarf2_attr_to_locexpr_baton (attr, cu);
       TYPE_DYNAMIC (range_type) = 1;
     }
+  else if (attr && is_ref_attr (attr))
+    {
+      struct die_info *target_die;
+      struct dwarf2_cu *target_cu = cu;
+      struct attribute *target_loc_attr;
+
+      target_die = follow_die_ref_or_sig (die, attr, &target_cu);
+      gdb_assert (target_cu->objfile == cu->objfile);
+      target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu);
+
+      TYPE_RANGE_DATA (range_type)->byte_stride.kind
+        = RANGE_BOUND_KIND_DWARF_LOCLIST;
+      TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_loclist.loclist
+        = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu);
+      TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_loclist.type
+        = die_type (target_die, target_cu);
+      TYPE_DYNAMIC (range_type) = 1;
+    }
   else if (attr && attr_form_is_constant (attr))
     {
       TYPE_BYTE_STRIDE (range_type) = dwarf2_get_attr_constant_value (attr, 0);
@@ -12176,36 +12237,48 @@ dwarf2_attr_to_locexpr_baton (struct attribute *attr, struct dwarf2_cu *cu)
   return baton;
 }
 
+static struct dwarf2_loclist_baton *
+dwarf2_attr_to_loclist_baton (struct attribute *attr, struct dwarf2_cu *cu)
+{
+  struct dwarf2_loclist_baton *baton;
+
+  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
+	   other branch.  */
+	&& DW_UNSND (attr) < dwarf2_per_objfile->loc.size))
+    return NULL;
+
+  baton = obstack_alloc (&cu->objfile->objfile_obstack,
+			 sizeof (struct dwarf2_loclist_baton));
+  baton->per_cu = cu->per_cu;
+  gdb_assert (baton->per_cu);
+
+  /* We don't know how long the location list is, but make sure we
+     don't run off the edge of the section.  */
+  baton->size = dwarf2_per_objfile->loc.size - DW_UNSND (attr);
+  baton->data = dwarf2_per_objfile->loc.buffer + DW_UNSND (attr);
+  baton->base_address = cu->base_address;
+  if (cu->base_known == 0)
+    complaint (&symfile_complaints,
+	       _("Location list used without specifying the CU base address."));
+
+  return baton;
+}
+
 /* SYM may get its SYMBOL_CLASS overriden on invalid ATTR content.  */
 
 static void
 dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
 			     struct dwarf2_cu *cu)
 {
-  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
-	 other branch.  */
-      && DW_UNSND (attr) < dwarf2_per_objfile->loc.size)
-    {
-      struct dwarf2_loclist_baton *baton;
-
-      baton = obstack_alloc (&cu->objfile->objfile_obstack,
-			     sizeof (struct dwarf2_loclist_baton));
-      baton->per_cu = cu->per_cu;
-      gdb_assert (baton->per_cu);
-
-      /* We don't know how long the location list is, but make sure we
-	 don't run off the edge of the section.  */
-      baton->size = dwarf2_per_objfile->loc.size - DW_UNSND (attr);
-      baton->data = dwarf2_per_objfile->loc.buffer + DW_UNSND (attr);
-      baton->base_address = cu->base_address;
-      if (cu->base_known == 0)
-	complaint (&symfile_complaints,
-		   _("Location list used without specifying the CU base address."));
+  struct dwarf2_loclist_baton *loclist_baton;
 
+  loclist_baton = dwarf2_attr_to_loclist_baton (attr, cu);
+  if (loclist_baton)
+    {
       SYMBOL_COMPUTED_OPS (sym) = &dwarf2_loclist_funcs;
-      SYMBOL_LOCATION_BATON (sym) = baton;
+      SYMBOL_LOCATION_BATON (sym) = loclist_baton;
     }
   else if (attr_form_is_block (attr))
     {
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index bf6e891..3691331 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -886,8 +886,8 @@ create_array_type (struct type *result_type,
   /* DWARF blocks may depend on runtime information like
      DW_OP_PUSH_OBJECT_ADDRESS not being available during the
      CREATE_ARRAY_TYPE time.  */
-  if (TYPE_LOW_BOUND_IS_DWARF_BLOCK (range_type)
-      || TYPE_HIGH_BOUND_IS_DWARF_BLOCK (range_type)
+  if (TYPE_RANGE_DATA (range_type)->low.kind != RANGE_BOUND_KIND_CONSTANT
+      || TYPE_RANGE_DATA (range_type)->high.kind != RANGE_BOUND_KIND_CONSTANT
       || TYPE_LOW_BOUND_UNDEFINED (range_type) 
       || TYPE_HIGH_BOUND_UNDEFINED (range_type) 
       || get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
@@ -3278,6 +3278,9 @@ copy_type_recursive_1 (struct objfile *objfile,
     {
       int i, nfields;
 
+      /* TYPE_CODE_RANGE uses TYPE_RANGE_DATA of the union with TYPE_FIELDS.  */
+      gdb_assert (TYPE_CODE (type) != TYPE_CODE_RANGE);
+
       nfields = TYPE_NFIELDS (type);
       TYPE_NFIELDS (new_type) = nfields;
       TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field);
@@ -3326,43 +3329,116 @@ copy_type_recursive_1 (struct objfile *objfile,
       TYPE_RANGE_DATA (new_type) = xmalloc (sizeof (struct range_bounds));
       *TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type);
 
-      if (TYPE_LOW_BOUND_IS_DWARF_BLOCK (type))
+      switch (TYPE_RANGE_DATA (new_type)->low.kind)
 	{
+	case RANGE_BOUND_KIND_CONSTANT:
+	  break;
+	case RANGE_BOUND_KIND_DWARF_BLOCK:
 	  /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
 	     it is expected to be made constant by CHECK_TYPEDEF.  */
 	  if (TYPE_NOT_ALLOCATED (type)
 	      || TYPE_NOT_ASSOCIATED (type))
 	    TYPE_RANGE_DATA (new_type)->low.u.dwarf_block = NULL;
 	  else
-	    TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval
+	    {
+	      TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval
 				(TYPE_RANGE_DATA (new_type)->low.u.dwarf_block);
-	  TYPE_LOW_BOUND_IS_DWARF_BLOCK (new_type) = 0;
+	      TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
+	    }
+	  break;
+	case RANGE_BOUND_KIND_DWARF_LOCLIST:
+	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
+	     it is expected to be made constant by CHECK_TYPEDEF.  */
+	  if (TYPE_NOT_ALLOCATED (type)
+	      || TYPE_NOT_ASSOCIATED (type))
+	    {
+	      TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist = NULL;
+	      TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type = NULL;
+	    }
+	  else
+	    {
+	      TYPE_LOW_BOUND (new_type) = dwarf_loclist_baton_eval
+		       (TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist,
+			  TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type);
+	      TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
+	    }
+	  break;
 	}
 
-      if (TYPE_HIGH_BOUND_IS_DWARF_BLOCK (type))
+      switch (TYPE_RANGE_DATA (new_type)->high.kind)
 	{
+	case RANGE_BOUND_KIND_CONSTANT:
+	  break;
+	case RANGE_BOUND_KIND_DWARF_BLOCK:
 	  /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
 	     it is expected to be made constant by CHECK_TYPEDEF.  */
 	  if (TYPE_NOT_ALLOCATED (type)
 	      || TYPE_NOT_ASSOCIATED (type))
 	    TYPE_RANGE_DATA (new_type)->high.u.dwarf_block = NULL;
 	  else
-	    TYPE_HIGH_BOUND (new_type) = dwarf_locexpr_baton_eval
+	    {
+	      TYPE_HIGH_BOUND (new_type) = dwarf_locexpr_baton_eval
 			       (TYPE_RANGE_DATA (new_type)->high.u.dwarf_block);
-	  TYPE_HIGH_BOUND_IS_DWARF_BLOCK (new_type) = 0;
+	      TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
+	    }
+	  break;
+	case RANGE_BOUND_KIND_DWARF_LOCLIST:
+	  /* `struct dwarf2_loclist_baton' is too bound to its objfile so
+	     it is expected to be made constant by CHECK_TYPEDEF.  */
+	  if (TYPE_NOT_ALLOCATED (type)
+	      || TYPE_NOT_ASSOCIATED (type))
+	    {
+	      TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.loclist = NULL;
+	      TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type = NULL;
+	    }
+	  else
+	    {
+	      TYPE_HIGH_BOUND (new_type) = dwarf_loclist_baton_eval
+		      (TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.loclist,
+			 TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type);
+	      TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
+	    }
+	  break;
 	}
 
-      if (TYPE_BYTE_STRIDE_IS_DWARF_BLOCK (type))
+      switch (TYPE_RANGE_DATA (new_type)->byte_stride.kind)
 	{
+	case RANGE_BOUND_KIND_CONSTANT:
+	  break;
+	case RANGE_BOUND_KIND_DWARF_BLOCK:
 	  /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
 	     it is expected to be made constant by CHECK_TYPEDEF.  */
 	  if (TYPE_NOT_ALLOCATED (type)


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-16 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-16 10:08 [SCM] archer-jankratochvil-fedora13: Merge remote branch 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora13 jkratoch
  -- strict thread matches above, loose matches on Subject: below --
2010-04-16 22:15 jkratoch
2010-04-16  9:34 jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).