summaryrefslogtreecommitdiff
path: root/gdb/varobj.h
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-05-28 12:06:36 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-05-28 12:06:36 +0000
commitf7f9ae2c16fc3c4b620beee844aec2562ea71ab4 (patch)
treee12364fd9b579f8b690de636d929945ce638f407 /gdb/varobj.h
parent124b52c6d8bb2e44bd22fd1da6e18bb9ad7e30a6 (diff)
Refactor varobj_update interface.
* varobj.c (varobj_update): Report changes as vector. Also return not just a list of varobj, but a list of special structures that tell what exactly has changed. * varobj.h (enum varobj_update_error): Rename to varobj_scope_status. (struct varobj_update_result_t): New. (varobj_update): Adjust prototype. * mi/mi-cmd-var.c: Adjust for changes.
Diffstat (limited to 'gdb/varobj.h')
-rw-r--r--gdb/varobj.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 4fc7d1ecfb..9ecef0f21c 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -39,12 +39,14 @@ enum varobj_type
USE_SELECTED_FRAME /* Always reevaluate in selected frame */
};
-/* Error return values for varobj_update function. */
-enum varobj_update_error
+/* Enumerator describing if a variable object is in scope. */
+enum varobj_scope_status
{
- NOT_IN_SCOPE = -1, /* varobj not in scope, can not be updated. */
- TYPE_CHANGED = -2, /* varobj type has changed. */
- INVALID = -3, /* varobj is not valid anymore. */
+ VAROBJ_IN_SCOPE = 0, /* Varobj is scope, value available. */
+ VAROBJ_NOT_IN_SCOPE = 1, /* Varobj is not in scope, value not available,
+ but varobj can become in scope later. */
+ VAROBJ_INVALID = 2, /* Varobj no longer has any value, and never
+ will. */
};
/* String representations of gdb's format codes (defined in varobj.c) */
@@ -65,6 +67,16 @@ struct varobj;
typedef struct varobj *varobj_p;
DEF_VEC_P (varobj_p);
+typedef struct varobj_update_result_t
+{
+ struct varobj *varobj;
+ int type_changed;
+ int changed;
+ enum varobj_scope_status status;
+} varobj_update_result;
+
+DEF_VEC_O (varobj_update_result);
+
/* API functions */
extern struct varobj *varobj_create (char *objname,
@@ -120,8 +132,8 @@ extern int varobj_set_value (struct varobj *var, char *expression);
extern int varobj_list (struct varobj ***rootlist);
-extern int varobj_update (struct varobj **varp, struct varobj ***changelist,
- int explicit);
+extern VEC(varobj_update_result) *varobj_update (struct varobj **varp,
+ int explicit);
extern void varobj_invalidate (void);