Add "info connections" command, "info inferiors" connection number/string
[deliverable/binutils-gdb.git] / gdb / python / py-framefilter.c
index d805ec68f233bc257d7891a63b14e2dba58c5f03..fb41e95711ed10422d8a1b25a3a184ca88156c62 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -33,6 +33,7 @@
 #include "mi/mi-cmds.h"
 #include "python-internal.h"
 #include "gdbsupport/gdb_optional.h"
+#include "cli/cli-style.h"
 
 enum mi_print_types
 {
@@ -102,13 +103,13 @@ extract_sym (PyObject *obj, gdb::unique_xmalloc_ptr<char> *name,
 
       /* 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;
     }
@@ -319,7 +320,7 @@ py_print_single_arg (struct ui_out *out,
     {
       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
@@ -347,15 +348,15 @@ py_print_single_arg (struct ui_out *out,
     {
       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
@@ -396,9 +397,9 @@ py_print_single_arg (struct ui_out *out,
          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);
@@ -486,9 +487,6 @@ enumerate_args (PyObject *iter,
          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.  */
@@ -936,7 +934,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags,
 
              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)
            {
@@ -950,7 +948,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags,
          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 ());
        }
     }
 
@@ -990,7 +988,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags,
              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 ();
            }
        }
This page took 0.051506 seconds and 4 git commands to generate.