Don't write to inferior_ptid in corelow.c
[deliverable/binutils-gdb.git] / gdb / rust-lang.c
index c2fd3ba5946990aa765a392722b70114e0f9ce59..d251dab29fc403232897b99aa1083e46429f72d2 100644 (file)
@@ -1961,51 +1961,6 @@ rust_operator_check (struct expression *exp, int pos,
 
 \f
 
-/* Implementation of la_lookup_symbol_nonlocal for Rust.  */
-
-static struct block_symbol
-rust_lookup_symbol_nonlocal (const struct language_defn *langdef,
-                            const char *name,
-                            const struct block *block,
-                            const domain_enum domain)
-{
-  struct block_symbol result = {};
-
-  if (symbol_lookup_debug)
-    {
-      fprintf_unfiltered (gdb_stdlog,
-                         "rust_lookup_symbol_non_local"
-                         " (%s, %s (scope %s), %s)\n",
-                         name, host_address_to_string (block),
-                         block_scope (block), domain_name (domain));
-    }
-
-  /* Look up bare names in the block's scope.  */
-  std::string scopedname;
-  if (name[cp_find_first_component (name)] == '\0')
-    {
-      const char *scope = block_scope (block);
-
-      if (scope[0] != '\0')
-       {
-         scopedname = std::string (scope) + "::" + name;
-         name = scopedname.c_str ();
-       }
-      else
-       name = NULL;
-    }
-
-  if (name != NULL)
-    {
-      result = lookup_symbol_in_static_block (name, block, domain);
-      if (result.symbol == NULL)
-       result = lookup_global_symbol (name, block, domain);
-    }
-  return result;
-}
-
-\f
-
 static const struct exp_descriptor exp_descriptor_rust = 
 {
   rust_print_subexp,
@@ -2042,7 +1997,6 @@ extern const struct language_data rust_language_data =
   rust_print_typedef,          /* Print a typedef using appropriate syntax */
   NULL,                                /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
-  rust_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
   c_op_print_tab,              /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
@@ -2147,6 +2101,47 @@ public:
   {
     return rust_value_print_inner (val, stream, recurse, options);
   }
+
+  /* See language.h.  */
+
+  struct block_symbol lookup_symbol_nonlocal
+       (const char *name, const struct block *block,
+        const domain_enum domain) const override
+  {
+    struct block_symbol result = {};
+
+    if (symbol_lookup_debug)
+      {
+       fprintf_unfiltered (gdb_stdlog,
+                           "rust_lookup_symbol_non_local"
+                           " (%s, %s (scope %s), %s)\n",
+                           name, host_address_to_string (block),
+                           block_scope (block), domain_name (domain));
+      }
+
+    /* Look up bare names in the block's scope.  */
+    std::string scopedname;
+    if (name[cp_find_first_component (name)] == '\0')
+      {
+       const char *scope = block_scope (block);
+
+       if (scope[0] != '\0')
+         {
+           scopedname = std::string (scope) + "::" + name;
+           name = scopedname.c_str ();
+         }
+       else
+         name = NULL;
+      }
+
+    if (name != NULL)
+      {
+       result = lookup_symbol_in_static_block (name, block, domain);
+       if (result.symbol == NULL)
+         result = lookup_global_symbol (name, block, domain);
+      }
+    return result;
+  }
 };
 
 /* Single instance of the Rust language class.  */
This page took 0.02591 seconds and 4 git commands to generate.