diff options
Diffstat (limited to 'gdb/stack.c')
-rw-r--r-- | gdb/stack.c | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index 4e050fc..3147f3e 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -326,37 +326,49 @@ print_frame_args (struct symbol *func, struct frame_info *frame, if (print_args) { - /* Avoid value_print because it will deref ref parameters. - We just want to print their addresses. Print ??? for - args whose address we do not know. We pass 2 as - "recurse" to val_print because our standard indentation - here is 4 spaces, and val_print indents 2 for each - recurse. */ - val = read_var_value (sym, frame); - - annotate_arg_value (val == NULL ? NULL : value_type (val)); - - if (val) - { - const struct language_defn *language; - struct value_print_options opts; - - /* Use the appropriate language to display our symbol, - unless the user forced the language to a specific - language. */ - if (language_mode == language_mode_auto) - language = language_def (SYMBOL_LANGUAGE (sym)); - else - language = current_language; - - get_raw_print_options (&opts); - opts.deref_ref = 0; - opts.summary = summary; - common_val_print (val, stb->stream, 2, &opts, language); + volatile struct gdb_exception except; + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + /* Avoid value_print because it will deref ref parameters. + We just want to print their addresses. Print ??? for + args whose address we do not know. We pass 2 as + "recurse" to val_print because our standard indentation + here is 4 spaces, and val_print indents 2 for each + recurse. */ + val = read_var_value (sym, frame); + + annotate_arg_value (val == NULL ? NULL : value_type (val)); + + if (val) + { + const struct language_defn *language; + struct value_print_options opts; + + /* Use the appropriate language to display our symbol, + unless the user forced the language to a specific + language. */ + if (language_mode == language_mode_auto) + language = language_def (SYMBOL_LANGUAGE (sym)); + else + language = current_language; + + get_raw_print_options (&opts); + opts.deref_ref = 0; + opts.summary = summary; + common_val_print (val, stb->stream, 2, &opts, language); + ui_out_field_stream (uiout, "value", stb); + } + else + ui_out_text (uiout, "???"); + } + if (except.reason < 0) + { + fprintf_filtered (stb->stream, + _("<error reading variable: %s>"), + except.message); ui_out_field_stream (uiout, "value", stb); - } - else - ui_out_text (uiout, "???"); + } } else ui_out_text (uiout, "..."); |