+2013-10-29 Andrew Burgess <aburgess@broadcom.com>
+
+ * infcmd.c (default_print_one_register_info): Use val_print to
+ print all values even optimized out or unavailable ones. Don't
+ try to print a raw form of optimized out or unavailable values.
+
2013-10-29 Yao Qi <yao@codesourcery.com>
* auto-load.c (auto_load_pspace_data_cleanup): Get data from
struct value *val)
{
struct type *regtype = value_type (val);
+ int print_raw_format;
fputs_filtered (name, file);
print_spaces_filtered (15 - strlen (name), file);
- if (!value_entirely_available (val))
- {
- fprintf_filtered (file, "*value not available*\n");
- return;
- }
- else if (value_optimized_out (val))
- {
- val_print_optimized_out (val, file);
- fprintf_filtered (file, "\n");
- return;
- }
+ print_raw_format = (value_entirely_available (val)
+ && !value_optimized_out (val));
/* If virtual format is floating, print it that way, and in raw
hex. */
value_embedded_offset (val), 0,
file, 0, val, &opts, current_language);
- fprintf_filtered (file, "\t(raw ");
- print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order);
- fprintf_filtered (file, ")");
+ if (print_raw_format)
+ {
+ fprintf_filtered (file, "\t(raw ");
+ print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order);
+ fprintf_filtered (file, ")");
+ }
}
else
{
file, 0, val, &opts, current_language);
/* If not a vector register, print it also according to its
natural format. */
- if (TYPE_VECTOR (regtype) == 0)
+ if (print_raw_format && TYPE_VECTOR (regtype) == 0)
{
get_user_print_options (&opts);
opts.deref_ref = 1;
test_register "\$pc"
gdb_test "info registers" \
- "\\*value not available\\*.*\\*value not available\\*" \
+ "<unavailable>.*<unavailable>" \
"info registers, multiple registers not available"
gdb_test "info registers \$$spreg" \
- "\\*value not available\\*" \
+ "<unavailable>" \
"info registers \$$spreg reports not available"
gdb_test "tfind none" "#0 end .*" "cease trace debugging"