GDB (xrefs)

Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/c-varobj.c File Reference
`#include "defs.h"`
`#include "value.h"`
`#include "varobj.h"`
`#include "gdbthread.h"`
`#include "valprint.h"`

Go to the source code of this file.

## Macros
#define | ANONYMOUS_STRUCT_NAME _("<anonymous struct>")
#define | ANONYMOUS_UNION_NAME _("<anonymous union>")

## Enumerations
enum | vsections { v_public = 0, v_private, v_protected }
enum | accessibility { private_field, protected_field, public_field }

## Functions
static void | cplus_class_num_children (struct type *type, int children[3])
bool | 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 bool | c_is_path_expr_parent (const struct varobj *var)
static int | c_number_of_children (const struct varobj *var)
static std::string | c_name_of_variable (const struct varobj *parent)
static struct value * | value_struct_element_index (struct value *value, int type_index)
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 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 struct value * | c_value_of_child (const struct varobj *parent, int index)
static struct type * | c_type_of_child (const struct varobj *parent, int index)
static struct type * | get_type (const struct varobj *var)
static std::string | c_value_of_variable (const struct varobj *var, enum varobj_display_formats format)
static int | cplus_number_of_children (const struct varobj *var)
static std::string | cplus_name_of_variable (const struct varobj *parent)
static int | match_accessibility (struct type *type, int index, enum accessibility acc)
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_name_of_child (const struct varobj *parent, int index)
static std::string | cplus_path_expr_of_child (const struct varobj *child)
static struct value * | cplus_value_of_child (const struct varobj *parent, int index)
static struct type * | cplus_type_of_child (const struct varobj *parent, int index)
static std::string | cplus_value_of_variable (const struct varobj *var, enum varobj_display_formats format)

## Variables
const struct lang_varobj_ops | c_varobj_ops
const struct lang_varobj_ops | cplus_varobj_ops

## Macro Definition Documentation

## ◆ ANONYMOUS_STRUCT_NAME

#define ANONYMOUS_STRUCT_NAME _("<anonymous struct>")

Definition at line 27 of file c-varobj.c.

Referenced by c_describe_child(), cplus_describe_child(), and varobj_is_anonymous_child().

## ◆ ANONYMOUS_UNION_NAME

#define ANONYMOUS_UNION_NAME _("<anonymous union>")

Definition at line 28 of file c-varobj.c.

Referenced by c_describe_child(), cplus_describe_child(), and varobj_is_anonymous_child().

## Enumeration Type Documentation

## ◆ accessibility

enum accessibility

Enumerator
private_field |
protected_field |
public_field |

Definition at line 680 of file c-varobj.c.

## ◆ vsections

enum vsections

Enumerator
v_public |
v_private |
v_protected |

Definition at line 554 of file c-varobj.c.

## Function Documentation

## ◆ adjust_value_for_child_access()

static void adjust_value_for_child_access | ( | struct value ** | value,
|  | struct type ** | type,
|  | int * | was_ptr,
|  | int | lookup_actual_type
| ) |  |
| static

Definition at line 65 of file c-varobj.c.

References CATCH, check_typedef(), END_CATCH, gdb_assert, get_target_type(), RETURN_MASK_ERROR, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_IS_REFERENCE, value_actual_type(), value_cast(), and value_ind().

Referenced by c_describe_child(), c_is_path_expr_parent(), c_number_of_children(), cplus_describe_child(), and cplus_number_of_children().

## ◆ c_describe_child()

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

Definition at line 285 of file c-varobj.c.

References adjust_value_for_child_access(), ANONYMOUS_STRUCT_NAME, ANONYMOUS_UNION_NAME, CATCH, END_CATCH, field_name(), get_target_type(), int_string(), varobj::name, value::parent, RETURN_MASK_ERROR, string, string_printf(), TRY, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_TARGET_TYPE, value_ind(), value_struct_element_index(), value_subscript(), varobj_get_path_expr(), varobj_get_path_expr_parent(), and varobj_get_value_type().

Referenced by c_name_of_child(), c_path_expr_of_child(), c_type_of_child(), c_value_of_child(), and cplus_describe_child().

## ◆ c_is_path_expr_parent()

static bool c_is_path_expr_parent | ( | const struct varobj * | var | ) |
| static

Definition at line 135 of file c-varobj.c.

References adjust_value_for_child_access(), CPLUS_FAKE_CHILD, field_name(), gdb_assert, varobj::index, varobj::parent, type, TYPE_CODE, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD_NAME, TYPE_NAME, TYPE_NFIELDS, TYPE_TAG_NAME, varobj_get_gdb_type(), and varobj_get_value_type().

## ◆ c_name_of_child()

static std::string c_name_of_child | ( | const struct varobj * | parent,
|  | int | index
| ) |  |
| static

Definition at line 430 of file c-varobj.c.

References c_describe_child(), name, and string.

## ◆ c_name_of_variable()

static std::string c_name_of_variable | ( | const struct varobj * | parent | ) |
| static

