diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-01-04 21:55:04 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-01-04 21:55:04 +0000 |
commit | 74a44383f0a7ceb4976b51dbf0a8709df34b8e24 (patch) | |
tree | 84063fb23e9cf9bbcd893dee5ba9450a40233855 /gdb/varobj.c | |
parent | 1b572db9ac86f8af568f13e3fa84cc3eecdb609c (diff) | |
download | gdb-74a44383f0a7ceb4976b51dbf0a8709df34b8e24.zip gdb-74a44383f0a7ceb4976b51dbf0a8709df34b8e24.tar.gz gdb-74a44383f0a7ceb4976b51dbf0a8709df34b8e24.tar.bz2 |
* varobj.c (varobj_list_children): Stop if the number of children is
unknown.
(c_number_of_children): Report no children for zero sized arrays.
* lib/mi-support.exp (mi_runto_helper): Expect two prompts
when continuing.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r-- | gdb/varobj.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index fbd8c82..a9f8ee0 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -685,6 +685,10 @@ varobj_list_children (struct varobj *var, struct varobj ***childlist) if (var->num_children == -1) var->num_children = number_of_children (var); + /* If that failed, give up. */ + if (var->num_children == -1) + return -1; + /* If we're called when the list of children is not yet initialized, allocate enough elements in it. */ while (VEC_length (varobj_p, var->children) < var->num_children) @@ -1711,7 +1715,9 @@ c_number_of_children (struct varobj *var) && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED) children = TYPE_LENGTH (type) / TYPE_LENGTH (target); else - children = -1; + /* If we don't know how many elements there are, don't display + any. */ + children = 0; break; case TYPE_CODE_STRUCT: |