aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-09-08 15:24:25 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-09-08 15:24:25 +0000
commitb99b5f66e1d6f80624e8a28b8ebbf9235d50041e (patch)
treef07aff7b099135e1608734978e2097e8c5277fc8 /gdb/stack.c
parenta391a2f6df2553b9d2e0cf4bc8c58e85d73137ae (diff)
downloadgdb-b99b5f66e1d6f80624e8a28b8ebbf9235d50041e.zip
gdb-b99b5f66e1d6f80624e8a28b8ebbf9235d50041e.tar.gz
gdb-b99b5f66e1d6f80624e8a28b8ebbf9235d50041e.tar.bz2
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 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, "...");