Definition at line 235 of file c-varobj.c.

References varobj::name.

Referenced by cplus_name_of_variable().

## ◆ c_number_of_children()

static int c_number_of_children | ( | const struct varobj * | var | ) |
| static

Definition at line 184 of file c-varobj.c.

References adjust_value_for_child_access(), get_target_type(), TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_FUNC, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_CODE_VOID, TYPE_LENGTH, TYPE_NFIELDS, and varobj_get_value_type().

Referenced by cplus_number_of_children().

## ◆ c_path_expr_of_child()

static std::string c_path_expr_of_child | ( | const struct varobj * | child | ) |
| static

Definition at line 439 of file c-varobj.c.

References c_describe_child(), varobj::index, varobj::parent, and string.

## ◆ c_type_of_child()

static struct type* c_type_of_child | ( | const struct varobj * | parent,
|  | int | index
| ) |  |
| static

Definition at line 458 of file c-varobj.c.

References c_describe_child(), and type.

## ◆ c_value_of_child()

static struct value* c_value_of_child | ( | const struct varobj * | parent,
|  | int | index
| ) |  |
| static

Definition at line 449 of file c-varobj.c.

References c_describe_child(), and value::parent.

## ◆ c_value_of_variable()

static std::string c_value_of_variable | ( | const struct varobj * | var,
|  | enum varobj_display_formats | format
| ) |  |
| static

Definition at line 482 of file c-varobj.c.

