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 "rust-lang.h"
#include "typeprint.h"
#include "valprint.h"
#include "varobj.h"
#include <algorithm>
#include <string>
#include <vector>
#include "cli/cli-style.h"
#include "parser-defs.h"
#include "rust-exp.h"
Go to the source code of this file.
Namespaces | |
namespace | expr |
Functions | |
const char * | rust_last_path_segment (const char *path) |
std::string | rust_crate_for_block (const struct block *block) |
static bool | rust_enum_p (struct type *type) |
static bool | rust_empty_enum_p (const struct type *type) |
static int | rust_enum_variant (struct type *type) |
bool | rust_tuple_type_p (struct type *type) |
static bool | rust_underscore_fields (struct type *type) |
bool | rust_tuple_struct_type_p (struct type *type) |
bool | rust_slice_type_p (const struct type *type) |
static bool | rust_range_type_p (struct type *type) |
static bool | rust_inclusive_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) |
struct value * | rust_slice_to_array (struct value *val) |
static void | rust_val_print_slice (struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options) |
static void | rust_internal_print_type (struct type *type, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags, bool for_rust_enum, print_offset_data *podata) |
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, bool for_rust_enum, print_offset_data *podata) |
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) |
struct value * | rust_range (struct type *expect_type, struct expression *exp, enum noside noside, enum range_flag kind, struct value *low, struct value *high) |
static void | rust_compute_range (struct type *type, struct value *range, LONGEST *low, LONGEST *high, range_flags *kind) |
struct value * | rust_subscript (struct type *expect_type, struct expression *exp, enum noside noside, bool for_addr, struct value *lhs, struct value *rhs) |
struct value * | eval_op_rust_complement (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode opcode, struct value *value) |
struct value * | eval_op_rust_array (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode opcode, struct value *elt, struct value *ncopies) |
Variables | |
static const struct generic_val_print_decorations | rust_decorations |
static rust_language | rust_language_defn |
struct value * eval_op_rust_array | ( | struct type * | expect_type, |
struct expression * | exp, | ||
enum noside noside noside | , | ||
enum exp_opcode | opcode, | ||
struct value * | elt, | ||
struct value * | ncopies ) |
Definition at line 1348 of file rust-lang.c.
References value::allocate(), EVAL_NORMAL, lookup_array_range_type(), value::type(), value_array(), and value_as_long().
struct value * eval_op_rust_complement | ( | struct type * | expect_type, |
struct expression * | exp, | ||
enum noside noside noside | , | ||
enum exp_opcode | opcode, | ||
struct value * | value ) |
Definition at line 1335 of file rust-lang.c.
References type::code(), value::type(), value_complement(), value_from_longest(), and value_logical_not().
|
static |
Definition at line 232 of file rust-lang.c.
References type::code(), type::is_unsigned(), and type::length().
Referenced by rust_language::emitchar().
|
static |
Definition at line 955 of file rust-lang.c.
References type::alloc_fields(), type::field(), type::length(), field::loc_bitpos(), name, type_allocator::new_type(), type::set_code(), type::set_length(), field::set_loc_bitpos(), field::set_name(), type::set_name(), field::set_type(), field::type(), and type_align().
Referenced by rust_range(), and rust_slice_type().
|
static |
Definition at line 1124 of file rust-lang.c.
References type::field(), field::name(), type::num_fields(), RANGE_HIGH_BOUND_DEFAULT, RANGE_LOW_BOUND_DEFAULT, RANGE_STANDARD, rust_inclusive_range_type_p(), value_as_long(), and value_field().
Referenced by rust_subscript().
std::string rust_crate_for_block | ( | const struct block * | block | ) |
Definition at line 58 of file rust-lang.c.
References cp_find_first_component(), and block::scope().
Referenced by rust_parser::crate_name().
|
static |
Definition at line 83 of file rust-lang.c.
References type::num_fields().
Referenced by expr::rust_struct_anon::evaluate(), expr::rust_structop::evaluate(), and rust_language::print_enum().
|
static |
Definition at line 72 of file rust-lang.c.
References TYPE_HAS_VARIANT_PARTS.
Referenced by expr::rust_struct_anon::evaluate(), expr::rust_structop::evaluate(), rust_language::is_string_type_p(), rust_language::print_enum(), rust_print_struct_def(), and rust_language::value_print_inner().
|
static |
Definition at line 92 of file rust-lang.c.
References type::field(), field::is_artificial(), and type::num_fields().
Referenced by expr::rust_struct_anon::evaluate(), expr::rust_structop::evaluate(), and rust_language::print_enum().
Definition at line 244 of file rust-lang.c.
References check_typedef(), type::code(), rust_vtable_symbol::concrete_type, type::field(), find_symbol_at_address(), lookup_pointer_type(), field::name(), type::num_fields(), type::pointer_type, symbol::subclass, symbol::symbol(), SYMBOL_RUST_VTABLE, value::type(), value_as_address(), value_cast(), and value_field().
Referenced by expr::rust_unop_ind_operation::evaluate().
|
static |
Definition at line 213 of file rust-lang.c.
References type::name().
Referenced by rust_compute_range().
|
static |
Definition at line 813 of file rust-lang.c.
References type::bounds(), c_print_type(), check_typedef(), type::code(), type::field(), flags, gdb_printf(), gdb_puts(), get_array_bounds(), type::has_varargs(), range_bounds::high, dynamic_prop::kind(), language_rust, name, field::name(), type::name(), type::num_fields(), PROP_LOCEXPR, PROP_LOCLIST, QUIT, rust_internal_print_type(), rust_print_struct_def(), cli_style_option::style(), styled_string(), type::target_type(), field::type(), type_print(), and variable_name_style.
Referenced by rust_language::print_type(), rust_internal_print_type(), and rust_print_struct_def().
const char * rust_last_path_segment | ( | const char * | path | ) |
Definition at line 46 of file rust-lang.c.
Referenced by expr::rust_struct_anon::evaluate(), expr::rust_structop::evaluate(), and quirk_rust_enum().
|
static |
Definition at line 677 of file rust-lang.c.
References c_print_type(), type::code(), type::dyn_prop(), DYN_PROP_VARIANT_PARTS, type::field(), type::fields(), print_offset_data::finish(), flags, fputs_styled(), gdb_printf(), gdb_puts(), print_offset_data::indentation, field::is_artificial(), field::is_static(), dynamic_prop::kind(), language_rust, field::name(), type::name(), type::num_fields(), dynamic_prop::original_type(), print_spaces(), PROP_TYPE, QUIT, rust_enum_p(), rust_internal_print_type(), rust_tuple_struct_type_p(), rust_tuple_type_p(), cli_style_option::style(), styled_string(), field::type(), TYPE_N_BASECLASSES, print_offset_data::update(), and variable_name_style.
Referenced by rust_internal_print_type().
struct value * rust_range | ( | struct type * | expect_type, |
struct expression * | exp, | ||
enum noside noside noside | , | ||
enum range_flag | kind, | ||
struct value * | low, | ||
struct value * | high ) |
Definition at line 1035 of file rust-lang.c.
References EVAL_AVOID_SIDE_EFFECTS, expression::gdbarch, type::index_type(), language_bool_type(), expression::language_defn, type::length(), lval_memory, name, RANGE_HIGH_BOUND_EXCLUSIVE, rust_composite_type(), value::type(), types_equal(), value_allocate_space_in_inferior(), value_as_long(), value_assign(), value_at_lazy(), value_struct_elt(), and value::zero().
Referenced by expr::rust_range_operation::evaluate().
|
static |
Definition at line 179 of file rust-lang.c.
References type::code(), type::field(), field::name(), type::name(), and type::num_fields().
Referenced by rust_subscript().
Definition at line 325 of file rust-lang.c.
References value::allocate_lazy(), check_typedef(), lookup_array_range_type(), lval_memory, rust_slice_type_p(), value::set_address(), value::set_lval(), type::target_type(), value::type(), value_as_address(), value_as_long(), and value_struct_elt().
Referenced by rust_val_print_slice(), and rust_language::to_array().
struct type * rust_slice_type | ( | const char * | name, |
struct type * | elt_type, | ||
struct type * | usize_type ) |
Definition at line 1017 of file rust-lang.c.
References lookup_pointer_type(), name, rust_composite_type(), and type.
Referenced by rust_language::language_arch_info(), rust_parser::parse_slice_type(), and rust_subscript().
bool rust_slice_type_p | ( | const struct type * | type | ) |
Definition at line 159 of file rust-lang.c.
References type::code(), type::field(), n1, n2, field::name(), type::name(), and type::num_fields().
Referenced by rust_language::is_array_like(), rust_language::is_string_type_p(), rust_slice_to_array(), rust_subscript(), and rust_language::val_print_struct().
struct value * rust_subscript | ( | struct type * | expect_type, |
struct expression * | exp, | ||
enum noside noside noside | , | ||
bool | for_addr, | ||
struct value * | lhs, | ||
struct value * | rhs ) |
Definition at line 1159 of file rust-lang.c.
References check_typedef(), type::code(), EVAL_AVOID_SIDE_EFFECTS, type::field(), expression::gdbarch, get_array_bounds(), expression::language_defn, language_lookup_primitive_type(), type::length(), value::lval(), field::name(), type::name(), new_type(), type::num_fields(), RANGE_HIGH_BOUND_DEFAULT, RANGE_LOW_BOUND_DEFAULT, rust_compute_range(), rust_range_type_p(), rust_slice_type(), rust_slice_type_p(), type::target_type(), field::type(), type, value::type(), value_addr(), value_allocate_space_in_inferior(), value_as_long(), value_assign(), value_at_lazy(), value_field(), value_from_longest(), value_struct_elt(), value_subscript(), and value::zero().
Referenced by expr::rust_subscript_operation::evaluate(), and expr::rust_subscript_operation::slice().
bool rust_tuple_struct_type_p | ( | struct type * | type | ) |
Definition at line 148 of file rust-lang.c.
References type::num_fields(), and rust_underscore_fields().
Referenced by expr::rust_struct_anon::evaluate(), expr::rust_structop::evaluate(), rust_parser::parse_path_expr(), rust_parser::parse_struct_expr(), rust_language::print_enum(), rust_print_struct_def(), and rust_language::val_print_struct().
bool rust_tuple_type_p | ( | struct type * | type | ) |
Definition at line 108 of file rust-lang.c.
References type::code(), and type::name().
Referenced by expr::rust_structop::evaluate(), expr::rust_structop::evaluate_funcall(), rust_parser::parse_struct_expr(), rust_print_struct_def(), and rust_language::val_print_struct().
|
static |
Definition at line 222 of file rust-lang.c.
References type::code(), type::is_unsigned(), and type::length().
Referenced by rust_language::is_string_type_p(), rust_language::printstr(), and rust_language::value_print_inner().
|
static |
Definition at line 122 of file rust-lang.c.
References type::code(), type::field(), field::is_static(), field::name(), and type::num_fields().
Referenced by rust_tuple_struct_type_p().
|
static |
Definition at line 349 of file rust-lang.c.
References check_typedef(), value::fetch_lazy(), gdb_printf(), generic_value_print(), type::name(), rust_decorations, rust_slice_to_array(), type::target_type(), value::type(), type_print(), val_print_string(), value_as_address(), value_as_long(), and value_struct_elt().
Referenced by rust_language::val_print_struct().
|
static |
Definition at line 308 of file rust-lang.c.
Referenced by rust_val_print_slice(), and rust_language::value_print_inner().
|
static |
Definition at line 1736 of file rust-lang.c.