diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2010-06-25 15:13:52 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2010-06-25 15:13:52 +0000 |
commit | 0f6a939d8663bfe0fcb4bf353c7ed5f6323b2de4 (patch) | |
tree | 7b874e4322f406bf8b6b7a2135b5593080937e39 /gdb | |
parent | 9714ee486634a00a2f76f9a3879059b77a53d4a5 (diff) | |
download | gdb-0f6a939d8663bfe0fcb4bf353c7ed5f6323b2de4.zip gdb-0f6a939d8663bfe0fcb4bf353c7ed5f6323b2de4.tar.gz gdb-0f6a939d8663bfe0fcb4bf353c7ed5f6323b2de4.tar.bz2 |
2010-06-24 Phil Muldoon <pmuldoon@redhat.com>
* printcmd.c (print_variable_and_value): Print error message on
caught exception.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/printcmd.c | 17 |
2 files changed, 17 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 53c6145..d99913c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-06-25 Phil Muldoon <pmuldoon@redhat.com> + + * printcmd.c (print_variable_and_value): Print error message on + caught exception. + 2010-06-25 Ulrich Weigand <uweigand@de.ibm.com> * dwarf2expr.h (struct dwarf_value_location): Use ULONGEST as type diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 430ccee..5ffa099 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1942,17 +1942,24 @@ print_variable_and_value (const char *name, struct symbol *var, struct frame_info *frame, struct ui_file *stream, int indent) { - struct value *val; - struct value_print_options opts; + volatile struct gdb_exception except; if (!name) name = SYMBOL_PRINT_NAME (var); fprintf_filtered (stream, "%s%s = ", n_spaces (2 * indent), name); + TRY_CATCH (except, RETURN_MASK_ERROR) + { + struct value *val; + struct value_print_options opts; - val = read_var_value (var, frame); - get_user_print_options (&opts); - common_val_print (val, stream, indent, &opts, current_language); + val = read_var_value (var, frame); + get_user_print_options (&opts); + common_val_print (val, stream, indent, &opts, current_language); + } + if (except.reason < 0) + fprintf_filtered(stream, "<error reading variable %s (%s)>", name, + except.message); fprintf_filtered (stream, "\n"); } |