2009-03-20 Tom Tromey <tromey@redhat.com>
authorTom Tromey <tromey@redhat.com>
Fri, 20 Mar 2009 22:00:11 +0000 (22:00 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 20 Mar 2009 22:00:11 +0000 (22:00 +0000)
    Jan Kratochvil  <jan.kratochvil@redhat.com>

* dwarf2read.c (process_die): Handle DW_TAG_typedef.
* eval.c (evaluate_subexp_standard) <OP_TYPE>: Strip a single
typedef.
* ada-lang.c (decode_packed_array_type): Call CHECK_TYPEDEF on the
SYMBOL_TYPE result.
* ada-typeprint.c (print_array_type): Do the NULL check
unconditionally.

gdb/ChangeLog
gdb/ada-lang.c
gdb/ada-typeprint.c
gdb/dwarf2read.c
gdb/eval.c

index 107396ea20bd38185e6796878d9450c1c09d2369..9d5e5f40851f788fe4266eef7d7bd2eb33365c37 100644 (file)
@@ -1,3 +1,14 @@
+2009-03-20  Tom Tromey  <tromey@redhat.com>
+           Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * dwarf2read.c (process_die): Handle DW_TAG_typedef.
+       * eval.c (evaluate_subexp_standard) <OP_TYPE>: Strip a single
+       typedef.
+       * ada-lang.c (decode_packed_array_type): Call CHECK_TYPEDEF on the
+       SYMBOL_TYPE result.
+       * ada-typeprint.c (print_array_type): Do the NULL check
+       unconditionally.
+
 2009-03-19  Tom Tromey  <tromey@redhat.com>
 
        * utils.c (do_obstack_free): New function.
index b95a3031e11f9ef93ccc7c480d530e0eecaaa967..e4fdd24b10c7134e5258de9f7739f8f3ffacab34 100644 (file)
@@ -1783,6 +1783,7 @@ decode_packed_array_type (struct type *type)
       return NULL;
     }
   shadow_type = SYMBOL_TYPE (sym);
+  CHECK_TYPEDEF (shadow_type);
 
   if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
     {
index f00824ab9af465dca67154d673f10895364a2760..ef665c4a0c1c1cfd33b470a4fab91f027f629cab 100644 (file)
@@ -357,16 +357,17 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
   bitsize = 0;
   fprintf_filtered (stream, "array (");
 
+  if (type == NULL)
+    {
+      fprintf_filtered (stream, _("<undecipherable array type>"));
+      return;
+    }
+
   n_indices = -1;
   if (show < 0)
     fprintf_filtered (stream, "...");
   else
     {
-      if (type == NULL)
-        {
-          fprintf_filtered (stream, _("<undecipherable array type>"));
-          return;
-        }
       if (ada_is_simple_array_type (type))
        {
          struct type *range_desc_type =
index feb57b0b94e8459ce88d4fecd8682c2f23f724d7..cf8f45827b60faed49e6e44c6bcf722a2a0def46 100644 (file)
@@ -2849,6 +2849,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
 
     case DW_TAG_base_type:
     case DW_TAG_subrange_type:
+    case DW_TAG_typedef:
       /* Add a typedef symbol for the type definition, if it has a
          DW_AT_name.  */
       new_symbol (die, read_type_die (die, cu), cu);
index 1d3557135c3c3ec70dd3b79c7e0a4bd2f3a55d8e..cc92ebef3ce4fc12220292f957b219715f289ac5 100644 (file)
@@ -2475,7 +2475,17 @@ evaluate_subexp_standard (struct type *expect_type,
       if (noside == EVAL_SKIP)
         goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-        return allocate_value (exp->elts[pc + 1].type);
+       {
+         struct type *type = exp->elts[pc + 1].type;
+         /* If this is a typedef, then find its immediate target.  We
+            use check_typedef to resolve stubs, but we ignore its
+            result because we do not want to dig past all
+            typedefs.  */
+         check_typedef (type);
+         if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+           type = TYPE_TARGET_TYPE (type);
+         return allocate_value (type);
+       }
       else
         error (_("Attempt to use a type name as an expression"));