References check_typedef(), varobj::format, gdb_assert, get_type(), varobj::not_fetched, varobj::num_children, varobj::print_value, string, string_printf(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_IS_REFERENCE, TYPE_TARGET_TYPE, varobj::value, value_lazy(), varobj_value_get_print_value(), and varobj_value_is_changeable_p().

Referenced by cplus_value_of_variable().

## ◆ cplus_class_num_children()

static void cplus_class_num_children | ( | struct type * | type,
|  | int | children[3]
| ) |  |
| static

Definition at line 646 of file c-varobj.c.

References get_vptr_fieldno(), TYPE_FIELD_ARTIFICIAL, TYPE_FIELD_PRIVATE, TYPE_FIELD_PROTECTED, TYPE_N_BASECLASSES, TYPE_NFIELDS, v_private, v_protected, and v_public.

Referenced by cplus_describe_child(), and cplus_number_of_children().

## ◆ cplus_describe_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

Definition at line 700 of file c-varobj.c.

References adjust_value_for_child_access(), ANONYMOUS_STRUCT_NAME, ANONYMOUS_UNION_NAME, c_describe_child(), cplus_class_num_children(), CPLUS_FAKE_CHILD, field_name(), gdb_assert, get_user_print_options(), get_vptr_fieldno(), if(), match_accessibility(), varobj::name, value_print_options::objectprint, varobj::parent, private_field, protected_field, public_field, string, string_printf(), type, varobj::type, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD_ARTIFICIAL, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_IS_REFERENCE, TYPE_N_BASECLASSES, v_private, v_public, varobj::value, value_cast(), value_struct_element_index(), varobj_get_path_expr(), varobj_get_path_expr_parent(), and varobj_get_value_type().

Referenced by cplus_name_of_child(), cplus_path_expr_of_child(), cplus_type_of_child(), and cplus_value_of_child().

## ◆ cplus_name_of_child()

static std::string cplus_name_of_child | ( | const struct varobj * | parent,
|  | int | index
| ) |  |
| static

Definition at line 901 of file c-varobj.c.

References cplus_describe_child(), name, and string.

## ◆ cplus_name_of_variable()

static std::string cplus_name_of_variable | ( | const struct varobj * | parent | ) |
| static

Definition at line 675 of file c-varobj.c.

References c_name_of_variable().

## ◆ cplus_number_of_children()

static int cplus_number_of_children | ( | const struct varobj * | var | ) |
| static

Definition at line 562 of file c-varobj.c.

References adjust_value_for_child_access(), c_number_of_children(), varobj::children, cplus_class_num_children(), CPLUS_FAKE_CHILD, get_user_print_options(), varobj::name, value_print_options::objectprint, varobj::parent, type, varobj::type, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_IS_REFERENCE, TYPE_N_BASECLASSES, v_private, v_protected, v_public, varobj::value, and varobj_get_value_type().

## ◆ cplus_path_expr_of_child()

static std::string cplus_path_expr_of_child | ( | const struct varobj * | child | ) |
| static

Definition at line 910 of file c-varobj.c.

References cplus_describe_child(), varobj::index, varobj::parent, and string.

## ◆ cplus_type_of_child()

static struct type* cplus_type_of_child | ( | const struct varobj * | parent,
|  | int | index
| ) |  |
| static

Definition at line 929 of file c-varobj.c.

References cplus_describe_child(), and type.

## ◆ cplus_value_of_child()

static struct value* cplus_value_of_child | ( | const struct varobj * | parent,
|  | int | index
| ) |  |
| static

Definition at line 920 of file c-varobj.c.

References cplus_describe_child(), and value::parent.

## ◆ cplus_value_of_variable()

static std::string cplus_value_of_variable | ( | const struct varobj * | var,
|  | enum varobj_display_formats | format
| ) |  |
| static

Definition at line 938 of file c-varobj.c.

References c_value_of_variable(), CPLUS_FAKE_CHILD, and string.

## ◆ get_type()

static struct type* get_type | ( | const struct varobj * | var | ) |
| static

Definition at line 470 of file c-varobj.c.

References check_typedef(), type, and varobj::type.

Referenced by c_value_of_variable().

## ◆ match_accessibility()

static int match_accessibility | ( | struct type * | type,
|  | int | index,
|  | enum accessibility | acc
| ) |  |
| static

Definition at line 686 of file c-varobj.c.

References private_field, protected_field, public_field, TYPE_FIELD_PRIVATE, and TYPE_FIELD_PROTECTED.

Referenced by cplus_describe_child().

## ◆ value_struct_element_index()

static struct value* value_struct_element_index | ( | struct value * | value,
|  | int | type_index
| ) |  |
| static

Definition at line 247 of file c-varobj.c.

References CATCH, check_typedef(), END_CATCH, field_is_static(), gdb_assert, RETURN_MASK_ERROR, TRY, TYPE_CODE, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD, value_primitive_field(), value_static_field(), and value_type().

Referenced by c_describe_child(), and cplus_describe_child().

## ◆ varobj_is_anonymous_child()

bool varobj_is_anonymous_child | ( | const struct varobj * | child | ) |

Definition at line 38 of file c-varobj.c.

References ANONYMOUS_STRUCT_NAME, ANONYMOUS_UNION_NAME, and varobj::name.

Referenced by create_child_with_value().

## Variable Documentation

## ◆ c_varobj_ops

const struct lang_varobj_ops c_varobj_ops

Initial value:
=
{
c_number_of_children,
c_name_of_variable,
c_name_of_child,
c_path_expr_of_child,
c_value_of_child,
c_type_of_child,
c_value_of_variable,
varobj_default_value_is_changeable_p,
NULL,
c_is_path_expr_parent
}
c_name_of_variable
static std::string c_name_of_variable(const struct varobj *parent)
Definition: c-varobj.c:235
c_path_expr_of_child
static std::string c_path_expr_of_child(const struct varobj *child)
Definition: c-varobj.c:439
varobj_default_value_is_changeable_p
bool varobj_default_value_is_changeable_p(const struct varobj *var)
Definition: varobj.c:2440
c_value_of_child
static struct value * c_value_of_child(const struct varobj *parent, int index)
Definition: c-varobj.c:449
c_name_of_child
static std::string c_name_of_child(const struct varobj *parent, int index)
Definition: c-varobj.c:430
c_type_of_child
static struct type * c_type_of_child(const struct varobj *parent, int index)
Definition: c-varobj.c:458
c_is_path_expr_parent
static bool c_is_path_expr_parent(const struct varobj *var)
Definition: c-varobj.c:135
c_value_of_variable
static std::string c_value_of_variable(const struct varobj *var, enum varobj_display_formats format)
Definition: c-varobj.c:482
c_number_of_children
static int c_number_of_children(const struct varobj *var)
Definition: c-varobj.c:184

Definition at line 539 of file c-varobj.c.

Referenced by ada_name_of_variable().

## ◆ cplus_varobj_ops

const struct lang_varobj_ops cplus_varobj_ops

Initial value:
=
{
cplus_number_of_children,
cplus_name_of_variable,
cplus_name_of_child,
cplus_path_expr_of_child,
cplus_value_of_child,
cplus_type_of_child,
cplus_value_of_variable,
varobj_default_value_is_changeable_p,
NULL,
c_is_path_expr_parent
}
cplus_value_of_variable
static std::string cplus_value_of_variable(const struct varobj *var, enum varobj_display_formats format)
Definition: c-varobj.c:938
cplus_name_of_child
static std::string cplus_name_of_child(const struct varobj *parent, int index)
Definition: c-varobj.c:901
cplus_value_of_child
static struct value * cplus_value_of_child(const struct varobj *parent, int index)
Definition: c-varobj.c:920
varobj_default_value_is_changeable_p
bool varobj_default_value_is_changeable_p(const struct varobj *var)
Definition: varobj.c:2440
cplus_type_of_child
static struct type * cplus_type_of_child(const struct varobj *parent, int index)
Definition: c-varobj.c:929
cplus_number_of_children
static int cplus_number_of_children(const struct varobj *var)
Definition: c-varobj.c:562
c_is_path_expr_parent
static bool c_is_path_expr_parent(const struct varobj *var)
Definition: c-varobj.c:135
cplus_name_of_variable
static std::string cplus_name_of_variable(const struct varobj *parent)
Definition: c-varobj.c:675
cplus_path_expr_of_child
static std::string cplus_path_expr_of_child(const struct varobj *child)
Definition: c-varobj.c:910

Definition at line 953 of file c-varobj.c.