summaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-09-08 15:24:19 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-09-08 15:24:19 +0000
commit3d0a5ee6551a1f2036a574f7802c1abc47eada41 (patch)
tree98482b7e4cb0a7f196fb713e8fc4c684b2a71935 /gdb/stack.c
parent32c2066039dab949ffee3f229caae170c283b422 (diff)
downloadgdb-3d0a5ee6551a1f2036a574f7802c1abc47eada41.tar.gz
gdb/
* stack.c (print_frame_args): New variable except. Wrap read_var_value and common_val_print into TRY_CATCH. gdb/testsuite/ * gdb.dwarf2/dw2-param-error-main.c: New file. * gdb.dwarf2/dw2-param-error.S: New file. * gdb.dwarf2/dw2-param-error.exp: New file.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c72
1 files changed, 42 insertions, 30 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 4e050fc9893..3147f3e72fc 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, "...");