27#define ANONYMOUS_STRUCT_NAME _("<anonymous struct>")
28#define ANONYMOUS_UNION_NAME _("<anonymous union>")
68 int lookup_actual_type)
86 if ((*type)->code () == TYPE_CODE_PTR)
100 catch (
const gdb_exception_error &except)
118 struct type *enclosing_type;
119 int real_type_found = 0;
124 *
type = enclosing_type;
145 if ((
type->
code () == TYPE_CODE_STRUCT
146 ||
type->
code () == TYPE_CODE_UNION)
156 struct type *parent_type;
162 if (parent_type->
code () == TYPE_CODE_STRUCT
163 || parent_type->
code () == TYPE_CODE_UNION)
193 case TYPE_CODE_ARRAY:
203 case TYPE_CODE_STRUCT:
204 case TYPE_CODE_UNION:
217 if (target->
code () == TYPE_CODE_FUNC
218 || target->
code () == TYPE_CODE_VOID)
247 struct value *result = NULL;
252 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
253 ||
type->
code () == TYPE_CODE_UNION);
262 catch (
const gdb_exception_error &e)
283 std::string *cname,
struct value **cvalue,
284 struct type **ctype, std::string *cfull_expression)
288 std::string parent_expression;
292 *cname = std::string ();
297 if (cfull_expression)
299 *cfull_expression = std::string ();
307 case TYPE_CODE_ARRAY:
321 catch (
const gdb_exception_error &except)
329 if (cfull_expression)
330 *cfull_expression = string_printf
331 (
"(%s)[%s]", parent_expression.c_str (),
337 case TYPE_CODE_STRUCT:
338 case TYPE_CODE_UNION:
356 if (cfull_expression)
357 *cfull_expression =
"";
364 if (cfull_expression)
366 const char *join = was_ptr ?
"->" :
".";
368 *cfull_expression = string_printf (
"(%s)%s%s",
369 parent_expression.c_str (),
387 *cname = string_printf (
"*%s", parent->
name.c_str ());
396 catch (
const gdb_exception_error &except)
408 if (cfull_expression)
409 *cfull_expression = string_printf (
"*(%s)", parent_expression.c_str ());
416 if (cfull_expression)
417 *cfull_expression =
"???";
434 std::string path_expr;
489 case TYPE_CODE_STRUCT:
490 case TYPE_CODE_UNION:
494 case TYPE_CODE_ARRAY:
500 if (var->
value == NULL)
505 return std::string ();
513 return std::string ();
516 gdb_assert (!var->
value->lazy ());
520 if (format == var->
format)
560 int children, dont_know;
561 int lookup_actual_type = 0;
574 if (opts.objectprint)
581 if (((
type->
code ()) == TYPE_CODE_STRUCT)
582 || ((
type->
code ()) == TYPE_CODE_UNION))
608 if (opts.objectprint)
618 if (var->
name ==
"public")
620 else if (var->
name ==
"private")
641 struct type *basetype = NULL;
653 if ((
type == basetype && i == vptr_fieldno)
693 std::string *cname,
struct value **cvalue,
struct type **ctype,
694 std::string *cfull_expression)
699 int lookup_actual_type = 0;
700 const char *parent_expression = NULL;
705 *cname = std::string ();
710 if (cfull_expression)
711 *cfull_expression = std::string ();
716 if (opts.objectprint)
720 if (cfull_expression)
726 if (
type->
code () == TYPE_CODE_STRUCT
727 ||
type->
code () == TYPE_CODE_UNION)
729 const char *join = was_ptr ?
"->" :
".";
742 struct type *basetype = NULL;
746 if (parent->
name ==
"private")
748 else if (parent->
name ==
"protected")
753 if ((
type == basetype && type_index == vptr_fieldno)
777 if (cfull_expression)
778 *cfull_expression = std::string ();
785 if (cfull_expression)
787 = string_printf (
"((%s)%s%s)", parent_expression, join,
811 if (cfull_expression)
813 const char *ptr = was_ptr ?
"*" :
"";
828 *cfull_expression = string_printf (
"(%s(class %s%s) %s)",
837 const char *access = NULL;
856 access =
"protected";
864 access =
"protected";
867 access =
"protected";
871 access =
"protected";
903 std::string path_expr;
936 return std::string ();
static struct value * value_struct_element_index(struct value *value, int type_index)
#define ANONYMOUS_STRUCT_NAME
static int c_number_of_children(const struct varobj *var)
static void adjust_value_for_child_access(struct value **value, struct type **type, int *was_ptr, int lookup_actual_type)
static bool c_is_path_expr_parent(const struct varobj *var)
#define ANONYMOUS_UNION_NAME
const struct lang_varobj_ops cplus_varobj_ops
const struct lang_varobj_ops c_varobj_ops
static struct value * c_value_of_child(const struct varobj *parent, int index)
static int cplus_number_of_children(const struct varobj *var)
static void cplus_class_num_children(struct type *type, int children[3])
static struct type * get_type(const struct varobj *var)
static std::string c_name_of_variable(const struct varobj *parent)
static std::string cplus_name_of_variable(const struct varobj *parent)
static std::string c_name_of_child(const struct varobj *parent, int index)
static std::string c_path_expr_of_child(const struct varobj *child)
static void cplus_describe_child(const struct varobj *parent, int index, std::string *cname, struct value **cvalue, struct type **ctype, std::string *cfull_expression)
static std::string cplus_value_of_variable(const struct varobj *var, enum varobj_display_formats format)
static struct value * cplus_value_of_child(const struct varobj *parent, int index)
static std::string cplus_name_of_child(const struct varobj *parent, int index)
static struct type * c_type_of_child(const struct varobj *parent, int index)
static std::string cplus_path_expr_of_child(const struct varobj *child)
static struct type * cplus_type_of_child(const struct varobj *parent, int index)
static std::string c_value_of_variable(const struct varobj *var, enum varobj_display_formats format)
static void c_describe_child(const struct varobj *parent, int index, std::string *cname, struct value **cvalue, struct type **ctype, std::string *cfull_expression)
static int match_accessibility(struct type *type, int index, enum accessibility acc)
bool varobj_is_anonymous_child(const struct varobj *child)
struct type * get_target_type(struct type *type)
int get_vptr_fieldno(struct type *type, struct type **basetypep)
struct type * check_typedef(struct type *type)
#define TYPE_IS_REFERENCE(t)
#define TYPE_FIELD_PROTECTED(thistype, n)
#define TYPE_FIELD_PRIVATE(thistype, n)
#define TYPE_N_BASECLASSES(thistype)
static gdbpy_ref field_name(struct type *type, int field)
LONGEST const_val() const
dynamic_prop_kind kind() const
bool is_artificial() const
const char * name() const
struct type * type() const
struct type * target_type() const
struct field & field(int idx) const
unsigned int num_fields() const
bool is_pointer_or_reference() const
range_bounds * bounds() const
const char * name() const
struct value * primitive_field(LONGEST offset, int fieldno, struct type *arg_type)
struct type * type() const
value(struct type *type_)
enum varobj_display_formats format
std::vector< varobj * > children
struct value * value_subscript(struct value *array, LONGEST index)
struct value * value_cast(struct type *type, struct value *arg2)
struct value * value_ind(struct value *arg1)
void get_user_print_options(struct value_print_options *opts)
struct value * value_static_field(struct type *type, int fieldno)
struct type * value_actual_type(struct value *value, int resolve_simple_types, int *real_type_found)
const char * varobj_get_path_expr(const struct varobj *var)
struct type * varobj_get_value_type(const struct varobj *var)
const struct varobj * varobj_get_path_expr_parent(const struct varobj *var)
bool varobj_value_is_changeable_p(const struct varobj *var)
bool varobj_default_value_is_changeable_p(const struct varobj *var)
struct type * varobj_get_gdb_type(const struct varobj *var)
std::string varobj_value_get_print_value(struct value *value, enum varobj_display_formats format, const struct varobj *var)
#define CPLUS_FAKE_CHILD(x)