diff options
author | Yao Qi <yao@codesourcery.com> | 2014-08-23 20:24:07 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2014-10-14 19:42:45 +0800 |
commit | 46a93de2ab256dd2cb4e1845a93d9d1ae07b2475 (patch) | |
tree | c8684f6818d1ba711e255d61e8d518c4a824d438 /gdb/testsuite/gdb.mi/mi-var-child.exp | |
parent | c50415e24c5ae8635d550f0c3699ffd88ff14a9b (diff) | |
download | gdb-46a93de2ab256dd2cb4e1845a93d9d1ae07b2475.zip gdb-46a93de2ab256dd2cb4e1845a93d9d1ae07b2475.tar.gz gdb-46a93de2ab256dd2cb4e1845a93d9d1ae07b2475.tar.bz2 |
Use mi_varobj_update in mi-var-child.exp and mi2-var-child.exp
Hi,
I modify mi-var-child.exp and find that the pattern to match the output
of -var-update * is quite complicated. However, it can be simplified by
using mi_varobj_update. That is what this patch does.
gdb/testsuite:
2014-10-14 Yao Qi <yao@codesourcery.com>
* gdb.mi/mi-var-child.exp: Use mi_varobj_update to simplify
tests.
* gdb.mi/mi2-var-child.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-child.exp')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-child.exp | 70 |
1 files changed, 39 insertions, 31 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp index 4e9a76c..1f547ba 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child.exp @@ -668,9 +668,7 @@ mi_gdb_test "-var-delete weird" \ # Test: c_variable-5.1 # Desc: check that nothing changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\\\]" \ - "update all vars. None changed" +mi_varobj_update * {} "update all vars. None changed" # Step over "struct_declarations.integer = 123;" mi_step_to do_children_tests {} ".*${srcfile}" \ @@ -678,8 +676,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.2 # Desc: check that integer changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {struct_declarations.integer} \ "update all vars struct_declarations.integer" # Step over: @@ -691,8 +688,7 @@ mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} ".*${srcfi # Test: c_variable-5.3 # Desc: check that char_ptr changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {struct_declarations.char_ptr struct_declarations.char_ptr.\\*char_ptr} \ "update all vars struct_declarations.char_ptr" # Step over "struct_declarations.int_ptr_ptr = &foo;" @@ -701,8 +697,12 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.4 # Desc: check that int_ptr_ptr and children changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {weird->int_ptr_ptr + weird->int_ptr_ptr.\\*weird->int_ptr_ptr + weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr + struct_declarations.int_ptr_ptr + struct_declarations.int_ptr_ptr.\\*int_ptr_ptr + struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr} \ "update all vars int_ptr_ptr and children changed" # Step over "weird->long_array[0] = 1234;" @@ -711,8 +711,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.5 # Desc: check that long_array[0] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {struct_declarations.long_array.0} \ "update all vars struct_declarations.long_array.0 changed" # Step over "struct_declarations.long_array[1] = 2345;" @@ -721,8 +720,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.6 # Desc: check that long_array[1] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {struct_declarations.long_array.1} \ "update all vars struct_declarations.long_array.1 changed" # Step over "weird->long_array[2] = 3456;" @@ -731,8 +729,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.7 # Desc: check that long_array[2] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {struct_declarations.long_array.2} \ "update all vars struct_declarations.long_array.2 changed" # Step over: @@ -750,9 +747,14 @@ mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} ".*${srcfi # Test: c_variable-5.8 # Desc: check that long_array[3-9] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.3-9 changed" +mi_varobj_update * {struct_declarations.long_array.3 + struct_declarations.long_array.4 + struct_declarations.long_array.5 + struct_declarations.long_array.6 + struct_declarations.long_array.7 + struct_declarations.long_array.8 + struct_declarations.long_array.9} \ + "update all vars struct_declarations.long_array.3-9 changed" # Step over "weird->func_ptr = nothing"; @@ -761,9 +763,8 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.9 # Desc: check that func_ptr changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.func_ptr changed" +mi_varobj_update * {struct_declarations.func_ptr} \ + "update all vars struct_declarations.func_ptr changed" # Step over "struct_declarations.long_array[10] = 3456"; mi_step_to do_children_tests {} ".*${srcfile}" \ @@ -1119,8 +1120,11 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.47 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {psnp->ptrs.0.char_ptr + psnp->char_ptr + psnp->char_ptr.\\*psnp->char_ptr psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr + psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr + psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr } \ "update all vars psnp->char_ptr (and 0.char_ptr) changed" # Step over "snp1.char_ptr = &c3;" @@ -1129,8 +1133,11 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.48 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {psnp->ptrs.0.next.char_ptr + psnp->ptrs.0.next.char_ptr.\\*char_ptr + psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr + psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr + psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr} \ "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" @@ -1140,8 +1147,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.49 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {psnp->ptrs.0.next.next.char_ptr} \ "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed" @@ -1151,8 +1157,11 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.50 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {psnp->ptrs.0.long_ptr psnp->long_ptr + psnp->long_ptr.\\*psnp->long_ptr + psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr + psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr + psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr} \ "update all vars psnp->long_ptr (and 0.long_ptr) changed" @@ -1179,8 +1188,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ # Test: c_variable-5.52 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ +mi_varobj_update * {psnp->ptrs.0.next.next.long_ptr} \ "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" mi_prepare_inline_tests $srcfile |