|
GDB (xrefs)
|
#include "defs.h"#include <ctype.h>#include "block.h"#include "c-lang.h"#include "charset.h"#include "cp-support.h"#include "demangle.h"#include "gdbarch.h"#include "infcall.h"#include "objfiles.h"#include "psymtab.h"#include "rust-lang.h"#include "valprint.h"#include "varobj.h"#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | disr_info |
Macros | |
| #define | RUST_ENUM_PREFIX "RUST$ENCODED$ENUM$" |
| #define | RUST_ENCODED_ENUM_REAL 0 |
| #define | RUST_ENCODED_ENUM_HIDDEN 1 |
Functions | |
| static const char * | rust_last_path_segment (const char *path) |
| std::string | rust_crate_for_block (const struct block *block) |
| static bool | rust_union_is_untagged (struct type *type) |
| static struct disr_info | rust_get_disr_info (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct value *val) |
| bool | rust_tuple_type_p (struct type *type) |
| static bool | rust_underscore_fields (struct type *type, int offset) |
| bool | rust_tuple_struct_type_p (struct type *type) |
| static bool | rust_tuple_variant_type_p (struct type *type) |
| static bool | rust_slice_type_p (struct type *type) |
| static bool | rust_range_type_p (struct type *type) |
| static bool | rust_u8_type_p (struct type *type) |
| static bool | rust_chartype_p (struct type *type) |
| static struct value * | rust_get_trait_object_pointer (struct value *value) |
| static void | rust_emitchar (int c, struct type *type, struct ui_file *stream, int quoter) |
| static void | rust_printchar (int c, struct type *type, struct ui_file *stream) |
| static void | rust_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *user_encoding, int force_ellipses, const struct value_print_options *options) |
| static void | rust_val_print_str (struct ui_file *stream, struct value *val, const struct value_print_options *options) |
| static void | val_print_struct (struct type *type, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options) |
| static void | rust_val_print (struct type *type, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options) |
| 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) |
| static void | rust_print_struct_def (struct type *type, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags) |
| static void | rust_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream) |
| static int | rust_type_alignment (struct type *t) |
| static struct type * | rust_composite_type (struct type *original, const char *name, const char *field1, struct type *type1, const char *field2, struct type *type2) |
| struct type * | rust_slice_type (const char *name, struct type *elt_type, struct type *usize_type) |
| static void | rust_language_arch_info (struct gdbarch *gdbarch, struct language_arch_info *lai) |
| static struct value * | rust_evaluate_funcall (struct expression *exp, int *pos, enum noside noside) |
| static struct value * | rust_range (struct expression *exp, int *pos, enum noside noside) |
| static void | rust_compute_range (struct type *type, struct value *range, LONGEST *low, LONGEST *high, enum range_type *kind) |
| static struct value * | rust_subscript (struct expression *exp, int *pos, enum noside noside, int for_addr) |
| static struct value * | rust_evaluate_subexp (struct type *expect_type, struct expression *exp, int *pos, enum noside noside) |
| static void | rust_operator_length (const struct expression *exp, int pc, int *oplenp, int *argsp) |
| static const char * | rust_op_name (enum exp_opcode opcode) |
| static int | rust_dump_subexp_body (struct expression *exp, struct ui_file *stream, int elt) |
| static void | rust_print_subexp (struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec) |
| static int | rust_operator_check (struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data) |
| static struct block_symbol | rust_lookup_symbol_nonlocal (const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain) |
| static int | rust_sniff_from_mangled_name (const char *mangled, char **demangled) |
| static gdb::unique_xmalloc_ptr< char > | rust_watch_location_expression (struct type *type, CORE_ADDR addr) |
Variables | |
| static const struct generic_val_print_decorations | rust_decorations |
| static const struct exp_descriptor | exp_descriptor_rust |
| static const char * | rust_extensions [] |
| const struct language_defn | rust_language_defn |
| #define RUST_ENCODED_ENUM_HIDDEN 1 |
Definition at line 91 of file rust-lang.c.
Referenced by rust_evaluate_subexp(), rust_get_disr_info(), and rust_val_print().
| #define RUST_ENCODED_ENUM_REAL 0 |
Definition at line 87 of file rust-lang.c.
Referenced by rust_get_disr_info().
| #define RUST_ENUM_PREFIX "RUST$ENCODED$ENUM$" |
Definition at line 83 of file rust-lang.c.
Referenced by rust_get_disr_info(), rust_print_type(), and rust_union_is_untagged().
| enum rust_primitive_types |
Definition at line 1208 of file rust-lang.c.
|
static |
Definition at line 393 of file rust-lang.c.
References TYPE_CODE, TYPE_CODE_CHAR, TYPE_LENGTH, and TYPE_UNSIGNED.
Referenced by rust_emitchar().
|
static |
Definition at line 1129 of file rust-lang.c.
References alloc_type_copy(), FIELD_NAME, FIELD_TYPE, name, rust_type_alignment(), SET_FIELD_BITPOS, TARGET_CHAR_BIT, TYPE_CODE, TYPE_CODE_STRUCT, TYPE_FIELD, TYPE_FIELD_BITPOS, TYPE_FIELD_TYPE, TYPE_FIELDS, TYPE_LENGTH, TYPE_NAME, TYPE_NFIELDS, TYPE_TAG_NAME, and TYPE_ZALLOC.
Referenced by rust_range(), and rust_slice_type().
|
static |
Definition at line 1452 of file rust-lang.c.
References BOTH_BOUND_DEFAULT, HIGH_BOUND_DEFAULT, LOW_BOUND_DEFAULT, NONE_BOUND_DEFAULT, TYPE_FIELD_NAME, TYPE_NFIELDS, value_as_long(), and value_field().
Referenced by rust_subscript().
| std::string rust_crate_for_block | ( | const struct block * | block | ) |
Definition at line 56 of file rust-lang.c.
References block_scope(), cp_find_first_component(), and string.
Referenced by crate_name().
|
static |
Definition at line 2019 of file rust-lang.c.
References BYTES_TO_EXP_ELEM, dump_subexp(), dump_subexp_body_standard(), expression::elts, fprintf_filtered(), gdb_print_host_address, type::length, exp_element::longconst, longest_to_int(), exp_element::opcode, exp_element::string, exp_element::type, and type_print().
Definition at line 438 of file rust-lang.c.
References fprintf_filtered(), fputc_filtered(), fputs_filtered(), generic_emit_char(), get_type_arch(), rust_chartype_p(), and target_charset().
|
static |
Definition at line 1279 of file rust-lang.c.
References _, address_of_variable(), block_symbol::block, BYTES_TO_EXP_ELEM, call_function_by_hand(), expression::elts, error(), EVAL_AVOID_SIDE_EFFECTS, EVAL_SKIP, evaluate_subexp(), evaluate_subexp_standard(), get_selected_block(), exp_element::longconst, lookup_symbol(), name, not_lval, NULL_TYPE, exp_element::opcode, rust_tuple_type_p(), string, exp_element::string, block_symbol::symbol, SYMBOL_TYPE, type, TYPE_CODE, TYPE_CODE_ENUM, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD_TYPE, TYPE_NFIELDS, TYPE_TAG_NAME, TYPE_TARGET_TYPE, value_addr(), value_ind(), value_type(), value_zero(), and VAR_DOMAIN.
Referenced by rust_evaluate_subexp().
|
static |
Definition at line 1645 of file rust-lang.c.
References _, allocate_value(), builtin_type::builtin_int, BYTES_TO_EXP_ELEM, expression::elts, error(), EVAL_AVOID_SIDE_EFFECTS, EVAL_NORMAL, EVAL_SKIP, evaluate_subexp(), evaluate_subexp_standard(), field_name(), disr_info::field_no, gdb_assert, expression::gdbarch, disr_info::is_encoded, exp_element::longconst, longest_to_int(), lookup_array_range_type(), disr_info::name, NULL_TYPE, exp_element::opcode, RUST_ENCODED_ENUM_HIDDEN, rust_evaluate_funcall(), rust_get_disr_info(), rust_get_trait_object_pointer(), rust_range(), rust_subscript(), rust_tuple_struct_type_p(), rust_tuple_variant_type_p(), rust_union_is_untagged(), exp_element::string, exp_element::type, type, TYPE_CODE, TYPE_CODE_BOOL, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_LENGTH, TYPE_NFIELDS, TYPE_TAG_NAME, value_address(), value_allocate_space_in_inferior(), value_array(), value_as_long(), value_assign(), value_at_lazy(), value_complement(), value_contents(), value_embedded_offset(), value_from_longest(), value_ind(), value_logical_not(), VALUE_LVAL, value_primitive_field(), value_struct_elt(), value_type(), and value_zero().
|
static |
Definition at line 118 of file rust-lang.c.
References _, c_val_print(), error(), field_name(), disr_info::field_no, get_no_prettyformat_print_options(), disr_info::is_encoded, disr_info::name, name, RUST_ENCODED_ENUM_HIDDEN, RUST_ENCODED_ENUM_REAL, RUST_ENUM_PREFIX, rust_last_path_segment(), string, string_file::string(), token, TYPE_FIELD_BITPOS, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_NAME, TYPE_NFIELDS, TYPE_TAG_NAME, and unpack_long().
Referenced by rust_evaluate_subexp(), and rust_val_print().
Definition at line 405 of file rust-lang.c.
References check_typedef(), rust_vtable_symbol::concrete_type, find_symbol_at_address(), lookup_pointer_type(), pointer_type(), symbol::subclass, symbol, SYMBOL_RUST_VTABLE, TYPE_CODE, TYPE_CODE_STRUCT, TYPE_FIELD_NAME, TYPE_NFIELDS, value_as_address(), value_cast(), value_field(), and value_type().
Referenced by rust_evaluate_subexp().
|
static |
Definition at line 1232 of file rust-lang.c.
References arch_boolean_type(), arch_character_type(), arch_float_type(), arch_integer_type(), language_arch_info::bool_type_default, builtin_type::builtin_data_ptr, builtin_type(), floatformats_ieee_double, floatformats_ieee_single, GDBARCH_OBSTACK_CALLOC, type::length, make_cv_type(), nr_rust_primitive_types, language_arch_info::primitive_type_vector, rust_primitive_bool, rust_primitive_char, rust_primitive_f32, rust_primitive_f64, rust_primitive_i16, rust_primitive_i32, rust_primitive_i64, rust_primitive_i8, rust_primitive_isize, rust_primitive_str, rust_primitive_u16, rust_primitive_u32, rust_primitive_u64, rust_primitive_u8, rust_primitive_unit, rust_primitive_usize, rust_slice_type(), language_arch_info::string_char_type, and TYPE_LENGTH.
|
static |
Definition at line 44 of file rust-lang.c.
Referenced by rust_get_disr_info(), and rust_print_type().
|
static |
Definition at line 2187 of file rust-lang.c.
References block_symbol::block, block_scope(), cp_find_first_component(), domain_name(), fprintf_unfiltered(), gdb_stdlog, host_address_to_string, lookup_global_symbol(), lookup_symbol_in_static_block(), name, string, block_symbol::symbol, and symbol_lookup_debug.
|
static |
Definition at line 2003 of file rust-lang.c.
References op_name_standard().
|
static |
Definition at line 2153 of file rust-lang.c.
References expression::elts, exp_element::opcode, operator_check_standard(), exp_element::type, and TYPE_OBJFILE.
|
static |
Definition at line 1960 of file rust-lang.c.
References expression::elts, exp_element::longconst, longest_to_int(), exp_element::opcode, and operator_length_standard().
|
static |
Definition at line 816 of file rust-lang.c.
References c_print_type(), field_is_static(), flags, fprintf_filtered(), fprintfi_filtered(), fputs_filtered(), print_spaces_filtered(), QUIT, rust_print_type(), rust_tuple_struct_type_p(), rust_tuple_type_p(), TYPE_CODE, TYPE_CODE_STRUCT, TYPE_FIELD, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_N_BASECLASSES, TYPE_NFIELDS, and TYPE_TAG_NAME.
Referenced by rust_print_type().
|
static |
Definition at line 2084 of file rust-lang.c.
References BYTES_TO_EXP_ELEM, expression::elts, fprintf_filtered(), fputs_filtered(), type::length, exp_element::longconst, longest_to_int(), exp_element::opcode, PREC_SUFFIX, print_subexp(), print_subexp_standard(), exp_element::string, exp_element::type, and type_print().
|
static |
Definition at line 890 of file rust-lang.c.
References c_print_type(), check_typedef(), flags, fprintf_filtered(), fprintfi_filtered(), fputs_filtered(), get_array_bounds(), name, plongest(), PROP_LOCEXPR, PROP_LOCLIST, QUIT, RUST_ENUM_PREFIX, rust_last_path_segment(), rust_print_struct_def(), rust_tuple_struct_type_p(), rust_tuple_variant_type_p(), rust_union_is_untagged(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_ENUM, TYPE_CODE_FUNC, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_CODE_VOID, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_HIGH_BOUND_KIND, TYPE_INDEX_TYPE, TYPE_NAME, TYPE_NFIELDS, TYPE_TAG_NAME, TYPE_TARGET_TYPE, and TYPE_VARARGS.
Referenced by rust_print_struct_def().
|
static |
Definition at line 877 of file rust-lang.c.
References check_typedef(), fprintf_filtered(), new_symbol(), SYMBOL_PRINT_NAME, and type_print().
Definition at line 464 of file rust-lang.c.
References fputs_filtered(), and LA_EMIT_CHAR.
|
static |
Definition at line 474 of file rust-lang.c.
References c_printstr(), generic_printstr(), type::length, and rust_u8_type_p().
Referenced by rust_val_print().
|
static |
Definition at line 1355 of file rust-lang.c.
References _, builtin_type::builtin_int, expression::elts, error(), EVAL_AVOID_SIDE_EFFECTS, EVAL_SKIP, evaluate_subexp(), expression::gdbarch, HIGH_BOUND_DEFAULT, language_bool_type(), expression::language_defn, exp_element::longconst, longest_to_int(), LOW_BOUND_DEFAULT, lval_memory, name, NONE_BOUND_DEFAULT, NULL_TYPE, rust_composite_type(), TYPE_LENGTH, types_equal(), value_allocate_space_in_inferior(), value_as_long(), value_assign(), value_at_lazy(), value_from_longest(), value_struct_elt(), value_type(), and value_zero().
Referenced by rust_evaluate_subexp().
|
static |
Definition at line 351 of file rust-lang.c.
References TYPE_CODE, TYPE_CODE_STRUCT, TYPE_FIELD_NAME, TYPE_NFIELDS, and TYPE_TAG_NAME.
Referenced by rust_subscript().
| struct type* rust_slice_type | ( | const char * | name, |
| struct type * | elt_type, | ||
| struct type * | usize_type | ||
| ) |
Definition at line 1195 of file rust-lang.c.
References lookup_pointer_type(), name, rust_composite_type(), and type.
Referenced by convert_ast_to_type(), rust_language_arch_info(), and rust_subscript().
|
static |
Definition at line 340 of file rust-lang.c.
References TYPE_CODE, TYPE_CODE_STRUCT, and TYPE_TAG_NAME.
Referenced by rust_subscript(), and val_print_struct().
|
static |
Definition at line 2226 of file rust-lang.c.
References gdb_demangle().
|
static |
Definition at line 1484 of file rust-lang.c.
References _, BOTH_BOUND_DEFAULT, check_typedef(), error(), EVAL_AVOID_SIDE_EFFECTS, EVAL_SKIP, evaluate_subexp(), expression::gdbarch, get_array_bounds(), HIGH_BOUND_DEFAULT, expression::language_defn, language_lookup_primitive_type(), LONGEST_MAX, LOW_BOUND_DEFAULT, new_type(), NULL_TYPE, rust_compute_range(), rust_range_type_p(), rust_slice_type(), rust_slice_type_p(), type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_PTR, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_LENGTH, TYPE_NAME, TYPE_NFIELDS, TYPE_TARGET_TYPE, value_addr(), value_allocate_space_in_inferior(), value_as_long(), value_assign(), value_at_lazy(), value_field(), value_from_longest(), VALUE_LVAL, value_struct_elt(), value_subscript(), value_type(), and value_zero().
Referenced by rust_evaluate_subexp().
| bool rust_tuple_struct_type_p | ( | struct type * | type | ) |
Definition at line 320 of file rust-lang.c.
References rust_underscore_fields(), and TYPE_NFIELDS.
Referenced by convert_ast_to_expression(), rust_evaluate_subexp(), rust_print_struct_def(), rust_print_type(), rust_val_print(), and val_print_struct().
| bool rust_tuple_type_p | ( | struct type * | type | ) |
Definition at line 274 of file rust-lang.c.
References TYPE_CODE, TYPE_CODE_STRUCT, and TYPE_TAG_NAME.
Referenced by convert_ast_to_expression(), rust_evaluate_funcall(), rust_print_struct_def(), and val_print_struct().
|
static |
Definition at line 331 of file rust-lang.c.
References rust_underscore_fields().
Referenced by rust_evaluate_subexp(), rust_print_type(), and rust_val_print().
|
static |
Definition at line 1087 of file rust-lang.c.
References _, check_typedef(), error(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_COMPLEX, TYPE_CODE_ENUM, TYPE_CODE_FLT, TYPE_CODE_INT, TYPE_CODE_PTR, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD_TYPE, TYPE_LENGTH, TYPE_NFIELDS, and TYPE_TARGET_TYPE.
Referenced by rust_composite_type().
|
static |
Definition at line 383 of file rust-lang.c.
References TYPE_CODE, TYPE_CODE_INT, TYPE_LENGTH, and TYPE_UNSIGNED.
Referenced by rust_printstr(), and rust_val_print().
|
static |
Definition at line 289 of file rust-lang.c.
References field_is_static(), offset, TYPE_CODE, TYPE_CODE_STRUCT, TYPE_FIELD, TYPE_FIELD_NAME, TYPE_NFIELDS, and xsnprintf().
Referenced by rust_tuple_struct_type_p(), and rust_tuple_variant_type_p().
|
static |
Definition at line 96 of file rust-lang.c.
References RUST_ENUM_PREFIX, TYPE_FIELD_NAME, and TYPE_NFIELDS.
Referenced by rust_evaluate_subexp(), rust_print_type(), and rust_val_print().
|
static |
Definition at line 621 of file rust-lang.c.
References _, value_print_options::addressprint, c_val_print(), check_typedef(), current_language, value_print_options::deref_ref, error(), disr_info::field_no, fprintf_filtered(), fputs_filtered(), gdbarch_addressable_memory_unit_size(), generic_val_print(), get_array_bounds(), get_type_arch(), disr_info::is_encoded, disr_info::name, paddress(), rust_decorations, RUST_ENCODED_ENUM_HIDDEN, rust_get_disr_info(), rust_printstr(), rust_tuple_struct_type_p(), rust_tuple_variant_type_p(), rust_u8_type_p(), rust_union_is_untagged(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_INT, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHODPTR, TYPE_CODE_PTR, TYPE_CODE_STRING, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD_BITPOS, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_LENGTH, TYPE_NAME, TYPE_NFIELDS, TYPE_TARGET_TYPE, TYPE_UNSIGNED, unpack_pointer(), val_print(), val_print_string(), val_print_struct(), and value_contents_for_printing().
|
static |
Definition at line 507 of file rust-lang.c.
References TYPE_TARGET_TYPE, val_print_string(), value_as_address(), value_as_long(), value_struct_elt(), and value_type().
Referenced by val_print_struct().
|
static |
Definition at line 2237 of file rust-lang.c.
References check_typedef(), core_addr_to_string(), name, string, TYPE_TARGET_TYPE, type_to_string(), and xstrprintf().
|
static |
Definition at line 522 of file rust-lang.c.
References current_language, value_print_options::deref_ref, field_is_static(), fprintf_filtered(), fputs_filtered(), value_print_options::prettyformat, print_spaces_filtered(), rust_slice_type_p(), rust_tuple_struct_type_p(), rust_tuple_type_p(), rust_val_print_str(), TYPE_FIELD, TYPE_FIELD_BITPOS, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_NAME, TYPE_NFIELDS, TYPE_TAG_NAME, and val_print().
Referenced by rust_val_print().
|
static |
Definition at line 2248 of file rust-lang.c.
|
static |
Definition at line 604 of file rust-lang.c.
Referenced by rust_val_print().
|
static |
Definition at line 2258 of file rust-lang.c.
| const struct language_defn rust_language_defn |
1.8.14