aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2013-10-29 13:24:11 +0000
committerAndrew Burgess <aburgess@broadcom.com>2013-10-29 13:26:49 +0000
commitf69d9aef9b66d371f2abab8ef2178043362bf350 (patch)
treed1f0298101702cb7a04aa76f914ce5db28a4816f /gdb/infcmd.c
parent681f229a9fbf72ce7882bf81122f1f18bce96c0e (diff)
downloadfsf-binutils-gdb-f69d9aef9b66d371f2abab8ef2178043362bf350.zip
fsf-binutils-gdb-f69d9aef9b66d371f2abab8ef2178043362bf350.tar.gz
fsf-binutils-gdb-f69d9aef9b66d371f2abab8ef2178043362bf350.tar.bz2
Print <unavailable> for unavailable registers in info register output.
https://sourceware.org/ml/gdb-patches/2013-08/msg00171.html gdb/ChangeLog * 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. gdb/testsuite/ChangeLog * gdb.trace/unavailable.exp (gdb_unavailable_registers_test): Expect <unavailable> pattern.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 4ad8ad3..d678e9f 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2028,21 +2028,13 @@ default_print_one_register_info (struct ui_file *file,
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. */
@@ -2062,9 +2054,12 @@ default_print_one_register_info (struct ui_file *file,
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
{
@@ -2079,7 +2074,7 @@ default_print_one_register_info (struct ui_file *file,
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;