[PATCH 2/6] Mention which return values need to be freed in lang_varobj_ops
Simon Marchi
simon.marchi@ericsson.com
Fri Jan 30 03:13:00 GMT 2015
This is the result of a little bit of investigation of the C and Ada
languages, as well as some common sense.
gdb/ChangeLog:
* varobj.h (lang_varobj_ops): Mention which return values need
to be freed.
---
gdb/varobj.h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 796b940..145b963 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -169,23 +169,28 @@ struct lang_varobj_ops
/* The number of children of PARENT. */
int (*number_of_children) (struct varobj *parent);
- /* The name (expression) of a root varobj. */
+ /* The name (expression) of a root varobj. The returned value must be freed
+ by the caller. */
char *(*name_of_variable) (struct varobj *parent);
- /* The name of the INDEX'th child of PARENT. */
+ /* 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);
/* Returns the rooted expression of CHILD, which is a variable
- obtain that has some parent. */
+ obtain that has some parent. The returned value must be freed by the
+ caller. */
char *(*path_expr_of_child) (struct varobj *child);
- /* The ``struct value *'' of the INDEX'th child of PARENT. */
+ /* The ``struct value *'' of the INDEX'th child of PARENT. The returned
+ value must be freed by the caller. */
struct value *(*value_of_child) (struct varobj *parent, int index);
/* The type of the INDEX'th child of PARENT. */
struct type *(*type_of_child) (struct varobj *parent, int index);
- /* The current value of VAR. */
+ /* The current value of VAR. The returned value must be freed by the
+ caller. */
char *(*value_of_variable) (struct varobj *var,
enum varobj_display_formats format);
--
2.1.4
More information about the Gdb-patches
mailing list