diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2007-11-07 20:06:29 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2007-11-07 20:06:29 +0000 |
commit | 214270abf389bb2aa4584423353a7da2a1e6b463 (patch) | |
tree | 8e980f439b9001a60df7f261c792c5268fdfca9b /gdb/testsuite/gdb.mi/mi-var-child.c | |
parent | 91ea499d4ae67d29f4ef3aefc3335224a2837254 (diff) | |
download | gdb-214270abf389bb2aa4584423353a7da2a1e6b463.zip gdb-214270abf389bb2aa4584423353a7da2a1e6b463.tar.gz gdb-214270abf389bb2aa4584423353a7da2a1e6b463.tar.bz2 |
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.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-child.c')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-child.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.c b/gdb/testsuite/gdb.mi/mi-var-child.c index 393efd2..406f0e2 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child.c +++ b/gdb/testsuite/gdb.mi/mi-var-child.c @@ -306,6 +306,29 @@ do_special_tests (void) 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 []) { @@ -313,6 +336,7 @@ main (int argc, char *argv []) do_block_tests (); do_children_tests (); do_special_tests (); + do_child_deletion (); exit (0); } |