* config/tc-alpha.c (O_samegp): New.
[external/binutils.git] / gdb / testsuite / gdb.mi / mi0-var-cmd.exp
index ed48e5e..05db481 100644 (file)
@@ -77,7 +77,7 @@ mi_gdb_test "200-break-insert do_locals_tests" \
 mi_run_cmd
 # The running part has been checked already by mi_run_cmd
 gdb_expect {
-    -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" {
+    -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" {
        pass "run to do_locals_tests"
     }
     -re ".*$mi_gdb_prompt$" {fail "run todo_locals_tests (2)"}
@@ -100,7 +100,7 @@ mi_gdb_test "-var-create lcharacter * lcharacter" \
        "create local variablelcharacter "
 
 mi_gdb_test "-var-create lpcharacter * lpcharacter" \
-       "\\^done,name=\"lpcharacter\",numchild=\"0\",type=\"char \\*\"" \
+       "\\^done,name=\"lpcharacter\",numchild=\"1\",type=\"char \\*\"" \
        "create local variable lpcharacter"
 
 mi_gdb_test "-var-create llong * llong" \
@@ -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=\"0\",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=\"0\",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=\"0\",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=\"0\",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=\"0\",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=\"0\",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=\"0\",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,
@@ -391,14 +338,14 @@ mi_gdb_test "-var-assign lplong &llong" \
        "\\^done,value=\"$hex\"" \
        "assign to lplong"
 
-mi_gdb_test "-var-assign lfloat 3.4" \
-       "\\^done,value=\"3.4.*\"" \
+mi_gdb_test "-var-assign lfloat 3.4567" \
+       "\\^done,value=\"3.45.*\"" \
        "assign to lfloat"
 mi_gdb_test "-var-evaluate-expression lfloat" \
-       "\\^done,value=\"3.4.*\"" \
+       "\\^done,value=\"3.45.*\"" \
        "eval lfloat"
-mi_gdb_test "-var-assign lfloat 1.2" \
-       "\\^done,value=\"1.2.*\"" \
+mi_gdb_test "-var-assign lfloat 1.2345" \
+       "\\^done,value=\"1.23.*\"" \
        "assign to lfloat"
 
 mi_gdb_test "-var-assign lpfloat &lfloat+4" \
@@ -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=\"0\",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=\"0\",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=\"0\",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=\"0\",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=\"0\",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
@@ -603,8 +521,3 @@ mi_gdb_test "-var-delete l" \
 
 mi_gdb_exit
 return 0
-
-# Local variables: 
-# change-log-default-name: "ChangeLog-mi"
-# End:
-