diff options
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi0-var-cmd.exp')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi0-var-cmd.exp | 122 |
1 files changed, 20 insertions, 102 deletions
diff --git a/gdb/testsuite/gdb.mi/mi0-var-cmd.exp b/gdb/testsuite/gdb.mi/mi0-var-cmd.exp index c3ed0b2..05db481 100644 --- a/gdb/testsuite/gdb.mi/mi0-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi0-var-cmd.exp @@ -180,15 +180,7 @@ mi_gdb_test "-var-update *" \ "update all vars" # Step over "linteger = 1234;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"107\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} +mi0_step_to "do_locals_tests" "" "var-cmd.c" "107" "step at do_locals_test" # Test: c_variable-2.2 # Desc: check whether only linteger changed values @@ -197,15 +189,7 @@ mi_gdb_test "-var-update *" \ "update all vars: linteger changed" # Step over "lpinteger = &linteger;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"108\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} +mi0_step_to "do_locals_tests" "" "var-cmd.c" 108 "step at do_locals_tests (2)" # Test: c_variable-2.3 # Desc: check whether only lpinteger changed @@ -214,15 +198,7 @@ mi_gdb_test "-var-update *" \ "update all vars: lpinteger changed" # Step over "lcharacter = 'a';" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"109\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} +mi0_step_to "do_locals_tests" "" "var-cmd.c" "109" "step at do_locals_tests (3)" # Test: c_variable-2.4 # Desc: check whether only lcharacter changed @@ -231,15 +207,7 @@ mi_gdb_test "-var-update *" \ "update all vars: lcharacter changed" # Step over "lpcharacter = &lcharacter;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"110\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} +mi0_step_to "do_locals_tests" "" "var-cmd.c" "110" "step at do_locals_tests (4)" # Test: c_variable-2.5 # Desc: check whether only lpcharacter changed @@ -259,15 +227,8 @@ mi_gdb_test "-var-update *" \ # lsimple.unsigned_integer = 255; # lsimple.character = 'a'; -send_gdb "-exec-step 9\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"119\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} +mi0_run_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \ + "var-cmd.c" "119" "" "step at do_locals_tests (5)" # Test: c_variable-2.6 # Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer, @@ -282,15 +243,8 @@ mi_gdb_test "-var-update *" \ # lpsimple = &lsimple; # func = nothing; -send_gdb "-exec-step 4\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"125\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} +mi0_run_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \ + "var-cmd.c" "125" "" "step at do_locals_tests (6)" # Test: c_variable-2.7 # Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed @@ -308,15 +262,8 @@ mi_gdb_test "-var-update *" \ # lsimple.unsigned_integer = 4321; # lsimple.character = 'b'; -send_gdb "-exec-step 8\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"133\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} +mi0_run_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \ + "var-cmd.c" "133" "" "step at do_locals_tests (7)" # Test: c_variable-2.8 # Desc: check whether linteger, lcharacter, llong, lfoat, ldouble, lsimple.integer, @@ -432,15 +379,9 @@ mi_gdb_test "-var-assign lsimple.integer 333" \ mi_gdb_test "-break-insert subroutine1" \ "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \ "break-insert subroutine1" -send_gdb "-exec-continue\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}\},file=\".*var-cmd.c\",line=\"146\"\}\r\n$mi_gdb_prompt$" { - pass "continue to subroutine1" - } - timeout { - fail "continue to subroutine1 (timeout)" - } -} +mi0_continue_to "2" "subroutine1" \ + "\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}" \ + "var-cmd.c" "146" "continue to subroutine1" # Test: c_variable-2.10 # Desc: create variable for locals i,l in subroutine1 @@ -458,15 +399,8 @@ mi_gdb_test "-var-create linteger * linteger" \ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ "create linteger" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"147\"\}\r\n$mi_gdb_prompt$" { - pass "step at subroutine1" - } - timeout { - fail "step at subroutine1 (timeout)" - } -} +mi0_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ + "var-cmd.c" "147" "step at subroutine1" # Test: c_variable-2.12 # Desc: change global_simple.integer @@ -481,13 +415,8 @@ mi_gdb_test "-var-update *" \ "update all vars: changed FIXME" clear_xfail *-*-* -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"148\"\}\r\n$mi_gdb_prompt$" { - pass "step at subroutine1" - } - timeout { fail "step at subroutine1 (timeout)" } -} +mi0_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ + "var-cmd.c" "148" "step at subroutine1 (2)" # Test: c_variable-2.13 # Desc: change subroutine1 local i @@ -495,13 +424,8 @@ mi_gdb_test "-var-update *" \ "\\^done,changelist=\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: i changed" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"149\"\}\r\n$mi_gdb_prompt$" { - pass "step at subroutine1" - } - timeout { fail "step at subroutine1 (timeout)" } -} +mi0_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ + "var-cmd.c" "149" "step at subroutine1 (3)" # Test: c_variable-2.14 # Desc: change do_locals_tests local llong @@ -509,13 +433,7 @@ mi_gdb_test "-var-update *" \ "\\^done,changelist=\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars: llong changed" -send_gdb "-exec-next\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"136\"\}\r\n$mi_gdb_prompt$" { - pass "next out of subroutine1" - } - timeout { fail "next out of subroutine1 (timeout)" } -} +mi0_next_to "do_locals_tests" "" "var-cmd.c" "136" "next out of subroutine1" # Test: c_variable-2.15 # Desc: check for out of scope subroutine1 locals |