public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-jankratochvil-vla: Merge commit 'origin/master' into archer-jankratochvil-vla
Date: Sun, 28 Dec 2008 16:26:00 -0000	[thread overview]
Message-ID: <20081228162646.19353.qmail@sourceware.org> (raw)

The branch, archer-jankratochvil-vla has been updated
       via  436912c412da4a97fb07c8be2dddf757bbd49ca9 (commit)
       via  43f17405181c357d49d5193f0d16665964e6e5b0 (commit)
      from  215f0621895dc4401f4817d086b56818b8087bc7 (commit)

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

- Log -----------------------------------------------------------------
commit 436912c412da4a97fb07c8be2dddf757bbd49ca9
Merge: 215f0621895dc4401f4817d086b56818b8087bc7 43f17405181c357d49d5193f0d16665964e6e5b0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 28 17:25:40 2008 +0100

    Merge commit 'origin/master' into archer-jankratochvil-vla
    
    Conflicts:
    	gdb/ada-lang.c
    	gdb/gdbtypes.c
    	gdb/gdbtypes.h

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

Summary of changes:
 gdb/ChangeLog      |   25 +++++++++++++++++++++++++
 gdb/ada-lang.c     |   27 ++++++++++++++++-----------
 gdb/ada-valprint.c |    2 +-
 gdb/eval.c         |    2 +-
 gdb/gdbtypes.c     |   16 +++++++++-------
 gdb/hppa-tdep.c    |    2 +-
 gdb/mdebugread.c   |    4 ++--
 gdb/valarith.c     |    2 +-
 gdb/value.h        |    4 ----
 9 files changed, 56 insertions(+), 28 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c78678b..c21bf2b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,28 @@
+2008-12-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Fix TYPE_HIGH_BOUND for TYPE_CODE_RANGE using arbitrary TYPE_NFIELDS in
+	preparation for supporting DW_AT_byte_stride.
+	* ada-lang.c (packed_array_type, ada_index_type): Use TYPE_INDEX_TYPE.
+	(ada_array_bound_from_type): Move `index_type' declaration to the
+	function start.  New variable `retval'.  Return the bounds for
+	TYPE_CODE_RANGE using TYPE_LOW_BOUND and TYPE_HIGH_BOUND.  Abort on
+	invalid index type codes.
+	* ada-typeprint.c (print_range): Set `upper_bound' for TYPE_CODE_RANGE
+	now using TYPE_HIGH_BOUND.
+	* ada-valprint.c (val_print_packed_array_elements): Use `index_type'.
+	* eval.c (evaluate_subexp_standard): Use TYPE_INDEX_TYPE.
+	* gdbtypes.c (create_range_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
+	refer to the number of fields only through TYPE_NFIELDS.
+	(create_array_type): Use TYPE_INDEX_TYPE.
+	(check_typedef): Use TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND.
+	* gdbtypes.h (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED)
+	(TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED): Use TYPE_INDEX_TYPE.
+	(TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): Use
+	TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
+	* hppa-tdep.c (hppa_alignof <TYPE_CODE_ARRAY>): Use TYPE_INDEX_TYPE.
+	* mdebugread.c (parse_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
+	* valarith.c (value_bit_index): Use TYPE_INDEX_TYPE.
+
 2008-12-26  Sandra Loosemore  <sandra@codesourcery.com>
 
 	* breakpoint.c (update_watchpoint): Refactor to avoid compiler
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 8e87d72..1f52009 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1777,11 +1777,11 @@ packed_array_type (struct type *type, long *elt_bits)
   new_elt_type = packed_array_type (ada_check_typedef (TYPE_TARGET_TYPE (type)),
                                     elt_bits);
   new_type = alloc_type (TYPE_OBJFILE (type), new_elt_type);
-  create_array_type (new_type, new_elt_type, TYPE_FIELD_TYPE (type, 0));
+  create_array_type (new_type, new_elt_type, TYPE_INDEX_TYPE (type));
   TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits;
   TYPE_NAME (new_type) = ada_type_name (type);
 
-  if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0),
+  if (get_discrete_bounds (TYPE_INDEX_TYPE (type),
                            &low_bound, &high_bound) < 0)
     low_bound = high_bound = 0;
   if (high_bound < low_bound)
@@ -2468,7 +2468,7 @@ ada_index_type (struct type *type, int n)
 
       for (i = 1; i < n; i += 1)
         type = TYPE_TARGET_TYPE (type);
-      result_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0));
+      result_type = TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (type));
       /* FIXME: The stabs type r(0,0);bound;bound in an array type
          has a target type of TYPE_CODE_UNDEF.  We compensate here, but
          perhaps stabsread.c would make more sense.  */
