has any of its children deleted previously.
* varobj.c (delete_variable_1): Don't recurse
into deleted children.
+2007-11-07 Vladimir Prus <vladimir@codesourcery.com>
+
+ Fix crash when a variable object being deleted
+ has any of its children deleted previously.
+
+ * varobj.c (delete_variable_1): Don't recurse
+ into deleted children.
+
2007-11-07 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (legacy_virtual_frame_pointer): Add gdbarch parameter.
+2007-11-07 Vladimir Prus <vladimir@codesourcery.com>
+
+ * gdb.mi/mi-var-child.c (do_child_deletion): New.
+ * gdb.mi/mi-var-child.exp: Run child_deletion tests.
+
2007-11-05 Luis Machado <luisgpm@br.ibm.com>
* gdb.base/printcmds.exp: New function
incr_a(2);
}
+struct very_simple_struct
+{
+ int a;
+ int b;
+};
+
+int
+do_child_deletion (void)
+{
+ /*: BEGIN: child_deletion :*/
+ struct very_simple_struct s = {1, 2};
+ /*:
+ mi_create_varobj S s "create varobj for s"
+ mi_list_varobj_children S {{S.a a 0 int} {S.b b 0 int}} \
+ "list children of S"
+ mi_delete_varobj S.a "delete S.a"
+ mi_delete_varobj S.b "delete S.b"
+ mi_delete_varobj S "delete S"
+ :*/
+ return 99;
+ /*: END: child_deletion :*/
+}
+
int
main (int argc, char *argv [])
{
do_block_tests ();
do_children_tests ();
do_special_tests ();
+ do_child_deletion ();
exit (0);
}
"\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
"update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed"
+mi_prepare_inline_tests $srcfile
+mi_run_inline_test child_deletion
mi_gdb_exit
for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
{
varobj_p child = VEC_index (varobj_p, var->children, i);
+ if (!child)
+ continue;
if (!remove_from_parent_p)
child->parent = NULL;
delete_variable_1 (resultp, delcountp, child, 0, only_children_p);