diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-09-08 15:26:08 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-09-08 15:26:08 +0000 |
commit | 8afd712c6f6c36b80754178aae94d74aa48ffcd5 (patch) | |
tree | 6aa7a9f983fca3aa6f1a69b888da0ab5314e2c20 /gdb/stack.c | |
parent | b99b5f66e1d6f80624e8a28b8ebbf9235d50041e (diff) | |
download | gdb-8afd712c6f6c36b80754178aae94d74aa48ffcd5.zip gdb-8afd712c6f6c36b80754178aae94d74aa48ffcd5.tar.gz gdb-8afd712c6f6c36b80754178aae94d74aa48ffcd5.tar.bz2 |
gdb/
* findvar.c (read_var_value): Never return NULL, throw an error
instead. Update the function comment. State symbol name in the error
messages.
* python/py-frame.c (frapy_read_var): Remove handling of NULL from
read_var_value.
* stack.c (print_frame_args): Likewise.
* valops.c (value_of_variable): Likewise.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r-- | gdb/stack.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index 3147f3e..15666ee 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -330,6 +330,9 @@ print_frame_args (struct symbol *func, struct frame_info *frame, TRY_CATCH (except, RETURN_MASK_ERROR) { + const struct language_defn *language; + struct value_print_options opts; + /* 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 @@ -338,29 +341,21 @@ print_frame_args (struct symbol *func, struct frame_info *frame, recurse. */ val = read_var_value (sym, frame); - annotate_arg_value (val == NULL ? NULL : value_type (val)); + annotate_arg_value (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); - } + /* 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 - ui_out_text (uiout, "???"); + 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); } if (except.reason < 0) { |