]> Git Repo - binutils.git/blobdiff - gdb/rust-lang.h
Automatic date update in version.in
[binutils.git] / gdb / rust-lang.h
index ec97cac3dae17b2e67290901cbe3029716e6c395..a1d10263feb3ffc355ad983de1600d7399d0c2c5 100644 (file)
@@ -1,6 +1,6 @@
 /* Rust language support definitions for GDB, the GNU debugger.
 
-   Copyright (C) 2016-2021 Free Software Foundation, Inc.
+   Copyright (C) 2016-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -71,6 +71,11 @@ public:
 
   /* See language.h.  */
 
+  const char *get_digit_separator () const override
+  { return "_"; }
+
+  /* See language.h.  */
+
   const std::vector<const char *> &filename_extensions () const override
   {
     static const std::vector<const char *> extensions = { ".rs" };
@@ -84,8 +89,9 @@ public:
 
   /* See language.h.  */
 
-  bool sniff_from_mangled_name (const char *mangled,
-                               char **demangled) const override
+  bool sniff_from_mangled_name
+       (const char *mangled, gdb::unique_xmalloc_ptr<char> *demangled)
+       const override
   {
     *demangled = gdb_demangle (mangled, DMGL_PARAMS | DMGL_ANSI);
     return *demangled != NULL;
@@ -93,13 +99,21 @@ public:
 
   /* See language.h.  */
 
-  char *demangle_symbol (const char *mangled, int options) const override
+  gdb::unique_xmalloc_ptr<char> demangle_symbol (const char *mangled,
+                                                int options) const override
   {
     return gdb_demangle (mangled, options);
   }
 
   /* See language.h.  */
 
+  bool can_print_type_offsets () const override
+  {
+    return true;
+  }
+
+  /* See language.h.  */
+
   void print_type (struct type *type, const char *varstring,
                   struct ui_file *stream, int show, int level,
                   const struct type_print_options *flags) const override;
@@ -109,11 +123,10 @@ public:
   gdb::unique_xmalloc_ptr<char> watch_location_expression
        (struct type *type, CORE_ADDR addr) const override
   {
-    type = check_typedef (TYPE_TARGET_TYPE (check_typedef (type)));
+    type = check_typedef (check_typedef (type)->target_type ());
     std::string name = type_to_string (type);
-    return gdb::unique_xmalloc_ptr<char>
-      (xstrprintf ("*(%s as *mut %s)", core_addr_to_string (addr),
-                  name.c_str ()));
+    return xstrprintf ("*(%s as *mut %s)", core_addr_to_string (addr),
+                      name.c_str ());
   }
 
   /* See language.h.  */
@@ -124,6 +137,11 @@ public:
 
   /* See language.h.  */
 
+  void value_print (struct value *val, struct ui_file *stream,
+                   const struct value_print_options *options) const override;
+
+  /* See language.h.  */
+
   struct block_symbol lookup_symbol_nonlocal
        (const char *name, const struct block *block,
         const domain_enum domain) const override
@@ -132,11 +150,11 @@ public:
 
     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));
+       gdb_printf (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.  */
@@ -177,9 +195,9 @@ public:
   void printchar (int ch, struct type *chtype,
                  struct ui_file *stream) const override
   {
-    fputs_filtered ("'", stream);
+    gdb_puts ("'", stream);
     emitchar (ch, chtype, stream, '\'');
-    fputs_filtered ("'", stream);
+    gdb_puts ("'", stream);
   }
 
   /* See language.h.  */
@@ -195,9 +213,9 @@ public:
                      struct ui_file *stream) const override
   {
     type = check_typedef (type);
-    fprintf_filtered (stream, "type %s = ", new_symbol->print_name ());
+    gdb_printf (stream, "type %s = ", new_symbol->print_name ());
     type_print (type, "", stream, 0);
-    fprintf_filtered (stream, ";");
+    gdb_printf (stream, ";");
   }
 
   /* See language.h.  */
@@ -209,11 +227,6 @@ public:
   bool range_checking_on_by_default () const override
   { return true; }
 
-  /* See language.h.  */
-
-  const struct op_print *opcode_print_table () const override
-  { return c_op_print_tab; }
-
 private:
 
   /* Helper for value_print_inner, arguments are as for that function.
This page took 0.030471 seconds and 4 git commands to generate.