+2018-02-07 Simon Marchi <simon.marchi@ericsson.com>
+
+ * value.c (value_static_field): Assign field type instead of
+ containing type when returning an optimized out value.
+
2018-02-06 Yao Qi <yao.qi@linaro.org>
* ft32-tdep.c (ft32_read_pc): Remove.
+2018-02-07 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdb.cp/m-static.exp: Check type of optimized out static
+ member.
+
2018-02-03 Andrew Burgess <andrew.burgess@embecosm.com>
* config/sid.exp (gdb_target_sid): Remove use of cleanup.
setup_xfail *-*-*
}
gdb_test "print test4.nowhere" "<optimized out>" "static const int initialized nowhere (print field)"
+gdb_test "ptype test4.nowhere" "type = const int"
+gdb_test "print test4.nowhere.nowhere" "Attempt to extract a component of a value that is not a structure."
# Same, but print the whole struct.
gdb_test "print test4" "static nowhere = <optimized out>.*" "static const int initialized nowhere (whole struct)"
reported as non-debuggable symbols. */
struct bound_minimal_symbol msym
= lookup_minimal_symbol (phys_name, NULL, NULL);
+ struct type *field_type = TYPE_FIELD_TYPE (type, fieldno);
if (!msym.minsym)
- return allocate_optimized_out_value (type);
+ retval = allocate_optimized_out_value (field_type);
else
- {
- retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
- BMSYMBOL_VALUE_ADDRESS (msym));
- }
+ retval = value_at_lazy (field_type, BMSYMBOL_VALUE_ADDRESS (msym));
}
else
retval = value_of_variable (sym.symbol, sym.block);