27 #define ANONYMOUS_STRUCT_NAME _("<anonymous struct>")
28 #define ANONYMOUS_UNION_NAME _("<anonymous union>")
68 int lookup_actual_type)
117 if (value && *value && lookup_actual_type)
119 struct type *enclosing_type;
120 int real_type_found = 0;
125 *type = enclosing_type;
158 struct type *parent_type;
171 return !(field_name == NULL || *field_name ==
'\0');
237 return xstrdup (parent->
name);
246 static struct value *
249 struct value *result = NULL;
286 char **cname,
struct value **cvalue,
struct type **ctype,
287 char **cfull_expression)
291 char *parent_expression = NULL;
300 if (cfull_expression)
302 *cfull_expression = NULL;
334 if (cfull_expression)
352 if (field_name == NULL || *field_name ==
'\0')
363 if (cfull_expression)
364 *cfull_expression = xstrdup (
"");
369 *cname = xstrdup (field_name);
371 if (cfull_expression)
373 char *join = was_ptr ?
"->" :
".";
375 *cfull_expression =
xstrprintf (
"(%s)%s%s", parent_expression,
415 if (cfull_expression)
416 *cfull_expression =
xstrprintf (
"*(%s)", parent_expression);
423 *cname = xstrdup (
"???");
424 if (cfull_expression)
425 *cfull_expression = xstrdup (
"???");
449 static struct value *
499 return xstrdup (
"{...}");
513 if (var->
value == NULL)
533 if (format == var->
format)
572 int children, dont_know;
573 int lookup_actual_type = 0;
625 value = parent->
value;
632 if (strcmp (var->
name,
"public") == 0)
634 else if (strcmp (var->
name,
"private") == 0)
655 struct type *basetype = NULL;
667 if ((type == basetype && i == vptr_fieldno)
707 char **cname,
struct value **cvalue,
struct type **ctype,
708 char **cfull_expression)
713 int lookup_actual_type = 0;
714 char *parent_expression = NULL;
724 if (cfull_expression)
725 *cfull_expression = NULL;
735 if (cfull_expression)
744 char *join = was_ptr ?
"->" :
".";
757 struct type *basetype = NULL;
761 if (strcmp (parent->
name,
"private") == 0)
763 else if (strcmp (parent->
name,
"protected") == 0)
768 if ((type == basetype && type_index == vptr_fieldno)
780 if (field_name == NULL || *field_name ==
'\0')
792 if (cfull_expression)
793 *cfull_expression = xstrdup (
"");
800 if (cfull_expression)
802 =
xstrprintf (
"((%s)%s%s)", parent_expression, join,
826 if (cfull_expression)
828 char *ptr = was_ptr ?
"*" :
"";
843 *cfull_expression =
xstrprintf (
"(%s(class %s%s) %s)",
871 access =
"protected";
879 access =
"protected";
882 access =
"protected";
886 access =
"protected";
895 *cname = xstrdup (access);
925 static struct value *
#define TYPE_FIELD_PRIVATE(thistype, n)
struct value * value_primitive_field(struct value *arg1, int offset, int fieldno, struct type *arg_type)
struct value * value_subscript(struct value *array, LONGEST index)
int get_vptr_fieldno(struct type *type, struct type **basetypep)
#define TYPE_FIELD_NAME(thistype, n)
#define TYPE_N_BASECLASSES(thistype)
int varobj_default_value_is_changeable_p(const struct varobj *var)
#define TYPE_LOW_BOUND(range_type)
char * int_string(LONGEST val, int radix, int is_signed, int width, int use_c_format)
#define TYPE_NAME(thistype)
#define TYPE_FIELD_ARTIFICIAL(thistype, n)
int varobj_is_anonymous_child(const struct varobj *child)
static void adjust_value_for_child_access(struct value **value, struct type **type, int *was_ptr, int lookup_actual_type)
static char * cplus_value_of_variable(const struct varobj *var, enum varobj_display_formats format)
static char * cplus_path_expr_of_child(const struct varobj *child)
static void cplus_describe_child(const struct varobj *parent, int index, char **cname, struct value **cvalue, struct type **ctype, char **cfull_expression)
static char * c_name_of_child(const struct varobj *parent, int index)
struct value * value_ind(struct value *arg1)
#define CPLUS_FAKE_CHILD(x)
static struct value * cplus_value_of_child(const struct varobj *parent, int index)
#define TYPE_FIELD(thistype, n)
#define TYPE_FIELD_TYPE(thistype, n)
static char * cplus_name_of_child(const struct varobj *parent, int index)
static void cplus_class_num_children(struct type *type, int children[3])
static struct value * c_value_of_child(const struct varobj *parent, int index)
const struct varobj * parent
static char * c_name_of_variable(const struct varobj *parent)
struct type * check_typedef(struct type *type)
#define CATCH(EXCEPTION, MASK)
int value_lazy(struct value *value)
int field_is_static(struct field *f)
struct value * value_static_field(struct type *type, int fieldno)
static int c_is_path_expr_parent(const struct varobj *var)
static struct type * cplus_type_of_child(const struct varobj *parent, int index)
int varobj_value_is_changeable_p(const struct varobj *var)
struct value * value_cast(struct type *type, struct value *arg2)
char * xstrprintf(const char *format,...)
#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype)
static char * cplus_name_of_variable(const struct varobj *parent)
struct type * get_target_type(struct type *type)
#define ANONYMOUS_UNION_NAME
#define TYPE_FIELD_PROTECTED(thistype, n)
static struct type * c_type_of_child(const struct varobj *parent, int index)
static struct value * value_struct_element_index(struct value *value, int type_index)
static int cplus_number_of_children(const struct varobj *var)
static int match_accessibility(struct type *type, int index, enum accessibility acc)
#define TYPE_TARGET_TYPE(thistype)
#define TYPE_CODE(thistype)
#define TYPE_INDEX_TYPE(type)
void get_user_print_options(struct value_print_options *opts)
#define TYPE_NFIELDS(thistype)
char * varobj_value_get_print_value(struct value *value, enum varobj_display_formats format, const struct varobj *var)
#define TYPE_TAG_NAME(type)
struct type * varobj_get_gdb_type(const struct varobj *var)
static struct type * get_type(const struct varobj *var)
static PyObject * field_name(struct type *type, int field)
struct type * value_type(const struct value *value)
static void c_describe_child(const struct varobj *parent, int index, char **cname, struct value **cvalue, struct type **ctype, char **cfull_expression)
char * varobj_get_path_expr(const struct varobj *var)
struct type * varobj_get_value_type(const struct varobj *var)
#define TYPE_LENGTH(thistype)
const struct varobj * varobj_get_path_expr_parent(const struct varobj *var)
enum varobj_display_formats format
static char * c_value_of_variable(const struct varobj *var, enum varobj_display_formats format)
#define ANONYMOUS_STRUCT_NAME
static int c_number_of_children(const struct varobj *var)
struct type * value_actual_type(struct value *value, int resolve_simple_types, int *real_type_found)
static char * c_path_expr_of_child(const struct varobj *child)