diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-11-28 18:54:20 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-11-28 18:54:20 +0000 |
commit | eebc056c8e1ae9bc015645acf861bde0eff8335a (patch) | |
tree | 623847ee04e50529556d926c0737c2ea456acc03 /gdb/valprint.c | |
parent | a7300869806e7586189dc0f46c41c5773fe3ae16 (diff) | |
download | gdb-eebc056c8e1ae9bc015645acf861bde0eff8335a.zip gdb-eebc056c8e1ae9bc015645acf861bde0eff8335a.tar.gz gdb-eebc056c8e1ae9bc015645acf861bde0eff8335a.tar.bz2 |
Print entirely unavailable struct/union values as a single <unavailable>.
When printing an entirely optimized out structure/class/union, we
print a single <optimized out> instead of printing <optimized out> for
each field.
This patch makes an entirely unavailable structure/class/union be
likewise displayed with a single "<unavailable>" rather than the whole
object with all fields <unavailable>.
This seems good because this way the user can quickly tell whether the
whole value is unavailable, rather than having to skim all fields.
Consistency with optimized out values also seems to be a good thing to
have.
A few updates to gdb.trace/unavailable.exp where required.
Tested on x86_64 Fedora 17, native gdbserver.
gdb/
2013-11-28 Andrew Burgess <aburgess@broadcom.com>
Pedro Alves <palves@redhat.com>
* valprint.c (value_check_printable): If the value is entirely
unavailable, print a single "<unavailable>" instead of printing
all subfields.
gdb/testsuite/
2013-11-28 Andrew Burgess <aburgess@broadcom.com>
* gdb.trace/unavailable.exp (gdb_collect_args_test): Update
expected results.
(gdb_collect_locals_test): Likewise.
(gdb_collect_globals_test): Likewise.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r-- | gdb/valprint.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c index ecc3411..0124934 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -812,6 +812,15 @@ value_check_printable (struct value *val, struct ui_file *stream, return 0; } + if (value_entirely_unavailable (val)) + { + if (options->summary && !val_print_scalar_type_p (value_type (val))) + fprintf_filtered (stream, "..."); + else + val_print_unavailable (stream); + return 0; + } + if (TYPE_CODE (value_type (val)) == TYPE_CODE_INTERNAL_FUNCTION) { fprintf_filtered (stream, _("<internal function %s>"), |