@@ -2493,6 +2493,7 @@ ada_array_bound_from_type (struct type * arr_type, int n, int which,
                            struct type ** typep)
 {
   struct type *type, *index_type_desc, *index_type;
+  LONGEST retval;
 
   gdb_assert (which == 0 || which == 1);
 
@@ -2526,21 +2527,25 @@ ada_array_bound_from_type (struct type * arr_type, int n, int which,
       index_type = TYPE_INDEX_TYPE (type);
     }
 
-  if (typep != NULL)
-    *typep = index_type;
-
   switch (TYPE_CODE (index_type))
     {
     case TYPE_CODE_RANGE:
-      return which == 0 ? TYPE_LOW_BOUND (index_type)
-			: TYPE_HIGH_BOUND (index_type);
+      retval = which == 0 ? TYPE_LOW_BOUND (index_type)
+			  : TYPE_HIGH_BOUND (index_type);
+      break;
     case TYPE_CODE_ENUM:
-      return which == 0 ? TYPE_FIELD_BITPOS (index_type, 0)
-			: TYPE_FIELD_BITPOS (index_type,
-					     TYPE_NFIELDS (index_type) - 1);
+      retval = which == 0 ? TYPE_FIELD_BITPOS (index_type, 0)
+			  : TYPE_FIELD_BITPOS (index_type,
+					       TYPE_NFIELDS (index_type) - 1);
+      break;
     default:
       internal_error (__FILE__, __LINE__, _("invalid type code of index type"));
     }
+
+  if (typep != NULL)
+    *typep = index_type;
+
+  return retval;
 }
 
 /* Given that arr is an array value, returns the lower bound of the
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index cc8352f..4dad1fb 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -162,7 +162,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
 
   {
     LONGEST high;
-    if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0), &low, &high) < 0)
+    if (get_discrete_bounds (index_type, &low, &high) < 0)
       len = 1;
     else
       len = high - low + 1;
diff --git a/gdb/eval.c b/gdb/eval.c
index e3221ef..16d0487 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -826,7 +826,7 @@ evaluate_subexp_standard (struct type *expect_type,
       if (expect_type != NULL_TYPE && noside != EVAL_SKIP
 	  && TYPE_CODE (type) == TYPE_CODE_ARRAY)
 	{
-	  struct type *range_type = TYPE_FIELD_TYPE (type, 0);
+	  struct type *range_type = TYPE_INDEX_TYPE (type);
 	  struct type *element_type = TYPE_TARGET_TYPE (type);
 	  struct value *array = allocate_value (expect_type);
 	  int element_size = TYPE_LENGTH (check_typedef (element_type));
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index fd99511..40c6c04 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -750,17 +750,19 @@ create_range_type (struct type *result_type, struct type *index_type,
   else
     TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type));
   TYPE_NFIELDS (result_type) = 3;
-  TYPE_FIELDS (result_type) = (struct field *)
-    TYPE_ALLOC (result_type, 3 * sizeof (struct field));
-  memset (TYPE_FIELDS (result_type), 0, 3 * sizeof (struct field));
-  TYPE_FIELD_BITPOS (result_type, 0) = low_bound;
-  TYPE_FIELD_BITPOS (result_type, 1) = high_bound;
+  TYPE_FIELDS (result_type) = TYPE_ALLOC (result_type,
+					  TYPE_NFIELDS (result_type)
+					  * sizeof (struct field));
+  memset (TYPE_FIELDS (result_type), 0,
+	  TYPE_NFIELDS (result_type) * sizeof (struct field));
+  TYPE_LOW_BOUND (result_type) = low_bound;
+  TYPE_HIGH_BOUND (result_type) = high_bound;
   TYPE_BYTE_STRIDE (result_type) = 0;
 
   if (low_bound >= 0)
     TYPE_UNSIGNED (result_type) = 1;
 
-  return (result_type);
+  return result_type;
 }
 
 /* Set *LOWP and *HIGHP to the lower and upper bounds of discrete type
@@ -870,7 +872,7 @@ create_array_type (struct type *result_type,
     (struct field *) TYPE_ALLOC (result_type, sizeof (struct field));
   memset (TYPE_FIELDS (result_type), 0, sizeof (struct field));
   /* FIXME: type alloc.  */
