diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-09-18 14:02:31 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@broadcom.com> | 2013-09-18 14:02:31 +0000 |
commit | e4c6a2c42df650ad28efcb081244d41954d91353 (patch) | |
tree | f34d306eedefd9eadbde3f53696b9814c8ca5b85 /gdb/infcmd.c | |
parent | 25f686c226fe67017e54670302cd5c040d8a4ae9 (diff) | |
download | gdb-e4c6a2c42df650ad28efcb081244d41954d91353.zip gdb-e4c6a2c42df650ad28efcb081244d41954d91353.tar.gz gdb-e4c6a2c42df650ad28efcb081244d41954d91353.tar.bz2 |
Consistent display of "<optimized out>" for register values.
https://sourceware.org/ml/gdb-patches/2013-08/msg00170.html
gdb/ChangeLog
* infcmd.c (default_print_one_register_info): Add detection of
optimized out values.
(default_print_registers_info): Switch to using
get_frame_register_value.
gdb/testsuite/ChangeLog
* gdb.dwarf2/dw2-reg-undefined.exp: Change pattern for info
register to "<optimized out>", and also print the registers.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 242aac1..e29dcde 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2033,6 +2033,12 @@ default_print_one_register_info (struct ui_file *file, fprintf_filtered (file, "*value not available*\n"); return; } + else if (value_optimized_out (val)) + { + val_print_optimized_out (file); + fprintf_filtered (file, "\n"); + return; + } /* If virtual format is floating, print it that way, and in raw hex. */ @@ -2107,9 +2113,6 @@ default_print_registers_info (struct gdbarch *gdbarch, for (i = 0; i < numregs; i++) { - struct type *regtype; - struct value *val; - /* Decide between printing all regs, non-float / vector regs, or specific reg. */ if (regnum == -1) @@ -2137,16 +2140,9 @@ default_print_registers_info (struct gdbarch *gdbarch, || *(gdbarch_register_name (gdbarch, i)) == '\0') continue; - regtype = register_type (gdbarch, i); - val = allocate_value (regtype); - - /* Get the data in raw format. */ - if (! deprecated_frame_register_read (frame, i, value_contents_raw (val))) - mark_value_bytes_unavailable (val, 0, TYPE_LENGTH (value_type (val))); - default_print_one_register_info (file, gdbarch_register_name (gdbarch, i), - val); + get_frame_register_value (frame, i)); } } |