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

📄 call-ar-st.exp

📁 这个是LINUX下的GDB调度工具的源码
💻 EXP
📖 第 1 页 / 共 3 页
字号:
    send_gdb "print print_double_array(array_d)\n"    gdb_expect_list "print print_double_array(array_d)" ".*$gdb_prompt $" {	"array_d :"	"\[ \t\r\n\]+========="	"\[ \t\r\n\]+\[ \t\r\n\]+0.000000"	"\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]*"	"\[ \t\r\n\]+"    }}#go -until 1236gdb_test "tbreak 1236" \"Breakpoint.* file .*$srcfile, line 1236.*" \"tbreakpoint line 1236"if {![gdb_skip_float_test "continuing to 1236"] && \    ![gdb_skip_stdio_test "continuing to 1236"] } {    send_gdb "continue\n"    gdb_expect_list "continuing to 1236"  ".*$gdb_prompt $" {	"Continuing\\..*array_c"	".*array_f"	"\[ \t\r\n\]+array_d :"	"\[ \t\r\n\]+========="	"\[ \t\r\n\]+0.000000"	"\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]*"	"\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."    }} else {    gdb_test "continue" "" ""}#call sum_array_print(10, *list1, *list2, *list3, *list4)if ![gdb_skip_stdio_test "print sum_array_print(...)"] {    send_gdb "print sum_array_print(10, *list1, *list2, *list3, *list4)\n"    gdb_expect {	-re ".*Sum of 4 arrays, by element \\(add in seed as well\\):\[ \t\r\n\]+Seed: 10\[ \t\r\n\]+Element Index . Sum\[ \t\r\n\]+-------------------------\[ \t\r\n\]+.*\[ \t\]+0\[ \t\]+52\[ \t\r\n\]+1\[ \t\]+60\[ \t\r\n\]+2\[ \t\]+68\[ \t\r\n\]+3\[ \t\]+76\[ \t\r\n\]+4\[ \t\]+84\[ \t\r\n\]+5\[ \t\]+92\[ \t\r\n\]+6\[ \t\]+100\[ \t\r\n\]+7\[ \t\]+108\[ \t\r\n\]+8\[ \t\]+116\[ \t\r\n\]+9\[ \t\]+124\[ \t\r\n\]+.*$gdb_prompt $" {	    pass "print sum_array_print(10, *list1, *list2, *list3, *list4)"	}	-re ".*$gdb_prompt $" { fail "print sum_array_print(10, *list1, *list2, *list3, *list4)" }	timeout           { fail "(timeout) print sum_array_print(10, *list1, *list2, *list3, *list4)" }    }}#step overif ![gdb_skip_stdio_test "next to 1237"] {    send_gdb "next\n"    gdb_expect {	-re ".*BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*$gdb_prompt $" { pass "next to 1237"}	-re ".*$gdb_prompt $" { fail "next to 1237" }	timeout { fail "next to 1237(timeout)" }    }} else {    gdb_test "next" "" ""}#call print_array_rep(\*list1, \*list2, \*list3)if ![gdb_skip_stdio_test "print print_array_rep(...)"] {    send_gdb "print print_array_rep(\*list1, \*list2, \*list3)\n"    gdb_expect {	-re ".*$gdb_prompt $" {	    pass "print print_array_rep(*list1, *list2, *list3)"	}	-re ".*$gdb_prompt $" { 	    fail "print print_array_rep(*list1, *list2, *list3)" 	}	timeout               {	    fail "(timeout) print print_array_rep(*list1, *list2, *list3)" 	}    }}#go -until 1241gdb_test "tbreak 1241" \    "Breakpoint..* file .*$srcfile, line 1241.*" \    "tbreakpoint line 1241"send_gdb  "continue\n"gdb_expect { -re ".*main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" {                   pass "continue to 1241"} -re ".*$gdb_prompt $" { fail "continue to 1241"} timeout           { fail "(timeout) continue to 1241"}}# Run into sum_array_print, and verify that the arguments were passed# accurately.## Note that we shouldn't use a `step' here to get into# sum_array_print; GCC may emit calls to memcpy to put the arguments# in the right place, and a step may end up in memcpy instead.  This# may itself be a bug, but it's not the one we're trying to catch# here.  I've added something to step-test.exp for this.gdb_test "break sum_array_print" \	".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \	"set breakpoint in sum_array_print"gdb_test "continue" \	".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \	"check args of sum_array_print"#call print_array_rep(linked_list1, linked_list2, linked_list3)# this calls works from gdb without gdb_expect. But it does seem to hang#from within gdb_expect.#I comment this out#send_gdb "print print_array_rep(linked_list1, linked_list2, linked_list3)\n"#gdb_expect {#    -re ".*Contents of linked list1:\[ \t\n\r\]+Element Value . Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*4.*1\[ \t\n\r\]+.*6.*2\[ \t\n\r\]+.*8.*3\[ \t\n\r\]+.*10.*4\[ \t\n\r\]+.*12.*5\[ \t\n\r\]+.*14.*6\[ \t\n\r\]+.*16.*7\[ \t\n\r\]+.*18.*8\[ \t\n\r\]+.*20.*9\[ \t\n\r\]+.*22.*10\[ \t\n\r\]+Contents of linked list2:\[ \t\n\r\]+Element Value | Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*8.*1\[ \t\n\r\]+.*10.*2\[ \t\n\r\]+.*12.*3\[ \t\n\r\]+.*14.*4\[ \t\n\r\]+.*16.*5\[ \t\n\r\]+.*18.*6\[ \t\n\r\]+.*20.*7\[ \t\n\r\]+.*22.*8\[ \t\n\r\]+.*24.*9\[ \t\n\r\]+.*26.*10\[ \t\n\r\]+Contents of linked list3:\[ \t\n\r\]+Element Value | Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*10.*1\[ \t\n\r\]+.*12.*2\[ \t\n\r\]+.*14.*3\[ \t\n\r\]+.*16.*4\[ \t\n\r\]+.*18.*5\[ \t\n\r\]+.*20.*6\[ \t\n\r\]+.*22.*7\[ \t\n\r\]+.*24.*8\[ \t\n\r\]+.*26.*9\[ \t\n\r\]+.*28.*10\[ \t\n\r\]+.*$gdb_prompt $" {#        pass "print print_array_rep(linked_list1, linked_list2, linked_list3)"#      }#    -re ".*$gdb_prompt $" { fail "print print_array_rep(linked_list1, linked_list2, linked_list3)" }#    timeout           { fail "(timeout) print print_array_rep(linked_list1, linked_list2, linked_list3)" }#}#go -until 1281gdb_test "tbreak 1281" \    "Breakpoint.* file .*call-ar-st.c, line 1281.*" \    "tbreakpoint line 1281"if ![gdb_skip_stdio_test "continuing to 1281"] {    send_gdb "continue\n"    gdb_expect {	-re  "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1281.*c = 0.*$gdb_prompt $" {	    pass "continue to 1281"	}	-re ".*$gdb_prompt $" { fail "continue to 1281"}           	timeout           { fail "(timeout) continue to 1281"}    }} else {    gdb_test "continue" "" ""}#call print_small_structs(*struct1, *struct2, *struct3, *struct4, #                         *flags, *flags_combo, *three_char, *five_char, #                         *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)if {![gdb_skip_float_test "print print_small_structs(...)"] && \    ![gdb_skip_stdio_test "print print_small_structs(...)"] } {    send_gdb "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"    gdb_expect_list "print print_small_structs" ".*$gdb_prompt $" {	"\[\t\r\n \]+alpha"	"\[\t\r\n \]+gamma"	"\[\t\r\n \]+epsilon"	"\[\t\r\n \]+alpha"	"\[\t\r\n \]+gamma"	"\[\t\r\n \]+epsilon"	"\[\t\r\n \]+ch1: y[ \t]*ch2: n"	"\[\t\r\n \]+Contents of three_char_t:"	"\[\t\r\n \]+a[ \t]*b[ \t]*c"	"\[\t\r\n \]+Contents of five_char_t:"	"\[\t\r\n \]+l[ \t]*m[ \t]*n[ \t]*o[ \t]*p"	"\[\t\r\n \]+Contents of int_char_combo_t:"	"\[\t\r\n \]+123[ \t]*z"	"\[\t\r\n \]+Sum of the 4 struct values and seed :"	"\[\t\r\n \]+52"	"\[\t\r\n \]+Contents of struct1:"	"\[\t\r\n \]+6[ \t]*0"	"\[\t\r\n \]+Contents of struct2:"	"\[\t\r\n \]+10[ \t]*0"	"\[\t\r\n \]+Contents of struct3:"	"\[\t\r\n \]+12[ \t]*0"	"\[\t\r\n \]+Contents of one_double_t:"	"\[\t\r\n \]+10.500000"	"\[\t\r\n \]+Contents of one_double_t:"	"\[\t\r\n \]+-3.375000"	"\[\t\r\n \]+Contents of one_double_t:"	"\[\t\r\n \]+675.093750"	"\[\t\r\n \]+Contents of two_floats_t:"	"\[\t\r\n \]+45.234001[ \t]*43.599998"	"\[\t\r\n \]+Contents of two_floats_t:"	"\[\t\r\n \]+78.010002[ \t]*122.099998"	"\[\t\r\n \]+Contents of two_floats_t:"	"\[\t\r\n \]+-1232.344971[ \t]*-199.210007"    }}#call compute_with_small_structs(20)send_gdb "print compute_with_small_structs(20)\n"gdb_expect {    -re ".*\[0-9\]+ =.*$gdb_prompt $" {        pass "print compute_with_small_structs(20)"      }    -re ".*$gdb_prompt $" { fail "print compute_with_small_structs(20)" }    timeout           { fail "(timeout) compute_with_small_structs(20)" }  }#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, #                       3.14, -5678.12345, -0.11111111, 216.97065)if {![gdb_skip_float_test "print print_ten_doubles(...)"] && \    ![gdb_skip_stdio_test "print print_ten_doubles(...)"]} {    send_gdb "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)\n"    gdb_expect_list "print print_ten_doubles" ".*$gdb_prompt $" {	"\[\t\r\n \]+Two Doubles : 123.45\[0-9\]*.*123.45\[0-9\]*"	"\[\t\r\n \]+Two Doubles : -0.1200\[0-9\]*.*-1.2300\[0-9\]*"	"\[\t\r\n \]+Two Doubles : 343434.\[0-9\]*.*89.09\[0-9\]*"	"\[\t\r\n \]+Two Doubles : 3.1400\[0-9\]*.*-5678.123\[0-9\]*"	"\[\t\r\n \]+Two Doubles : -0.1111\[0-9\]*.*216.97\[0-9\]*"    }}#go -until 1286gdb_test "tbreak 1286" \    "Breakpoint .* file .*call-ar-st.c, line 1286.*" \    "tbreakpoint line 1286"gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286"if { [istarget "hppa*-*-hpux*"] } {    #    # NOTE:(FIXME)    # the aCC demangler cannot demangle the name of a function with >10 args.    # so I added a .* after the name of the function, to match the    # incredibly long mangled name     # (getting aCC's libdemangle.a bundled w/ the system?)    # DTS CLLbs16994  coulter 990114    #     # FIXME: use step for hppa* testing for now    # guo 990621    #    send_gdb "step\n"    gdb_expect {        -re ".*print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}        -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }        timeout { fail "step into print_long_arg_list (timeout)" }    }} else {    # We can't just assume that a "step" will get us into    # print_long_arg_list here,either.    gdb_test "tbreak print_long_arg_list" \	"Breakpoint .* file .*call-ar-st.c, line .*" \

⌨️ 快捷键说明

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