gdb/testsuite/tui: Always dump_screen when asked
[deliverable/binutils-gdb.git] / gdb / compile / compile-cplus-symbols.c
index 1bb3a6ffbfdba4c9b6c9f83cefd0800d2a5ffbca..34cae4a6d8f388ff5042aa59350cdd07c1b49a4d 100644 (file)
@@ -1,6 +1,6 @@
 /* Convert symbols from GDB to GCC
 
-   Copyright (C) 2014-2019 Free Software Foundation, Inc.
+   Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,7 +21,7 @@
 #include "defs.h"
 #include "compile-internal.h"
 #include "compile-cplus.h"
-#include "common/gdb_assert.h"
+#include "gdbsupport/gdb_assert.h"
 #include "symtab.h"
 #include "parser-defs.h"
 #include "block.h"
@@ -100,27 +100,27 @@ convert_one_symbol (compile_cplus_instance *instance,
              return;
            }
          instance->plugin ().build_constant
-           (sym_type, SYMBOL_NATURAL_NAME (sym.symbol),
+           (sym_type, sym.symbol->natural_name (),
             SYMBOL_VALUE (sym.symbol), filename, line);
          return;
 
        case LOC_CONST_BYTES:
          error (_("Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
-                SYMBOL_PRINT_NAME (sym.symbol));
+                sym.symbol->print_name ());
 
        case LOC_UNDEF:
          internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."),
-                         SYMBOL_PRINT_NAME (sym.symbol));
+                         sym.symbol->print_name ());
 
        case LOC_COMMON_BLOCK:
          error (_("Fortran common block is unsupported for compilation "
                   "evaluaton of symbol \"%s\"."),
-                SYMBOL_PRINT_NAME (sym.symbol));
+                sym.symbol->print_name ());
 
        case LOC_OPTIMIZED_OUT:
          error (_("Symbol \"%s\" cannot be used for compilation evaluation "
                   "as it is optimized out."),
-                SYMBOL_PRINT_NAME (sym.symbol));
+                sym.symbol->print_name ());
 
        case LOC_COMPUTED:
          if (is_local)
@@ -129,7 +129,7 @@ convert_one_symbol (compile_cplus_instance *instance,
          warning (_("Symbol \"%s\" is thread-local and currently can only "
                     "be referenced from the current thread in "
                     "compiled code."),
-                  SYMBOL_PRINT_NAME (sym.symbol));
+                  sym.symbol->print_name ());
          /* FALLTHROUGH */
        case LOC_UNRESOLVED:
          /* 'symbol_name' cannot be used here as that one is used only for
@@ -146,14 +146,14 @@ convert_one_symbol (compile_cplus_instance *instance,
                if (frame == nullptr)
                  error (_("Symbol \"%s\" cannot be used because "
                           "there is no selected frame"),
-                        SYMBOL_PRINT_NAME (sym.symbol));
+                        sym.symbol->print_name ());
              }
 
            val = read_var_value (sym.symbol, sym.block, frame);
            if (VALUE_LVAL (val) != lval_memory)
              error (_("Symbol \"%s\" cannot be used for compilation "
                       "evaluation as its address has not been found."),
-                    SYMBOL_PRINT_NAME (sym.symbol));
+                    sym.symbol->print_name ());
 
            kind = GCC_CP_SYMBOL_VARIABLE;
            addr = value_address (val);
@@ -189,12 +189,12 @@ convert_one_symbol (compile_cplus_instance *instance,
          if (!is_local)
            {
              compile_scope scope
-               = instance->new_scope (SYMBOL_NATURAL_NAME (sym.symbol),
+               = instance->new_scope (sym.symbol->natural_name (),
                                       SYMBOL_TYPE (sym.symbol));
              if (scope.nested_type () != GCC_TYPE_NONE)
                {
                  /* We found a symbol for this type that was defined inside
-                    some other symbol, e.g., a class tyepdef defined.  */
+                    some other symbol, e.g., a class typedef defined.  */
                  return;
                }
 
@@ -202,9 +202,9 @@ convert_one_symbol (compile_cplus_instance *instance,
            }
 
          /* Get the `raw' name of the symbol.  */
-         if (name.empty () && SYMBOL_NATURAL_NAME (sym.symbol) != nullptr)
+         if (name.empty () && sym.symbol->natural_name () != nullptr)
            name = compile_cplus_instance::decl_name
-             (SYMBOL_NATURAL_NAME (sym.symbol)).get ();
+             (sym.symbol->natural_name ()).get ();
 
          /* Define the decl.  */
          instance->plugin ().build_decl
@@ -323,7 +323,7 @@ convert_symbol_bmsym (compile_cplus_instance *instance,
   sym_type = instance->convert_type (type);
   instance->plugin ().push_namespace ("");
   instance->plugin ().build_decl
-    ("minsym", MSYMBOL_NATURAL_NAME (msym), kind, sym_type, nullptr, addr,
+    ("minsym", msym->natural_name (), kind, sym_type, nullptr, addr,
      nullptr, 0);
   instance->plugin ().pop_binding_level ("");
 }
@@ -388,7 +388,7 @@ gcc_cplus_convert_symbol (void *datum,
            }
        }
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &e)
+  catch (const gdb_exception &e)
     {
       /* We can't allow exceptions to escape out of this callback.  Safest
         is to simply emit a gcc error.  */
@@ -466,7 +466,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
        }
     }
 
-  catch (const gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const gdb_exception_error &e)
     {
       instance->plugin ().error (e.what ());
     }
This page took 0.026217 seconds and 4 git commands to generate.