From 0f6a939d8663bfe0fcb4bf353c7ed5f6323b2de4 Mon Sep 17 00:00:00 2001 From: Phil Muldoon Date: Fri, 25 Jun 2010 15:13:52 +0000 Subject: 2010-06-24 Phil Muldoon * printcmd.c (print_variable_and_value): Print error message on caught exception. --- gdb/printcmd.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gdb/printcmd.c') 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, "", name, + except.message); fprintf_filtered (stream, "\n"); } -- cgit v1.1