diff options
author | Tom Tromey <tromey@adacore.com> | 2022-06-06 10:01:40 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-06-20 09:11:13 -0600 |
commit | 5ffa6ca3e553563004bd9d306bef38e2bee6fecc (patch) | |
tree | 94b45b310ad391198f8a7e4e86c289352262ed6b /gdb/infcmd.c | |
parent | 0d02e70b197c786f26175b9a73f94e01d14abdab (diff) | |
download | binutils-gdb-5ffa6ca3e553563004bd9d306bef38e2bee6fecc.tar.gz |
Move finish_print out of value_print_options
'finish_print' does not really belong in value_print_options -- this
is consulted only when deciding whether or not to print a value, and
never during the course of printing. This patch removes it from the
structure and makes it a static global in infcmd.c instead.
Tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 18590259339..17d15534356 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -98,6 +98,11 @@ enum stop_stack_kind stop_stack_dummy; int stopped_by_random_signal; + +/* Whether "finish" should print the value. */ + +static bool finish_print = true; + static void @@ -1524,17 +1529,17 @@ print_return_value_1 (struct ui_out *uiout, struct return_value_info *rv) { if (rv->value != NULL) { - struct value_print_options opts; - /* Print it. */ uiout->text ("Value returned is "); uiout->field_fmt ("gdb-result-var", "$%d", rv->value_history_index); uiout->text (" = "); - get_user_print_options (&opts); - if (opts.finish_print) + if (finish_print) { + struct value_print_options opts; + get_user_print_options (&opts); + string_file stb; value_print (rv->value, &stb, &opts); uiout->field_stream ("return-value", stb); @@ -3351,7 +3356,7 @@ List all available info about the specified process."), &info_proc_cmdlist); add_setshow_boolean_cmd ("finish", class_support, - &user_print_options.finish_print, _("\ + &finish_print, _("\ Set whether `finish' prints the return value."), _("\ Show whether `finish' prints the return value."), NULL, NULL, |