{DW_AT_name foo.adb}
{DW_AT_comp_dir /tmp}
} {
- declare_labels integer_label array_label
+ declare_labels integer_label array_label array_ptr_label
integer_label: DW_TAG_base_type {
{DW_AT_byte_size 4 DW_FORM_sdata}
} SPECIAL_expr}
}
}
- DW_TAG_typedef {
+ array_ptr_label: DW_TAG_typedef {
{DW_AT_name foo__array_type}
{DW_AT_type :$array_label}
}
} SPECIAL_expr}
{external 1 flag}
}
+ DW_TAG_variable {
+ {DW_AT_name foo__three_tdef}
+ {DW_AT_type :$array_ptr_label}
+ {DW_AT_location {
+ DW_OP_addr table_1
+ } SPECIAL_expr}
+ {external 1 flag}
+ }
DW_TAG_variable {
{DW_AT_name foo__five}
{DW_AT_type :$array_label}
} SPECIAL_expr}
{external 1 flag}
}
+ DW_TAG_variable {
+ {DW_AT_name foo__five_tdef}
+ {DW_AT_type :$array_ptr_label}
+ {DW_AT_location {
+ DW_OP_addr table_2
+ } SPECIAL_expr}
+ {external 1 flag}
+ }
}
}
}
gdb_test_no_output "set language ada"
+# foo.three
+
gdb_test "print foo.three" \
" = \\(1, 2, 3\\)"
gdb_test "print foo.three'length" \
" = 3"
+# foo.three_tdef
+
+gdb_test "print foo.three_tdef" \
+ " = \\(1, 2, 3\\)"
+
+gdb_test "ptype foo.three_tdef" \
+ "type = array \\(1 .. 3\\) of integer"
+
+gdb_test "print foo.three_tdef(1)" \
+ " = 1"
+
+gdb_test "print foo.three_tdef(2)" \
+ " = 2"
+
+gdb_test "print foo.three_tdef(3)" \
+ " = 3"
+
+gdb_test "print foo.three_tdef'first" \
+ " = 1"
+
+gdb_test "print foo.three_tdef'last" \
+ " = 3"
+
+gdb_test "print foo.three_tdef'length" \
+ " = 3"
+
gdb_test "print foo.five" \
" = \\(2 => 5, 8, 13, 21, 34\\)"
gdb_test "ptype foo.array_type" \
"type = array \\(<>\\) of integer"
+# foo.five
+
gdb_test "print foo.five(2)" \
" = 5"
gdb_test "print foo.five'length" \
" = 5"
+# foo.five_tdef
+
+gdb_test "print foo.five_tdef" \
+ " = \\(2 => 5, 8, 13, 21, 34\\)"
+
+gdb_test "ptype foo.five_tdef" \
+ "type = array \\(2 .. 6\\) of integer"
+
+gdb_test "ptype foo.array_type" \
+ "type = array \\(<>\\) of integer"
+
+gdb_test "print foo.five_tdef(2)" \
+ " = 5"
+
+gdb_test "print foo.five_tdef(3)" \
+ " = 8"
+
+gdb_test "print foo.five_tdef(4)" \
+ " = 13"
+
+gdb_test "print foo.five_tdef(5)" \
+ " = 21"
+
+gdb_test "print foo.five_tdef(6)" \
+ " = 34"
+
+gdb_test "print foo.five_tdef'first" \
+ " = 2"
+
+gdb_test "print foo.five_tdef'last" \
+ " = 6"
+
+gdb_test "print foo.five_tdef'length" \
+ " = 5"
+
gdb_test_no_output "set lang c"
+# foo__three
+
gdb_test "print foo__three" \
" = \\{1, 2, 3\\}"
gdb_test "ptype foo__three" \
"type = integer \\\[3\\\]"
+# foo__three_tdef
+
+gdb_test "print foo__three_tdef" \
+ " = \\{1, 2, 3\\}"
+
+gdb_test "ptype foo__three_tdef" \
+ "type = integer \\\[3\\\]"
+
+# foo__five
+
gdb_test "print foo__five" \
" = \\{5, 8, 13, 21, 34\\}"
gdb_test "ptype foo__five" \
"type = integer \\\[5\\\]"
+# foo__five_tdef
+
+gdb_test "print foo__five_tdef" \
+ " = \\{5, 8, 13, 21, 34\\}"
+
+gdb_test "ptype foo__five_tdef" \
+ "type = integer \\\[5\\\]"
+
gdb_test "ptype foo__array_type" \
"type = integer \\\[variable length\\\]"
CORE_ADDR address)
{
struct type *resolved_type = resolve_dynamic_type (type, address);
+ struct type *resolved_type_no_typedef = check_typedef (resolved_type);
struct value *v;
if (valaddr == NULL)
v = allocate_value_lazy (resolved_type);
else
v = value_from_contents (resolved_type, valaddr);
- if (TYPE_DATA_LOCATION (resolved_type) != NULL
- && TYPE_DATA_LOCATION_KIND (resolved_type) == PROP_CONST)
- address = TYPE_DATA_LOCATION_ADDR (resolved_type);
+ if (TYPE_DATA_LOCATION (resolved_type_no_typedef) != NULL
+ && TYPE_DATA_LOCATION_KIND (resolved_type_no_typedef) == PROP_CONST)
+ address = TYPE_DATA_LOCATION_ADDR (resolved_type_no_typedef);
set_value_address (v, address);
VALUE_LVAL (v) = lval_memory;
return v;