+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.
return NULL;
}
shadow_type = SYMBOL_TYPE (sym);
+ CHECK_TYPEDEF (shadow_type);
if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
{
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 =
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);
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"));