stream, show - 1, level, flags, false,
podata);
- if (TYPE_HIGH_BOUND_KIND (TYPE_INDEX_TYPE (type)) == PROP_LOCEXPR
- || TYPE_HIGH_BOUND_KIND (TYPE_INDEX_TYPE (type)) == PROP_LOCLIST)
+ if (TYPE_HIGH_BOUND_KIND (type->index_type ()) == PROP_LOCEXPR
+ || TYPE_HIGH_BOUND_KIND (type->index_type ()) == PROP_LOCLIST)
fprintf_filtered (stream, "; variable length");
else if (get_array_bounds (type, &low_bound, &high_bound))
fprintf_filtered (stream, "; %s",
}
}
-static void
-rust_print_type (struct type *type, const char *varstring,
- struct ui_file *stream, int show, int level,
- const struct type_print_options *flags)
-{
- print_offset_data podata;
- rust_internal_print_type (type, varstring, stream, show, level,
- flags, false, &podata);
-}
-
\f
/* Like arch_composite_type, but uses TYPE to decide how to allocate
bitpos += TYPE_LENGTH (type1) * TARGET_CHAR_BIT;
FIELD_NAME (*field) = field1;
- FIELD_TYPE (*field) = type1;
+ field->set_type (type1);
++i;
}
if (field2 != NULL)
SET_FIELD_BITPOS (*field, bitpos);
FIELD_NAME (*field) = field2;
- FIELD_TYPE (*field) = type2;
+ field->set_type (type2);
++i;
}
\f
-/* la_sniff_from_mangled_name for Rust. */
-
-static int
-rust_sniff_from_mangled_name (const char *mangled, char **demangled)
-{
- *demangled = gdb_demangle (mangled, DMGL_PARAMS | DMGL_ANSI);
- return *demangled != NULL;
-}
-
-\f
-
/* la_watch_location_expression for Rust. */
static gdb::unique_xmalloc_ptr<char>
rust_printchar, /* Print a character constant */
rust_printstr, /* Function to print string constant */
rust_emitchar, /* Print a single char */
- rust_print_type, /* Print a type using appropriate syntax */
rust_print_typedef, /* Print a typedef using appropriate syntax */
rust_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
rust_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- gdb_demangle, /* Language specific symbol demangler */
- rust_sniff_from_mangled_name,
NULL, /* Language specific
class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
default_collect_symbol_completion_matches,
rust_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- iterate_over_symbols,
- default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
rust_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
lai->bool_type_default = types[rust_primitive_bool];
lai->string_char_type = types[rust_primitive_u8];
}
+
+ /* See language.h. */
+ bool sniff_from_mangled_name (const char *mangled,
+ char **demangled) const override
+ {
+ *demangled = gdb_demangle (mangled, DMGL_PARAMS | DMGL_ANSI);
+ return *demangled != NULL;
+ }
+
+ /* See language.h. */
+
+ char *demangle (const char *mangled, int options) const override
+ {
+ return gdb_demangle (mangled, options);
+ }
+
+ /* 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
+ {
+ print_offset_data podata;
+ rust_internal_print_type (type, varstring, stream, show, level,
+ flags, false, &podata);
+ }
};
/* Single instance of the Rust language class. */