⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mi-var-display.exp

📁 lwip在ucos上的移植
💻 EXP
📖 第 1 页 / 共 2 页
字号:
#   Copyright (C) 1999 2000 Cygnus Solutions## This Program Is Free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.# Please email any bugs, comments, and/or additions to this file to:# bug-gdb@prep.ai.mit.edu# Test essential Machine interface (MI) operations## Verify that, using the MI, we can create, update, delete variables.#load_lib mi-support.expgdb_exitif [mi_gdb_start] {    continue}set testfile "var-cmd"set srcfile ${testfile}.cset binfile ${objdir}/${subdir}/${testfile}if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."}mi_delete_breakpointsmi_gdb_reinitialize_dir $srcdir/$subdirmi_gdb_load ${binfile}mi_gdb_test "200-break-insert 260" \	"200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \	"break-insert operation"mi_run_cmd# The running part has been checked already by mi_run_cmdgdb_expect {    -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {	pass "run to do_children_tests"    }    -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}    timeout {fail "run to do_children_tests (timeout 2)"}}#####       ######               ## Display tests ##               ######       ###### Test: c_variable-6.1# Desc: create variable barmi_gdb_test "-var-create bar * bar" \	"\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \	"create local variable bar"# Test: c_variable-6.2# Desc: type of variable barmi_gdb_test "-var-info-type bar" \	"\\^done,type=\"int\"" \	"info type variable bar"# Test: c_variable-6.3# Desc: format of variable barmi_gdb_test "-var-show-format bar" \	"\\^done,format=\"natural\"" \	"show format variable bar"# Test: c_variable-6.4# Desc: value of variable barmi_gdb_test "-var-evaluate-expression bar" \	"\\^done,value=\"2121\"" \	"eval variable bar"# Test: c_variable-6.5# Desc: change format of bar to hexmi_gdb_test "-var-set-format bar hexadecimal" \	"\\^done,format=\"hexadecimal\"" \	"set format variable bar"# Test: c_variable-6.6# Desc: value of bar with new formatmi_gdb_test "-var-evaluate-expression bar" \	"\\^done,value=\"0x849\"" \	"eval variable bar with new format"# Test: c_variable-6.7# Desc: change value of barmi_gdb_test "-var-assign bar 3" \	"\\^done,value=\"0x3\"" \	"assing to variable bar"mi_gdb_test "-var-set-format bar decimal" \	"\\^done,format=\"decimal\"" \	"set format variable bar"mi_gdb_test "-var-evaluate-expression bar" \	"\\^done,value=\"3\"" \	"eval variable bar with new value"mi_gdb_test "-var-delete bar" \	"\\^done,ndeleted=\"1\"" \	"delete var bar"# Test: c_variable-6.11# Desc: create variable foomi_gdb_test "-var-create foo * foo" \	"\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \	"create local variable foo"# Test: c_variable-6.12# Desc: type of variable foomi_gdb_test "-var-info-type foo" \	"\\^done,type=\"int \\*\"" \	"info type variable foo"# Test: c_variable-6.13# Desc: format of variable foomi_gdb_test "-var-show-format foo" \	"\\^done,format=\"natural\"" \	"show format variable foo"# Test: c_variable-6.14# Desc: value of variable foomi_gdb_test "-var-evaluate-expression foo" \	"\\^done,value=\"$hex\"" \	"eval variable foo"# Test: c_variable-6.15# Desc: change format of var to octalmi_gdb_test "-var-set-format foo octal" \	"\\^done,format=\"octal\"" \	"set format variable foo"mi_gdb_test "-var-show-format foo" \	"\\^done,format=\"octal\"" \	"show format variable foo"# Test: c_variable-6.16# Desc: value of foo with new formatmi_gdb_test "-var-evaluate-expression foo" \	"\\^done,value=\"\[0-7\]+\"" \	"eval variable foo"# Test: c_variable-6.17# Desc: change value of foomi_gdb_test "-var-assign foo 3" \	"\\^done,value=\"03\"" \	"assing to variable foo"mi_gdb_test "-var-set-format foo decimal" \	"\\^done,format=\"decimal\"" \	"set format variable foo"# Test: c_variable-6.18# Desc: check new value of foomi_gdb_test "-var-evaluate-expression foo" \	"\\^done,value=\"3\"" \	"eval variable foo"mi_gdb_test "-var-delete foo" \	"\\^done,ndeleted=\"1\"" \	"delete var foo"# Test: c_variable-6.21# Desc: create variable weird and childrenmi_gdb_test "-var-create weird * weird" \	"\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \	"create local variable weird"mi_gdb_test "-var-list-children weird" \	"\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \	"get children local variable weird"# Test: c_variable-6.23# Desc: change format of weird.func_ptr and weird.func_ptr_ptrmi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \	"\\^done,format=\"hexadecimal\"" \	"set format variable weird.func_ptr"mi_gdb_test "-var-show-format weird.func_ptr" \	"\\^done,format=\"hexadecimal\"" \	"show format variable weird.func_ptr"mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \	"\\^done,format=\"hexadecimal\"" \	"set format variable weird.func_ptr_ptr"mi_gdb_test "-var-show-format weird.func_ptr_ptr" \	"\\^done,format=\"hexadecimal\"" \	"show format variable weird.func_ptr_ptr"# Test: c_variable-6.24# Desc: format of weird and childrenmi_gdb_test "-var-set-format weird natural" \	"\\^done,format=\"natural\"" \	"set format variable weird"mi_gdb_test "-var-set-format weird.integer natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.integer"mi_gdb_test "-var-set-format weird.character natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.character"mi_gdb_test "-var-set-format weird.char_ptr natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.char_ptr"mi_gdb_test "-var-set-format weird.long_int natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.long_int"mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.int_ptr_ptr"mi_gdb_test "-var-set-format weird.long_array natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.long_array"mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \	"\\^done,format=\"hexadecimal\"" \	"set format variable weird.func_ptr"mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \	"\\^done,format=\"hexadecimal\"" \	"set format variable weird.func_ptr_struct"mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.func_ptr_ptr"mi_gdb_test "-var-set-format weird.u1 natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.u1"mi_gdb_test "-var-set-format weird.s2 natural" \	"\\^done,format=\"natural\"" \	"set format variable weird.s2"# Test: c_variable-6.25# Desc: value of weird and children#gdbtk_test c_variable-6.25 {value of weird and children} {#  set values {}#  foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {#    lappend values [value $v $f]#  }#  set values#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}# Test: c_variable-6.26# Desc: change format of weird and children to octal#gdbtk_test c_variable-6.26 {change format of weird and children to octal} {#  set formats {}#  foreach v [lsort [array names var]] {#    $var($v) format octal#    lappend formats [$var($v) format]#  }#  set formats#} {octal octal octal octal octal octal octal octal octal octal octal octal}# Test: c_variable-6.27# Desc: value of weird and children with new format#gdbtk_test c_variable-6.27 {value of foo with new format} {#  set values {}#  foreach v [lsort [array names var]] {#    lappend values [value $v o]#  }#  set values#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}# Test: c_variable-6.30# Desc: create more children of weird#gdbtk_test c_variable-6.30 {create more children of weird} {#  foreach v [array names var] {#    get_children $v#  }#  # Do it twice to get more children#  foreach v [array names var] {#    get_children $v#  }#  lsort [array names var]#} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}# Test: c_variable-6.31# Desc: check that all children of weird change#       Ok, obviously things like weird.s2 and weird.u1 will not change!#gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {#  $var(weird) value 0x2121#  check_update#} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}mi_gdb_test "-var-delete weird" \	"\\^done,ndeleted=\"12\"" \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -