📄 mi2-var-child.exp
字号:
"\\^done,numchild=\"1\"" \ "get number of children of weird.int_ptr_ptr"# Test: c_variable-4.88# Desc: children of *weird->int_ptr_ptrmi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \ "get children of weird.int_ptr_ptr.*int_ptr_ptr"#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {# get_children weird.int_ptr_ptr.*int_ptr_ptr#} {**int_ptr_ptr}# Test: c_variable-4.89# Desc: number of children *weird->int_ptr_ptrmi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \ "\\^done,numchild=\"1\"" \ "get number of children of weird.int_ptr_ptr.*int_ptr_ptr"# Test: c_variable-4.90# Desc: create weird->int_ptr_ptrmi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \ "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \ "create local variable weird->int_ptr_ptr"# Test: c_variable-4.91# Desc: children of weird->int_ptr_ptrmi_gdb_test "-var-list-children weird->int_ptr_ptr" \ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \ "get children of weird->int_ptr_ptr"# Test: c_variable-4.92# Desc: number of children of (weird->int_ptr_ptr)mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \ "\\^done,numchild=\"1\"" \ "get number of children of weird->int_ptr_ptr"# Test: c_variable-4.93# Desc: children of *(weird->int_ptr_ptr)mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"# Test: c_variable-4.94# Desc: number of children of *(weird->int_ptr_ptr)mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \ "\\^done,numchild=\"1\"" \ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr"# Test: c_variable-4.95# Desc: children of *(*(weird->int_ptr_ptr))mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \ "\\^done,numchild=\"0\"" \ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"# Test: c_variable-4.96# Desc: number of children of *(*(weird->int_ptr_ptr))mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \ "\\^done,numchild=\"0\"" \ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"# Test: c_variable-4.97# Desc: is weird editablemi_gdb_test "-var-show-attributes weird" \ "\\^done,attr=\"editable\"" \ "is weird editable"# Test: c_variable-4.98# Desc: is weird->int_ptr_ptr editablemi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \ "\\^done,attr=\"editable\"" \ "is weird->int_ptr_ptr editable"# Test: c_variable-4.99# Desc: is *(weird->int_ptr_ptr) editablemi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \ "\\^done,attr=\"editable\"" \ "is weird.int_ptr_ptr.*int_ptr_ptr editable"# Test: c_variable-4.100# Desc: is *(*(weird->int_ptr_ptr)) editablemi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \ "\\^done,attr=\"editable\"" \ "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable"# Test: c_variable-4.101# Desc: is weird->u1 editablemi_gdb_test "-var-show-attributes weird.u1" \ "\\^done,attr=\"noneditable\"" \ "is weird.u1 editable"# Test: c_variable-4.102# Desc: is weird->s2 editablemi_gdb_test "-var-show-attributes weird.s2" \ "\\^done,attr=\"noneditable\"" \ "is weird.s2 editable"# Test: c_variable-4.103# Desc: is struct_declarations.u1.a editablemi_gdb_test "-var-show-attributes struct_declarations.u1.a" \ "\\^done,attr=\"editable\"" \ "is struct_declarations.u1.a editable"# Test: c_variable-4.104# Desc: is struct_declarations.u1.b editablemi_gdb_test "-var-show-attributes struct_declarations.u1.b" \ "\\^done,attr=\"editable\"" \ "is struct_declarations.u1.b editable"# Test: c_variable-4.105# Desc: is struct_declarations.u1.c editablemi_gdb_test "-var-show-attributes struct_declarations.u1.c" \ "\\^done,attr=\"editable\"" \ "is struct_declarations.u1.c editable"# Test: c_variable-4.106# Desc: is struct_declarations.long_array editablemi_gdb_test "-var-show-attributes struct_declarations.long_array" \ "\\^done,attr=\"noneditable\"" \ "is struct_declarations.long_array editable"# Test: c_variable-4.107# Desc: is struct_declarations.long_array[0] editablemi_gdb_test "-var-show-attributes struct_declarations.long_array.0" \ "\\^done,attr=\"editable\"" \ "is struct_declarations.long_array.0 editable"# Test: c_variable-4.108# Desc: is struct_declarations editablemi_gdb_test "-var-show-attributes struct_declarations" \ "\\^done,attr=\"noneditable\"" \ "is struct_declarations editable"mi_gdb_test "-var-delete weird" \ "\\^done,ndeleted=\"24\"" \ "delete var weird"##### ###### ## children and update tests ## ###### ###### Test: c_variable-5.1# Desc: check that nothing changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\\\]" \ "update all vars. None changed"# Step over "struct_declarations.integer = 123;"mi_step_to do_children_tests {} {.*var-cmd.c} \ [expr $line_dct_123 + 1] "step \$line_dct_123 + 1"# Test: c_variable-5.2# Desc: check that integer changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars struct_declarations.integer"# Step over:# weird->char_ptr = "hello";# bar = 2121;# foo = &bar;mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \ [expr $line_dct_123 + 4] {} "step \$line_dct_123 + 4"# Test: c_variable-5.3# Desc: check that char_ptr changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars struct_declarations.char_ptr"# Step over "struct_declarations.int_ptr_ptr = &foo;"mi_step_to do_children_tests {} {.*var-cmd.c} \ [expr $line_dct_123 + 5] "step \$line_dct_123 + 5"# Test: c_variable-5.4# Desc: check that int_ptr_ptr and children changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars int_ptr_ptr and children changed"# Step over "weird->long_array[0] = 1234;"mi_step_to do_children_tests {} {.*var-cmd.c} \ [expr $line_dct_123 + 6] "step \$line_dct_123 + 6"# Test: c_variable-5.5# Desc: check that long_array[0] changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars struct_declarations.long_array.0 changed"# Step over "struct_declarations.long_array[1] = 2345;"mi_step_to do_children_tests {} {.*var-cmd.c} \ [expr $line_dct_123 + 7] "step \$line_dct_123 + 7"# Test: c_variable-5.6# Desc: check that long_array[1] changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars struct_declarations.long_array.1 changed"# Step over "weird->long_array[2] = 3456;"mi_step_to do_children_tests {} {.*var-cmd.c} \ [expr $line_dct_123 + 8] "step \$line_dct_123 + 8"# Test: c_variable-5.7# Desc: check that long_array[2] changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars struct_declarations.long_array.2 changed"# Step over:# struct_declarations.long_array[3] = 4567;# weird->long_array[4] = 5678;# struct_declarations.long_array[5] = 6789;# weird->long_array[6] = 7890;# struct_declarations.long_array[7] = 8901;# weird->long_array[8] = 9012;# struct_declarations.long_array[9] = 1234;set line_dct_nothing [gdb_get_line_number "weird->func_ptr = nothing;"]mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \ $line_dct_nothing {} "step \$line_dct_nothing"# Test: c_variable-5.8# Desc: check that long_array[3-9] changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars struct_declarations.long_array.3-9 changed"# Step over "weird->func_ptr = nothing;"set line_dct_a0_0 [gdb_get_line_number "a0 = '0';"]mi_step_to do_children_tests {} {.*var-cmd.c} \ $line_dct_a0_0 "step \$line_dct_a0_0"# Test: c_variable-5.9# Desc: check that func_ptr changedmi_gdb_test "-var-update *" \ "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ "update all vars struct_declarations.func_ptr changed"# Delete all variablesmi_gdb_test "-var-delete struct_declarations" \ "\\^done,ndeleted=\"65\"" \ "delete var struct_declarations"mi_gdb_test "-var-delete weird->int_ptr_ptr" \ "\\^done,ndeleted=\"3\"" \ "delete var weird->int_ptr_ptr"# Step over all lines:# ...# psnp = &snp0;set line_dct_snp0 [gdb_get_line_number "psnp = &snp0;"]mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \ [expr $line_dct_snp0 + 1] {} "step \$line_dct_snp0 + 1"# Test: c_variable-5.10# Desc: create psnp->char_ptrmi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \ "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \ "create local variable psnp->char_ptr"# Test: c_variable-5.11# Desc: children of psnp->char_ptrmi_gdb_test "-var-list-children psnp->char_ptr" \ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \ "get children of psnp->char_ptr"# Test: c_variable-5.12# Desc: number of children of psnp->char_ptrmi_gdb_test "-var-info-num-children psnp->char_ptr" \ "\\^done,numchild=\"1\"" \ "get number of children of psnp->char_ptr"# Test: c_variable-5.13# Desc: children of *(psnp->char_ptr)mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \ "get children of psnp->char_ptr.*psnp->char_ptr"# Test: c_variable-5.14# Desc: number of children of *(psnp->char_ptr)mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \ "\\^done,numchild=\"1\"" \ "get number of children of psnp->char_ptr.*psnp->char_ptr"# Test: c_variable-5.15# Desc: children of *(*(psnp->char_ptr))mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"# Test: c_variable-5.15B# Desc: children of *(*(*(psnp->char_ptr)))mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -