forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2007-11-08 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-10-29 Joel Brobecker <brobecker@adacore.com>
|
2007-10-29 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* version.in: Set version to 6.7.1.20071029-cvs.
|
* version.in: Set version to 6.7.1.20071029-cvs.
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
2007-11-08 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-10-09 Daniel Jacobowitz <dan@codesourcery.com>
|
2007-10-09 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* gdb.server/server-run.exp: Test for dynamic linker symbols.
|
* gdb.server/server-run.exp: Test for dynamic linker symbols.
|
||||||
|
|||||||
@@ -306,6 +306,29 @@ do_special_tests (void)
|
|||||||
incr_a(2);
|
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
|
int
|
||||||
main (int argc, char *argv [])
|
main (int argc, char *argv [])
|
||||||
{
|
{
|
||||||
@@ -313,6 +336,7 @@ main (int argc, char *argv [])
|
|||||||
do_block_tests ();
|
do_block_tests ();
|
||||||
do_children_tests ();
|
do_children_tests ();
|
||||||
do_special_tests ();
|
do_special_tests ();
|
||||||
|
do_child_deletion ();
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1227,7 +1227,9 @@ mi_gdb_test "-var-update *" \
|
|||||||
"\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
|
"\\^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"
|
"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
|
mi_gdb_exit
|
||||||
|
|||||||
@@ -1295,6 +1295,8 @@ delete_variable_1 (struct cpstack **resultp, int *delcountp,
|
|||||||
for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
|
for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
|
||||||
{
|
{
|
||||||
varobj_p child = VEC_index (varobj_p, var->children, i);
|
varobj_p child = VEC_index (varobj_p, var->children, i);
|
||||||
|
if (!child)
|
||||||
|
continue;
|
||||||
if (!remove_from_parent_p)
|
if (!remove_from_parent_p)
|
||||||
child->parent = NULL;
|
child->parent = NULL;
|
||||||
delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
|
delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
|
||||||
|
|||||||
Reference in New Issue
Block a user