diff options
author | Daniel Jacobowitz <dan@debian.org> | 2001-11-11 20:11:03 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2001-11-11 20:11:03 +0000 |
commit | 2c614d5a1d8521d1e720993e3065202cdcb3a209 (patch) | |
tree | 3748d43894871ff52bd9b355855d302908a77e40 /gdb/testsuite/gdb.mi/mi-simplerun.exp | |
parent | 47ef4b2f05e88f2f2c798e024d18232d77789157 (diff) | |
download | gdb-2c614d5a1d8521d1e720993e3065202cdcb3a209.tar.gz |
* lib/mi-support.exp: (mi_run_to_helper, mi_run_to,
mi_step_to, mi_next_to, mi_continue_to, mi_finish_to,
mi0_step_to, mi0_next_to, mi0_continue_to, mi0_finish_to,
mi0_run_to): New functions.
* gdb.mi/mi-simplerun.exp: Use them.
* gdb.mi/mi0-simplerun.exp: Likewise.
* gdb.mi/mi-var-cmd.exp: Likewise.
* gdb.mi/mi0-var-cmd.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-simplerun.exp')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-simplerun.exp | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp index 562f1f752b3..a6f82fcca81 100644 --- a/gdb/testsuite/gdb.mi/mi-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp @@ -129,55 +129,24 @@ proc test_controlled_execution {} { # -exec-step # -exec-finish - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - send_gdb "220-exec-next\n" - gdb_expect { - -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"33\"\}\r\n$mi_gdb_prompt$" { - pass "next at main" - } - timeout { - fail "next at main (timeout)" - } - } + mi_next_to "main" "" "basics.c" "33" "next at main" # FIXME: A string argument is not printed right; should be fixed and # we should look for the right thing here. # NOTE: The ``\\\\\"'' is for \". - send_gdb "221-exec-step\n" - gdb_expect { - -re "221\\^running\r\n${mi_gdb_prompt}221\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee1\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\],file=\".*basics.c\",line=\"27\"\}\r\n$mi_gdb_prompt$" { - pass "step at main" - } - timeout { - fail "step at main (timeout)" - } - } + mi_step_to "callee1" \ + "\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}" \ + "basics.c" "27" "step at main" # FIXME: A string argument is not printed right; should be fixed and # we should look for the right thing here. - send_gdb "222-exec-step 3\n" - gdb_expect 30 { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { - pass "step to callee4" - } - timeout { - fail "step to callee4 (timeout)" - } - } + mi_run_to "exec-step 3" "end-stepping-range" "callee4" "" \ + "basics.c" "8" "" "step to callee4" # FIXME: A string argument is not printed right; should be fixed and # we should look for the right thing here. # NOTE: The ``.'' is part of ``gdb-result-var="$1"'' - send_gdb "223-exec-finish\n" - gdb_expect 30 { - -re "223\\^running\r\n${mi_gdb_prompt}223\\*stopped,reason=\"function-finished\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\},gdb-result-var=\".1\",return-value=\"0\"\r\n$mi_gdb_prompt$" { - pass "exec-finish" - } - timeout { - fail "exec-finish (timeout)" - } - } + mi_finish_to "callee3" ".*" "basics.c" "18" ".1" "0" "exec-finish" } proc test_controlling_breakpoints {} { |