-  TYPE_FIELD_TYPE (result_type, 0) = range_type;
+  TYPE_INDEX_TYPE (result_type) = range_type;
   TYPE_VPTR_FIELDNO (result_type) = -1;
 
   /* DWARF blocks may depend on runtime information like
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 5b6676e..7785957 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1313,7 +1313,7 @@ hppa_alignof (struct type *type)
     case TYPE_CODE_FLT:
       return TYPE_LENGTH (type);
     case TYPE_CODE_ARRAY:
-      return hppa_alignof (TYPE_FIELD_TYPE (type, 0));
+      return hppa_alignof (TYPE_INDEX_TYPE (type));
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
       max_align = 1;
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index edc6ac0..0135b79 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -1644,11 +1644,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
 			  TYPE_ALLOC (tp, 2 * sizeof (struct field)));
       TYPE_FIELD_NAME (tp, 0) = obsavestring ("Low", strlen ("Low"),
 					    &current_objfile->objfile_obstack);
-      TYPE_FIELD_BITPOS (tp, 0) = AUX_GET_DNLOW (bigend, ax);
+      TYPE_LOW_BOUND (tp) = AUX_GET_DNLOW (bigend, ax);
       ax++;
       TYPE_FIELD_NAME (tp, 1) = obsavestring ("High", strlen ("High"),
 					    &current_objfile->objfile_obstack);
-      TYPE_FIELD_BITPOS (tp, 1) = AUX_GET_DNHIGH (bigend, ax);
+      TYPE_HIGH_BOUND (tp) = AUX_GET_DNHIGH (bigend, ax);
       ax++;
     }
 
diff --git a/gdb/valarith.c b/gdb/valarith.c
index f5517ae..c867e94 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1579,7 +1579,7 @@ value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
   LONGEST low_bound, high_bound;
   LONGEST word;
   unsigned rel_index;
-  struct type *range = TYPE_FIELD_TYPE (type, 0);
+  struct type *range = TYPE_INDEX_TYPE (type);
   if (get_discrete_bounds (range, &low_bound, &high_bound) < 0)
     return -2;
   if (index < low_bound || index > high_bound)
diff --git a/gdb/value.h b/gdb/value.h
index 91a664f..f4d66a4 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -561,10 +561,6 @@ extern int val_print_string (CORE_ADDR addr, int len, int width,
 			     struct ui_file *stream,
 			     const struct value_print_options *options);
 
-extern void print_variable_value_nl (struct symbol *var,
-				     struct frame_info *frame,
-				     struct ui_file *stream);
-
 extern void print_variable_and_value (const char *name,
 				      struct symbol *var,
 				      struct frame_info *frame,


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


             reply	other threads:[~2008-12-28 16:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-28 16:26 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-09-09 16:16 jkratoch
2009-09-01 11:53 jkratoch
2009-08-19 15:23 jkratoch
2009-07-31 18:51 jkratoch
2009-07-30 21:17 jkratoch
2008-12-14 23:51 jkratoch
2008-12-07  2:49 jkratoch
2008-11-27 15:52 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081228162646.19353.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).