aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-06-10 10:23:54 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-06-10 10:23:54 +0000
commite1ac3328737bc34a23dbfff92b416a9d9306329a (patch)
treea6ffb502159f70dbab8c069def57709877ec7b9d /gdb/testsuite
parentf7f9a841a31878b377a60bfc7c793e6c8400fafe (diff)
downloadgdb-e1ac3328737bc34a23dbfff92b416a9d9306329a.zip
gdb-e1ac3328737bc34a23dbfff92b416a9d9306329a.tar.gz
gdb-e1ac3328737bc34a23dbfff92b416a9d9306329a.tar.bz2
Implement *running.
* Makefile.in: Update dependencies. * gdbthread.h (struct thread_info): New field running_. (set_running, is_running): New. * thread.c (set_running, is_running): New. * inferior.h (suppress_normal_stop_observer): Rename to... (suppress_run_stop_observers): ..this. * infcmd.c (suppress_normal_stop_observer): Rename to... (suppress_run_stop_observers): ..this. (finish_command_continuation, finish_command): Adjust. * infcall.c (call_function_by_hand): Adjust. * infrun.c (normal_stop): Call set_running. * target.c (target_resume): New. Call set_running. * target.h (target_resume): Convert from macro to a function. * mi/mi-interp.c (mi_on_resume): New. (mi_interpreter_init): Register mi_on_resume.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog9
-rw-r--r--gdb/testsuite/gdb.mi/mi-console.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi-syn-frame.exp12
-rw-r--r--gdb/testsuite/gdb.mi/mi2-console.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi2-syn-frame.exp12
-rw-r--r--gdb/testsuite/lib/mi-support.exp6
6 files changed, 24 insertions, 19 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d994d1f..13c5d31 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,14 @@
2008-06-10 Vladimir Prus <vladimir@codesourcery.com>
+ * gdb.mi/mi-console.exp: Adjust.
+ * gdb.mi/mi-syn-frame.exp: Adjust.
+ * gdb.mi/mi2-console.exp: Adjust.
+ * gdb.mi/mi2-syn-frame.exp: Adjust.
+ * lib/mi-support.exp (mi_run_cmd): Adjust.
+ (mi_send_resuming_command): Adjust.
+
+2008-06-10 Vladimir Prus <vladimir@codesourcery.com>
+
* gdb.mi/mi-break.exp (test_ignore_count): Adjust stopped pattern.
* gdb.mi/mi-syn-frame.exp: Use mi_expect_stop instead of direct
testing of stopped.
diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
index 7d093dc..70d9342 100644
--- a/gdb/testsuite/gdb.mi/mi-console.exp
+++ b/gdb/testsuite/gdb.mi/mi-console.exp
@@ -52,7 +52,7 @@ mi_run_to_main
# Next over the hello() call which will produce lots of output
mi_gdb_test "220-exec-next" \
- "220\\^running" \
+ "220\\^running(\r\n\\*running,thread-id=\"all\")?" \
"Testing console output" \
"Hello \\\\\"!\[\r\n\]+"
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
index 208678b..59b8e44 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
@@ -46,7 +46,7 @@ mi_create_breakpoint "foo" 2 keep foo ".*mi-syn-frame.c" $decimal $hex \
# Call foo() by hand, where we'll hit a breakpoint.
#
-mi_gdb_test "401-data-evaluate-expression foo()" "401\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(foo\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" "call inferior's function with a breakpoint set in it"
+mi_gdb_test "401-data-evaluate-expression foo()" ".*401\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(foo\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" "call inferior's function with a breakpoint set in it"
mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" "backtrace from inferior function stopped at bp, showing gdb dummy frame"
@@ -54,9 +54,7 @@ mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",ad
#
# Continue back to main()
#
-mi_gdb_test "403-exec-continue" \
- "403\\^running" \
- "testing exec continue"
+mi_send_resuming_command "exec-continue" "testing exec continue"
mi_expect_stop "really-no-reason" "" "" "" "" "" "finished exec continue"
@@ -73,7 +71,7 @@ mi_create_breakpoint "subroutine" 3 keep subroutine ".*mi-syn-frame.c" $decimal
"insert breakpoint subroutine"
mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \
- "406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
+ ".*406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
"data evaluate expression"
# We should have both a signal handler and a call dummy frame
@@ -84,7 +82,7 @@ mi_gdb_test "407-stack-list-frames" \
"list stack frames"
-mi_gdb_test "408-exec-continue" "408\\^running"
+mi_send_resuming_command "exec-continue" "testing exec continue"
mi_expect_stop "really-no-reason" "" "" "" "" "" "finished exec continue"
@@ -97,7 +95,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
#
mi_gdb_test "410-data-evaluate-expression bar()" \
- "410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" \
+ ".*410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" \
"call inferior function which raises exception"
mi_gdb_test "411-stack-list-frames" "411\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
diff --git a/gdb/testsuite/gdb.mi/mi2-console.exp b/gdb/testsuite/gdb.mi/mi2-console.exp
index 88b4fdd..c5f6f81 100644
--- a/gdb/testsuite/gdb.mi/mi2-console.exp
+++ b/gdb/testsuite/gdb.mi/mi2-console.exp
@@ -53,7 +53,7 @@ mi_run_to_main
# Next over the hello() call which will produce lots of output
send_gdb "220-exec-next\n"
gdb_expect {
- -re "220\\^running\r\n$mi_gdb_prompt" {
+ -re "220\\^running\r\n(\\*running,thread-id=\"all\"\r\n)?$mi_gdb_prompt" {
pass "Started step over hello"
}
timeout {
diff --git a/gdb/testsuite/gdb.mi/mi2-syn-frame.exp b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
index b69812f..948e98d 100644
--- a/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
@@ -48,7 +48,7 @@ mi_create_breakpoint "foo" 2 keep foo ".*mi-syn-frame.c" $decimal $hex \
# Call foo() by hand, where we'll hit a breakpoint.
#
-mi_gdb_test "401-data-evaluate-expression foo()" "401\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(foo\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" "call inferior's function with a breakpoint set in it"
+mi_gdb_test "401-data-evaluate-expression foo()" ".*401\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(foo\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" "call inferior's function with a breakpoint set in it"
mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" "backtrace from inferior function stopped at bp, showing gdb dummy frame"
@@ -56,9 +56,7 @@ mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",ad
# Continue back to main()
#
-mi_gdb_test "403-exec-continue" \
- "403\\^running" \
- "testing exec continue"
+mi_send_resuming_command "exec-continue" "testing exec continue"
mi_expect_stop "really-no-reason" "" "" "" "" "" "finished exec continue"
@@ -75,7 +73,7 @@ mi_create_breakpoint "subroutine" 3 keep subroutine ".*mi-syn-frame.c" $decimal
"insert breakpoint subroutine"
mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \
- "406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
+ ".*406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
"evaluate expression have_a_very_merry_interrupt"
# We should have both a signal handler and a call dummy frame
@@ -85,7 +83,7 @@ mi_gdb_test "407-stack-list-frames" \
"407\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" \
"list stack frames"
-mi_gdb_test "408-exec-continue" "408\\^running"
+mi_send_resuming_command "exec-continue" "testing exec continue"
mi_expect_stop "really-no-reason" "" "" "" "" "" "finished exec continue"
@@ -97,7 +95,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
# Call bar() by hand, which should get an exception while running.
#
-mi_gdb_test "410-data-evaluate-expression bar()" "410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
+mi_gdb_test "410-data-evaluate-expression bar()" ".*410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
mi_gdb_test "411-stack-list-frames" "411\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 23f3f07..7a821b8 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -802,7 +802,7 @@ proc mi_run_cmd {args} {
if [target_info exists gdb,do_reload_on_run] {
send_gdb "220-exec-continue\n";
gdb_expect 60 {
- -re "220\\^running\[\r\n\]+$mi_gdb_prompt$" {}
+ -re "220\\^running\[\r\n\]+(\\*running,thread-id=\"\[^\"\]+\"\r\n)?$mi_gdb_prompt$" {}
default {}
}
return;
@@ -823,7 +823,7 @@ proc mi_run_cmd {args} {
send_gdb "220-exec-run $args\n"
gdb_expect {
- -re "220\\^running\r\n(=thread-created,id=\"1\"\r\n)?${mi_gdb_prompt}" {
+ -re "220\\^running\r\n(\\*running,thread-id=\"\[^\"\]+\"\r\n|=thread-created,id=\"1\"\r\n)*${mi_gdb_prompt}" {
}
timeout {
perror "Unable to start target"
@@ -1399,7 +1399,7 @@ proc mi_send_resuming_command {command test} {
send_gdb "220-$command\n"
gdb_expect {
- -re "220\\^running\r\n${mi_gdb_prompt}" {
+ -re "220\\^running\r\n(\\*running,thread-id=\"\[^\"\]+\"\r\n)?${mi_gdb_prompt}" {
}
-re ".*${mi_gdb_prompt}" {
fail "$test (failed to resume)"