summaryrefslogtreecommitdiffstats
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorBob Rossi <bob@brasko.net>2005-08-04 01:52:31 +0000
committerBob Rossi <bob@brasko.net>2005-08-04 01:52:31 +0000
commitecd3fd0f9d94eb0d6675090a4d9c6ce904817f20 (patch)
tree9c284564f3e2823ccd3606561b8ba3867d665f38 /gdb/testsuite/gdb.mi
parent1e035701d67ed8a8bc72ec9e393f2d984090a60c (diff)
downloadppe42-binutils-ecd3fd0f9d94eb0d6675090a4d9c6ce904817f20.tar.gz
ppe42-binutils-ecd3fd0f9d94eb0d6675090a4d9c6ce904817f20.zip
2005-08-02 Bob Rossi <bob@brasko.net>
* gdb.mi/mi-basics.exp: Tell mi_gdb_start to use a PTY for inferior. (test_setshow_inferior_tty): Add global mi_inferior_tty_name to scope. Change tests to inferior-tty-set/show. * gdb.mi/mi-console.exp: Tell mi_gdb_start to use a PTY for inferior. (47-exec-next): Use mi_gdb_test to get GDB and Inferior output. * gdb.mi/mi-syn-frame.exp: Tell mi_gdb_start to use a PTY for inferior. Use mi_gdb_test to get GDB and Inferior output. * lib/mi-support.exp (mi_inferior_spawn_id): Add inferior PTY descriptor. (mi_inferior_tty_name): Add inferior PTY file name. (mi_gdb_start): Add INFERIOR_PTY parameter. (mi_gdb_test): Add IPATTERN parameter.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-basics.exp17
-rw-r--r--gdb/testsuite/gdb.mi/mi-console.exp37
-rw-r--r--gdb/testsuite/gdb.mi/mi-syn-frame.exp37
3 files changed, 32 insertions, 59 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
index 0d2b06ee98..7e576a7077 100644
--- a/gdb/testsuite/gdb.mi/mi-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi-basics.exp
@@ -33,7 +33,7 @@ load_lib mi-support.exp
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start separate-inferior-tty] {
continue
}
@@ -238,6 +238,7 @@ proc test_path_specification {} {
proc test_setshow_inferior_tty {} {
global mi_gdb_prompt
+ global mi_inferior_tty_name
# Test that the commands,
# -inferior-tty-set
@@ -245,8 +246,8 @@ proc test_setshow_inferior_tty {} {
# are setting/getting the same data in GDB.
mi_gdb_test "301-inferior-tty-show" \
- "301\\\^done" \
- "initial tty is empty"
+ "301\\\^done,inferior_tty_terminal=\"$mi_inferior_tty_name\"" \
+ "initial tty is mi_inferior_tty_name"
mi_gdb_test "302-inferior-tty-set /dev/pts/1" \
"302\\\^done" \
@@ -262,7 +263,15 @@ proc test_setshow_inferior_tty {} {
mi_gdb_test "305-inferior-tty-show" \
"305\\\^done" \
- "final tty is empty"
+ "make sure tty is empty"
+
+ mi_gdb_test "306-inferior-tty-set $mi_inferior_tty_name" \
+ "306\\\^done" \
+ "set tty to mi_inferior_tty_name (the way it was)"
+
+ mi_gdb_test "307-inferior-tty-show" \
+ "307\\\^done,inferior_tty_terminal=\"$mi_inferior_tty_name\"" \
+ "verify tty is correct"
}
if [test_mi_interpreter_selection] {
diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
index 2dbfc15937..84ae35fb5d 100644
--- a/gdb/testsuite/gdb.mi/mi-console.exp
+++ b/gdb/testsuite/gdb.mi/mi-console.exp
@@ -36,7 +36,7 @@ load_lib mi-support.exp
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start separate-inferior-tty] {
continue
}
@@ -54,37 +54,10 @@ mi_gdb_load ${binfile}
mi_run_to_main
# Next over the hello() call which will produce lots of output
-send_gdb "47-exec-next\n"
-gdb_expect {
- -re "47\\^running\r\n$mi_gdb_prompt" {
- pass "Started step over hello"
- }
- timeout {
- fail "Started step over hello (timeout)"
- }
-}
-
-if { ![target_info exists gdb,noinferiorio]} {
- gdb_expect {
- -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
- pass "Hello message"
- }
- -re "Hello" {
-
- # Probably a native system where GDB doesn't have direct #
- # control over the inferior console. # For this to work,
- # GDB would need to run the inferior process # under a PTY
- # and then use the even-loops ability to wait on #
- # multiple event sources to channel the output back
- # through the # MI.
-
- kfail "gdb/623" "Hello message"
- }
- timeout {
- fail "Hello message (timeout)"
- }
- }
-}
+mi_gdb_test "47-exec-next" \
+ "47\\^running" \
+ "Testing console output" \
+ "Hello \\\\\"!\[\r\n\]+"
gdb_expect {
-re "47\\*stopped.*$mi_gdb_prompt$" {
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
index a5e99651a6..28a2f28b70 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
@@ -38,7 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
set my_mi_gdb_prompt "\\(gdb\\)\[ \]*\[\r\n\]*"
mi_gdb_exit
-mi_gdb_start
+mi_gdb_start separate-inferior-tty
mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
@@ -60,16 +60,10 @@ mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",ad
#
# Continue back to main()
#
-
-send_gdb "403-exec-continue\n"
-gdb_expect {
- -re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}hi in foo\[\r\n\]+403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
- pass "403-exec-continue"
- }
- timeout {
- fail "403-exec-continue"
- }
-}
+mi_gdb_test "403-exec-continue" \
+ "403\\^running\[\r\n\]+${my_mi_gdb_prompt}403\\\*stopped" \
+ "testing exec continue" \
+ "hi in foo\[\r\n\]\+"
mi_gdb_test "404-stack-list-frames 0 0" \
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \
@@ -85,8 +79,9 @@ mi_gdb_test "405-break-insert subroutine" \
"insert breakpoint subroutine"
mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \
- "Waiting to get a signal\[\r\n\]+\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+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"
+ "\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+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" \
+ "Waiting to get a signal\[\r\n\]+"
# We should have both a signal handler and a call dummy frame
# in this next output.
@@ -96,15 +91,8 @@ mi_gdb_test "407-stack-list-frames" \
"list stack frames"
-send_gdb "408-exec-continue\n"
-gdb_expect {
- -re "408\\^running\[\r\n\]+${my_mi_gdb_prompt}408\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
- pass "408-exec-continue"
- }
- timeout {
- fail "408-exec-continue"
- }
-}
+mi_gdb_test "408-exec-continue" \
+ "408\\^running\[\r\n\]+${my_mi_gdb_prompt}408\\\*stopped"
mi_gdb_test "409-stack-list-frames 0 0" \
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \
@@ -114,7 +102,10 @@ 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()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+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()" \
+ "\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+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" \
+ "hi in bar\[\r\n\]+"
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"
OpenPOWER on IntegriCloud