diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2009-03-13 10:55:08 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2009-03-13 10:55:08 +0000 |
commit | f7c60c5e2b07932c2b73b687083b254cbe0dd5de (patch) | |
tree | 9685a62a7f65ba3f7a91734ec47197646690f959 | |
parent | 9a2ee7fcfd38cfbd679fe7e5b4b837f3ae7d9b20 (diff) | |
download | gdb-f7c60c5e2b07932c2b73b687083b254cbe0dd5de.zip gdb-f7c60c5e2b07932c2b73b687083b254cbe0dd5de.tar.gz gdb-f7c60c5e2b07932c2b73b687083b254cbe0dd5de.tar.bz2 |
* gdb.mi/mi-cli.exp: Adjust for output difference in
sync and async modes.
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-cli.exp | 25 |
2 files changed, 26 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5d2be4d..d45e3b4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-03-13 Vladimir Prus <vladimir@codesourcery.com> + + * gdb.mi/mi-cli.exp: Adjust for output difference in + sync and async modes. + 2009-03-12 Joel Brobecker <brobecker@adacore.com> * gdb.ada/ptype_arith_binop.exp: Remove some commented-out code diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp index 2fbb376..42747ca 100644 --- a/gdb/testsuite/gdb.mi/mi-cli.exp +++ b/gdb/testsuite/gdb.mi/mi-cli.exp @@ -140,7 +140,22 @@ mi_gdb_test "500-stack-select-frame 0" \ {500\^done} \ "-stack-select-frame 0" -mi_execute_to "interpreter-exec console step" "" "callee4" "" ".*basics.c" "29" \ +# When a CLI command is entered in MI session, the respose is different in +# sync and async modes. In sync mode normal_stop is called when current +# interpreter is CLI. So: +# - print_stop_reason prints stop reason in CLI uiout, and we don't show it +# in MI +# - The stop position is printed, and appears in MI 'console' channel. +# +# In async mode the stop event is processed when we're back to MI interpreter, +# so the stop reason is printed into MI uiout an. +if {$async} { + set reason "end-stepping-range" +} else { + set reason "" +} + +mi_execute_to "interpreter-exec console step" $reason "callee4" "" ".*basics.c" "29" \ "" "check *stopped from CLI command" # NOTE: cagney/2003-02-03: Not yet. @@ -161,8 +176,10 @@ mi_gdb_test "34 next" \ ".*34\\\^running.*\\*running,thread-id=\"all\"" \ "34 next: run" -gdb_expect { - -re "~\[^\r\n\]+\r\n" { +if {!$async} { + gdb_expect { + -re "~\[^\r\n\]+\r\n" { + } } } @@ -170,7 +187,7 @@ gdb_expect { # The purpose of *stopped notification for CLI command is to make # sure that frontend knows that inferior is stopped, and knows where. # Supplementary information is not necessary. -mi_expect_stop "" "main" "" ".*basics.c" $line_main_return "" \ +mi_expect_stop "$reason" "main" "" ".*basics.c" $line_main_return "" \ "34 next: stop" mi_gdb_test "-interpreter-exec console \"list\"" \ |