aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2015-02-10 10:46:12 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2015-02-10 12:57:47 -0500
commitc1cc6152620563bbe861cfc2fa0a796e71ca87b5 (patch)
treee4f79bb5c6f7e33e255ac0d6648bc567156ef34c /gdb/varobj.h
parent834f871cdc6e5d9f5bda9ce607fd3c47f41a2ade (diff)
downloadgdb-c1cc6152620563bbe861cfc2fa0a796e71ca87b5.zip
gdb-c1cc6152620563bbe861cfc2fa0a796e71ca87b5.tar.gz
gdb-c1cc6152620563bbe861cfc2fa0a796e71ca87b5.tar.bz2
Finish constification of varobj interface
This completes the constification of the struct varobj pointers in the lang_varobj_ops interface partially done in b09e2c591f9221d865bfe8425990a6bf9fab24e3. As suggested by Pedro, varobj_get_path_expr casts away the const to assign the "mutable" struct member. gdb/ChangeLog: * ada-varobj.c (ada_name_of_child): Constify parent. (ada_path_expr_of_child): Same. (ada_value_of_child): Same. (ada_type_of_child): Same. * c-varobj.c (c_is_path_expr_parent): Same. (c_describe_child): Same. (c_name_of_child): Same. (c_value_of_child): Same. (c_type_of_child): Same. (cplus_number_of_children): Same. (cplus_describe_child): Constify var. (cplus_name_of_child): Constify parent. (cplus_value_of_child): Same. (cplus_type_of_child): Same. * jv-varobj.c (java_name_of_child): Same. (java_value_of_child): Same. (java_type_of_child): Same. * varobj.c (value_of_child): Same. (varobj_default_is_path_expr_parent): Constify var, parent and return value. (varobj_get_path_expr): Constify var, modify path_expr through mutable_var. (install_new_value): Constify parent. (value_of_child): Constify parent. * varobj.h (struct varobj): Constify parent. (struct lang_varobj_ops): Constify name_of_child, value_of_child and type_of_child. (varobj_get_path_expr): Constify var. (varobj_get_path_expr_parent): Constify var and return value.
Diffstat (limited to 'gdb/varobj.h')
-rw-r--r--gdb/varobj.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 30c31ef..6fe7009 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -120,7 +120,7 @@ struct varobj
int num_children;
/* If this object is a child, this points to its immediate parent. */
- struct varobj *parent;
+ const struct varobj *parent;
/* Children of this object. */
VEC (varobj_p) *children;
@@ -175,7 +175,7 @@ struct lang_varobj_ops
/* The name of the INDEX'th child of PARENT. The returned value must be
freed by the caller. */
- char *(*name_of_child) (struct varobj *parent, int index);
+ char *(*name_of_child) (const struct varobj *parent, int index);
/* Returns the rooted expression of CHILD, which is a variable
obtain that has some parent. The returned value must be freed by the
@@ -183,10 +183,10 @@ struct lang_varobj_ops
char *(*path_expr_of_child) (const struct varobj *child);
/* The ``struct value *'' of the INDEX'th child of PARENT. */
- struct value *(*value_of_child) (struct varobj *parent, int index);
+ struct value *(*value_of_child) (const struct varobj *parent, int index);
/* The type of the INDEX'th child of PARENT. */
- struct type *(*type_of_child) (struct varobj *parent, int index);
+ struct type *(*type_of_child) (const struct varobj *parent, int index);
/* The current value of VAR. The returned value must be freed by the
caller. */
@@ -285,7 +285,7 @@ extern char *varobj_get_type (struct varobj *var);
extern struct type *varobj_get_gdb_type (const struct varobj *var);
-extern char *varobj_get_path_expr (struct varobj *var);
+extern char *varobj_get_path_expr (const struct varobj *var);
extern const struct language_defn *
varobj_get_language (const struct varobj *var);
@@ -329,7 +329,8 @@ extern struct type *varobj_get_value_type (const struct varobj *var);
extern int varobj_is_anonymous_child (const struct varobj *child);
-extern struct varobj *varobj_get_path_expr_parent (struct varobj *var);
+extern const struct varobj *
+ varobj_get_path_expr_parent (const struct varobj *var);
extern char *varobj_value_get_print_value (struct value *value,
enum varobj_display_formats format,