/* Python frame filters
- Copyright (C) 2013-2019 Free Software Foundation, Inc.
+ Copyright (C) 2013-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "mi/mi-cmds.h"
#include "python-internal.h"
#include "gdbsupport/gdb_optional.h"
+#include "cli/cli-style.h"
enum mi_print_types
{
/* Duplicate the symbol name, so the caller has consistency
in garbage collection. */
- name->reset (xstrdup (SYMBOL_PRINT_NAME (*sym)));
+ name->reset (xstrdup ((*sym)->print_name ()));
/* If a symbol is specified attempt to determine the language
from the symbol. If mode is not "auto", then the language
has been explicitly set, use that. */
if (language_mode == language_mode_auto)
- *language = language_def (SYMBOL_LANGUAGE (*sym));
+ *language = language_def ((*sym)->language ());
else
*language = current_language;
}
{
if (fa->val == NULL && fa->error == NULL)
return;
- language = language_def (SYMBOL_LANGUAGE (fa->sym));
+ language = language_def (fa->sym->language ());
val = fa->val;
}
else
{
string_file stb;
- fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (fa->sym),
- SYMBOL_LANGUAGE (fa->sym),
+ fprintf_symbol_filtered (&stb, fa->sym->print_name (),
+ fa->sym->language (),
DMGL_PARAMS | DMGL_ANSI);
if (fa->entry_kind == print_entry_values_compact)
{
stb.puts ("=");
- fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (fa->sym),
- SYMBOL_LANGUAGE (fa->sym),
+ fprintf_symbol_filtered (&stb, fa->sym->print_name (),
+ fa->sym->language (),
DMGL_PARAMS | DMGL_ANSI);
}
if (fa->entry_kind == print_entry_values_only
if (val == NULL)
{
gdb_assert (fa != NULL && fa->error != NULL);
- out->field_fmt ("value",
+ out->field_fmt ("value", metadata_style.style (),
_("<error reading variable: %s>"),
- fa->error);
+ fa->error.get ());
}
else
py_print_value (out, val, opts, 0, args_type, language);
read_frame_arg (user_frame_print_options,
sym, frame, &arg, &entryarg);
- gdb::unique_xmalloc_ptr<char> arg_holder (arg.error);
- gdb::unique_xmalloc_ptr<char> entry_holder (entryarg.error);
-
/* The object has not provided a value, so this is a frame
argument to be read by GDB. In this case we have to
account for entry-values. */
msymbol = lookup_minimal_symbol_by_pc (addr);
if (msymbol.minsym != NULL)
- function = MSYMBOL_PRINT_NAME (msymbol.minsym);
+ function = msymbol.minsym->print_name ();
}
else if (py_func != Py_None)
{
if (function == NULL)
out->field_skip ("func");
else
- out->field_string ("func", function, ui_out_style_kind::FUNCTION);
+ out->field_string ("func", function, function_name_style.style ());
}
}
out->text (" at ");
annotate_frame_source_file ();
out->field_string ("file", filename.get (),
- ui_out_style_kind::FILE);
+ file_name_style.style ());
annotate_frame_source_file_end ();
}
}