/* print_frame_info_print_what[i] maps a choice to the corresponding
print_what enum. */
-static const gdb::optional<enum print_what> print_frame_info_print_what[] =
+static const std::optional<enum print_what> print_frame_info_print_what[] =
{{}, /* Empty value for "auto". */
SRC_LINE, LOCATION, SRC_AND_LOC, LOC_AND_ADDRESS, SHORT_LOCATION};
Value not present indicates to the caller to use default values
specific to the command being executed. */
-static gdb::optional<enum print_what>
+static std::optional<enum print_what>
print_frame_info_to_print_what (const char *print_frame_info)
{
for (int i = 0; print_frame_info_choices[i] != NULL; i++)
/* See stack.h. */
void
-get_user_print_what_frame_info (gdb::optional<enum print_what> *what)
+get_user_print_what_frame_info (std::optional<enum print_what> *what)
{
*what
= print_frame_info_to_print_what
else if (value->lval () == lval_register)
{
gdb_printf (" Previous frame's sp in %s\n",
- gdbarch_register_name (gdbarch,
- VALUE_REGNUM (value)));
+ gdbarch_register_name (gdbarch, value->regnum ()));
}
release_value (value);
struct print_variable_and_value_data
{
- gdb::optional<compiled_regex> preg;
- gdb::optional<compiled_regex> treg;
+ std::optional<compiled_regex> preg;
+ std::optional<compiled_regex> treg;
struct frame_id frame_id;
int num_tabs;
struct ui_file *stream;
If REGEXP is NULL, it results in an empty regular expression. */
static void
-prepare_reg (const char *regexp, gdb::optional<compiled_regex> *reg)
+prepare_reg (const char *regexp, std::optional<compiled_regex> *reg)
{
if (regexp != NULL)
{
If T_REGEXP is not NULL, only print local variables whose type
matches T_REGEXP.
If no local variables have been printed and !QUIET, prints a message
- explaining why no local variables could be printed.
-
- This function will invalidate FRAME. */
+ explaining why no local variables could be printed. */
static void
print_frame_local_vars (frame_info_ptr frame,
If T_REGEXP is not NULL, only print argument variables whose type
matches T_REGEXP.
If no argument variables have been printed and !QUIET, prints a message
- explaining why no argument variables could be printed.
-
- This function will invalidate FRAME. */
+ explaining why no argument variables could be printed. */
static void
print_frame_arg_vars (frame_info_ptr frame,
struct print_variable_and_value_data cb_data;
struct symbol *func;
CORE_ADDR pc;
- gdb::optional<compiled_regex> preg;
- gdb::optional<compiled_regex> treg;
+ std::optional<compiled_regex> preg;
+ std::optional<compiled_regex> treg;
if (!get_frame_pc_if_available (frame, &pc))
{
iterate_over_block_arg_vars (func->value_block (), cb_data);
- /* do_print_variable_and_value invalidates FRAME. */
- frame = NULL;
-
if (!cb_data.values_printed && !quiet)
{
if (regexp == NULL && t_regexp == NULL)
if (return_value != NULL)
{
struct type *return_type = return_value->type ();
- struct gdbarch *cache_arch = get_current_regcache ()->arch ();
+ regcache *regcache = get_thread_regcache (inferior_thread ());
+ struct gdbarch *cache_arch = regcache->arch ();
gdb_assert (rv_conv != RETURN_VALUE_STRUCT_CONVENTION
&& rv_conv != RETURN_VALUE_ABI_RETURNS_ADDRESS);
gdbarch_return_value_as_value
- (cache_arch, function, return_type,
- get_current_regcache (), NULL /*read*/,
+ (cache_arch, function, return_type, regcache, NULL /*read*/,
return_value->contents ().data () /*write*/);
}