aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r--gdb/rust-lang.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 47fc3db..fec68e3 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -2006,20 +2006,6 @@ rust_lookup_symbol_nonlocal (const struct language_defn *langdef,
-/* la_watch_location_expression for Rust. */
-
-static gdb::unique_xmalloc_ptr<char>
-rust_watch_location_expression (struct type *type, CORE_ADDR addr)
-{
- type = check_typedef (TYPE_TARGET_TYPE (check_typedef (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 ()));
-}
-
-
-
static const struct exp_descriptor exp_descriptor_rust =
{
rust_print_subexp,
@@ -2062,7 +2048,6 @@ extern const struct language_data rust_language_data =
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
- rust_watch_location_expression,
&default_varobj_ops,
rust_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
@@ -2143,6 +2128,18 @@ public:
rust_internal_print_type (type, varstring, stream, show, level,
flags, false, &podata);
}
+
+ /* See language.h. */
+
+ 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)));
+ 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 ()));
+ }
};
/* Single instance of the Rust language class. */