X-Git-Url: https://repo.jachan.dev/binutils.git/blobdiff_plain/4a94e36819485cdbd50438f800d1e478156a4889..HEAD:/gdb/rust-lang.h diff --git a/gdb/rust-lang.h b/gdb/rust-lang.h index 60a1967ff4..a1d10263fe 100644 --- a/gdb/rust-lang.h +++ b/gdb/rust-lang.h @@ -71,6 +71,11 @@ public: /* See language.h. */ + const char *get_digit_separator () const override + { return "_"; } + + /* See language.h. */ + const std::vector &filename_extensions () const override { static const std::vector extensions = { ".rs" }; @@ -102,6 +107,13 @@ public: /* 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; @@ -111,7 +123,7 @@ public: gdb::unique_xmalloc_ptr 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 xstrprintf ("*(%s as *mut %s)", core_addr_to_string (addr), name.c_str ()); @@ -125,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 @@ -133,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. */ @@ -178,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. */ @@ -196,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. */