+2019-05-29 Tom Tromey <tromey@adacore.com>
+
+ * NEWS: Add entry.
+ * infcmd.c (print_return_value_1): Handle finish_print
+ option.
+ (show_print_finish): New function.
+ (_initialize_infcmd): Add "set/show print finish" commands.
+ * valprint.c (user_print_options): Initialize new member.
+ * valprint.h (struct value_print_options) <finish_print>: New
+ member.
+
2019-05-28 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_remove_Xbn_suffix)
an error when a command (such as print expression) calls a function
in the program.
+set print finish [on|off]
+show print finish
+ This controls whether the `finish' command will display the value
+ that is returned by the current function. When `off', the value is
+ still entered into the value history, but it is not printed. The
+ default is `on'.
+
set print max-depth
show print max-depth
Allows deeply nested structures to be simplified when printing by
+2019-05-29 Tom Tromey <tromey@adacore.com>
+
+ * gdb.texinfo (Continuing and Stepping): Document new
+ commands.
+
2019-05-22 Alan Hayward <alan.hayward@arm.com>
* gdb.texinfo (Shell Commands): Add debugredirect.
Contrast this with the @code{return} command (@pxref{Returning,
,Returning from a Function}).
+@kindex set print finish
+@kindex show print finish
+@item set print finish @r{[}on|off@r{]}
+@itemx show print finish
+By default the @code{finish} command will show the value that is
+returned by the function. This can be disabled using @code{set print
+finish off}. When disabled, the value is still entered into the value
+history (@pxref{Value History}), but not displayed.
+
@kindex until
@kindex u @r{(@code{until})}
@cindex run until specified location
uiout->text (" = ");
get_user_print_options (&opts);
- string_file stb;
-
- value_print (rv->value, &stb, &opts);
- uiout->field_stream ("return-value", stb);
+ if (opts.finish_print)
+ {
+ string_file stb;
+ value_print (rv->value, &stb, &opts);
+ uiout->field_stream ("return-value", stb);
+ }
+ else
+ uiout->field_string ("return-value", _("<not displayed>"));
uiout->text ("\n");
}
else
info_proc_cmd_1 (args, IP_ALL, from_tty);
}
+/* Implement `show print finish'. */
+
+static void
+show_print_finish (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("\
+Printing of return value after `finish' is %s.\n"),
+ value);
+}
+
+
/* This help string is used for the run, start, and starti commands.
It is defined as a macro to prevent duplication. */
add_cmd ("all", class_info, info_proc_cmd_all, _("\
List all available info about the specified process."),
&info_proc_cmdlist);
+
+ add_setshow_boolean_cmd ("finish", class_support,
+ &user_print_options.finish_print, _("\
+Set whether `finish' prints the return value."), _("\
+Show whether `finish' prints the return value."), NULL,
+ NULL,
+ show_print_finish,
+ &setprintlist, &showprintlist);
}
+2019-05-29 Tom Tromey <tromey@adacore.com>
+
+ * gdb.base/finish.exp (finish_no_print): New proc.
+ (finish_tests): Call it.
+
2019-05-24 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/gdb-add-index.exp: New file.
"Testing the \"$abbrev\" abbreviation for \"finish\""
}
+# Test "set print finish off".
+proc finish_no_print {} {
+ global decimal
+
+ if {![runto "int_func"]} {
+ untested "couldn't run to main"
+ return
+ }
+ gdb_test_no_output "set print finish off"
+ gdb_test "finish" \
+ "Value returned is \\\$$decimal = <not displayed>"
+ gdb_test "print \$" " = 1" \
+ "Ensure return value was properly saved"
+}
+
proc finish_tests { } {
global gdb_prompt skip_float_test
finish_1 "double"
}
finish_abbreviation "fin"
+ finish_no_print
}
set prev_timeout $timeout
0, /* raw */
0, /* summary */
1, /* symbol_print */
- PRINT_MAX_DEPTH_DEFAULT /* max_depth */
+ PRINT_MAX_DEPTH_DEFAULT, /* max_depth */
+ 1 /* finish_print */
};
/* Initialize *OPTS to be a copy of the user print options. */
/* Maximum print depth when printing nested aggregates. */
int max_depth;
+
+ /* Whether "finish" should print the value. */
+ int finish_print;
};
/* The global print options set by the user. In general this should