* MI testsuite improvements
@ 2005-02-10 15:43 Bob Rossi
2005-02-10 17:43 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-10 15:43 UTC (permalink / raw)
To: gdb-patches
Hi,
This patch is a prerequisite to the patch that includes the syntax
checker for the MI output commands.
It does several things,
- Gives the inferior it's own PTY to send output to
- Turn's echo'ing off on the GDB terminal side
- Anchor's all output, from begining to end
- Update's MI testcase's to deal with changes
- Changes mi_gdb_test to take another parameter, called IPATTERN,
that simply matches the output of the inferior.
This greatly improves the amount of error checking done by the
testsuite, since it checks *all* output of GDB, at least when GDB
responds with a "PASS" status from mi_gdb_test.
Finally, the mi_inferior_spawn_id global was added to mi-support.exp.
This can be used by testscripts directly to check the output of the
inferior. However, only mi-console.exp use's it. If mi-console.exp can
be changed, like I mentioned about here,
http://sources.redhat.com/ml/gdb/2005-02/msg00066.html
then the global can be removed, and mi-console.exp can simply call
mi_gdb_test.
Thanks,
Bob Rossi
2005-02-10 Bob Rossi <bob@brasko.net>
* gdb.mi/mi-console.exp: Use global 'mi_inferior_spawn_id' and change
gdb_expect to use expect -i $mi_inferior_spawn_id
* gdb.mi/mi2-console.exp: Ditto
* gdb.mi/mi-disassemble.exp: Remove unneeded .* in match and escaped the
'|' charachter.
* gdb.mi/mi-disassemble.exp: Ditto
* gdb.mi/mi-syn-frame.exp: 403-exec-continue now use's mi_gdb_test
same for 406-data-evaluate-expression, same for 408-exec-continue,
same for 410-data-evaluate-expression
* gdb.mi/mi-syn-frame.exp: Ditto
* lib/mi-support.exp (mi_inferior_spawn_id): add global
(mi_gdb_start): spawn a new pty for inferior
Send 'tty' and 'stty -echo' command's to GDB
(mi_delete_breakpoints): No need to match .* anymore
No need to match echo'd command
(mi_gdb_file_cmd): No need to match echo'd command
(mi_gdb_test): Add IPATTERN parameter,
Match the output of the inferior to IPATTERN
Index: src/gdb/testsuite/gdb.mi/mi-console.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-console.exp,v
retrieving revision 1.12
diff -w -u -r1.12 mi-console.exp
--- src/gdb/testsuite/gdb.mi/mi-console.exp 9 Aug 2004 16:32:44 -0000 1.12
+++ src/gdb/testsuite/gdb.mi/mi-console.exp 10 Feb 2005 13:33:52 -0000
@@ -34,6 +34,7 @@
load_lib mi-support.exp
set MIFLAGS "-i=mi"
+global mi_inferior_spawn_id
gdb_exit
if [mi_gdb_start] {
@@ -64,11 +65,11 @@
}
}
-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" {
+expect {
+ -i $mi_inferior_spawn_id -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" {
+ -i $mi_inferior_spawn_id -re "Hello" {
# Probably a native system where GDB doesn't have direct
# control over the inferior console.
Index: src/gdb/testsuite/gdb.mi/mi-disassemble.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-disassemble.exp,v
retrieving revision 1.13
diff -w -u -r1.13 mi-disassemble.exp
--- src/gdb/testsuite/gdb.mi/mi-disassemble.exp 15 Aug 2004 10:15:58 -0000 1.13
+++ src/gdb/testsuite/gdb.mi/mi-disassemble.exp 10 Feb 2005 13:33:52 -0000
@@ -163,7 +163,7 @@
# -data-disassembly -f basics.c -l 32 -- 9
mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \
- ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \
+ "123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \
"data-disassemble bogus filename"
mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \
@@ -171,7 +171,7 @@
"data-disassemble bogus address"
mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \
- "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \
+ "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. \\| .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \
"data-disassemble mix different args"
mi_gdb_test "789-data-disassemble -f basics.c -l $line_main_body -- 9" \
Index: src/gdb/testsuite/gdb.mi/mi-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
retrieving revision 1.2
diff -w -u -r1.2 mi-syn-frame.exp
--- src/gdb/testsuite/gdb.mi/mi-syn-frame.exp 24 Feb 2003 20:15:47 -0000 1.2
+++ src/gdb/testsuite/gdb.mi/mi-syn-frame.exp 10 Feb 2005 13:33:52 -0000
@@ -58,16 +58,10 @@
#
# 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" \
+ "hi in foo\[\r\n\]\+" \
+ "testing exec continue"
mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
@@ -78,7 +72,11 @@
mi_gdb_test "405-break-insert subroutine" "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}"
-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\\).\""
+mi_gdb_test "406-data-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\\).\"" \
+ "Waiting to get a signal\[\r\n\]+" \
+ "data evaluate expression"
+
# We should have both a signal handler and a call dummy frame
# in this next output.
@@ -86,15 +84,8 @@
mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},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\"\}.*\\\]"
-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\",line=\"$decimal\"\}.*\\\]"
@@ -102,7 +93,10 @@
# 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.\"" \
+ "hi in bar\[\r\n\]+" \
+ "call inferior function which raises exception"
mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",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 at exception"
Index: src/gdb/testsuite/gdb.mi/mi2-console.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-console.exp,v
retrieving revision 1.2
diff -w -u -r1.2 mi2-console.exp
--- src/gdb/testsuite/gdb.mi/mi2-console.exp 9 Aug 2004 22:21:54 -0000 1.2
+++ src/gdb/testsuite/gdb.mi/mi2-console.exp 10 Feb 2005 13:33:52 -0000
@@ -34,6 +34,7 @@
load_lib mi-support.exp
set MIFLAGS "-i=mi2"
+global mi_inferior_spawn_id
gdb_exit
if [mi_gdb_start] {
@@ -64,11 +65,11 @@
}
}
-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" {
+expect {
+ -i $mi_inferior_spawn_id -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" {
+ -i $mi_inferior_spawn_id -re "Hello" {
# Probably a native system where GDB doesn't have direct
# control over the inferior console.
Index: src/gdb/testsuite/gdb.mi/mi2-disassemble.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-disassemble.exp,v
retrieving revision 1.3
diff -w -u -r1.3 mi2-disassemble.exp
--- src/gdb/testsuite/gdb.mi/mi2-disassemble.exp 15 Aug 2004 10:15:58 -0000 1.3
+++ src/gdb/testsuite/gdb.mi/mi2-disassemble.exp 10 Feb 2005 13:33:52 -0000
@@ -171,7 +171,7 @@
"data-disassemble bogus address"
mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \
- "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \
+ "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. \\| .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \
"data-disassemble mix different args"
mi_gdb_test "789-data-disassemble -f basics.c -l $line_main_body -- 9" \
Index: src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp,v
retrieving revision 1.1
diff -w -u -r1.1 mi2-syn-frame.exp
--- src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp 7 Aug 2003 17:47:42 -0000 1.1
+++ src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp 10 Feb 2005 13:33:52 -0000
@@ -59,15 +59,10 @@
# 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" \
+ "hi in foo\[\r\n\]\+" \
+ "testing exec continue"
mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
@@ -78,23 +73,18 @@
mi_gdb_test "405-break-insert subroutine" "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}"
-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\\).\""
+mi_gdb_test "406-data-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\\).\"" \
+ "Waiting to get a signal\[\r\n\]+" \
+ "data evaluate expression"
# We should have both a signal handler and a call dummy frame
# in this next output.
mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},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\"\}.*\\\]"
-
-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\",line=\"$decimal\"\}.*\\\]"
@@ -102,7 +92,10 @@
# 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.\"" \
+ "hi in bar\[\r\n\]+" \
+ "call inferior function which raises exception"
mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",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 at exception"
Index: src/gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.24
diff -w -u -r1.24 mi-support.exp
--- src/gdb/testsuite/lib/mi-support.exp 18 Jan 2004 15:23:30 -0000 1.24
+++ src/gdb/testsuite/lib/mi-support.exp 10 Feb 2005 13:33:53 -0000
@@ -28,6 +28,8 @@
set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
}
+global mi_inferior_spawn_id
+
set MIFLAGS "-i=mi"
#
@@ -117,6 +119,13 @@
exit 1
}
}
+
+ # spawn off the new pty for the inferior process
+ spawn -pty
+ global mi_inferior_spawn_id
+ set mi_inferior_spawn_id $spawn_id
+ set mi_inferior_tty_name $spawn_out(slave,name)
+
set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
@@ -189,6 +198,26 @@
warning "Couldn't set the width to 0."
}
}
+ # set the inferior output to the new created terminal device
+ send_gdb "102-interpreter-exec console \"tty $mi_inferior_tty_name\"\n"
+ gdb_expect 10 {
+ -re ".*$mi_gdb_prompt$" {
+ verbose "redirect inferior output to new terminal device."
+ }
+ timeout {
+ warning "Couldn't redirect inferior output." 2
+ }
+ }
+ # tell GDB not to echo
+ send_gdb "103-interpreter-exec console \"shell stty -echo\"\n"
+ gdb_expect 10 {
+ -re ".*$mi_gdb_prompt$" {
+ verbose "turning off the terminal echoing" 2
+ }
+ timeout {
+ warning "Couldn't turn off the terminal's echoing."
+ }
+ }
return 0;
}
@@ -209,7 +238,7 @@
send_gdb "y\n";
exp_continue
}
- -re ".*102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" {
+ -re "102\\\^done\r\n$mi_gdb_prompt$" {
# This happens if there were no breakpoints
}
timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return }
@@ -219,9 +248,9 @@
# empty BreakpointTable. Also, a query is not acceptable with mi.
send_gdb "103-break-list\n"
gdb_expect 30 {
- -re "103-break-list\r\n103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {}
- -re "103-break-list\r\n103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}" {}
- -re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
+ -re "103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {}
+ -re "103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}" {}
+ -re "103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
-re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return }
-re "Delete all breakpoints.*or n.*$" {
warning "Unexpected prompt for breakpoints deletion";
@@ -396,7 +425,7 @@
perror "($arg) No such file or directory\n"
return -1
}
- -re "105-file-exec-and-symbols .*\r\n105\\\^done\r\n$mi_gdb_prompt$" {
+ -re "105\\\^done\r\n$mi_gdb_prompt$" {
# We (MI) are just giving the prompt back for now, instead of giving
# some acknowledgement.
return 0
@@ -516,12 +545,14 @@
return 0
}
-# mi_gdb_test COMMAND PATTERN MESSAGE -- send a command to gdb; test the result.
+# mi_gdb_test COMMAND PATTERN IPATTERN MESSAGE -- send a command to gdb; test the result.
#
# COMMAND is the command to execute, send to GDB with send_gdb. If
# this is the null string no command is sent.
# PATTERN is the pattern to match for a PASS, and must NOT include
# the \r\n sequence immediately before the gdb prompt.
+# IPATTERN is the pattern to match for the inferior's output. This will not
+# produce a PASS if successfull, but will produce a FAIL if unsuccessful.
# MESSAGE is an optional message to be printed. If this is
# omitted, then the pass/fail messages use the command string as the
# message. (If this is the empty string, then sometimes we don't
@@ -538,14 +569,20 @@
global GDB expect_out
upvar timeout timeout
- if [llength $args]>2 then {
+ if { [llength $args] == 3} {
set message [lindex $args 2]
+ } elseif {[llength $args] == 4 } {
+ set message [lindex $args 3]
} else {
set message [lindex $args 0]
}
set command [lindex $args 0]
set pattern [lindex $args 1]
+ if [llength $args]==4 {
+ set ipattern [lindex $args 2]
+ }
+
if [llength $args]==5 {
set question_string [lindex $args 3];
set response_string [lindex $args 4];
@@ -624,7 +661,7 @@
gdb_start
set result -1
}
- -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" {
+ -re "^(.*$pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)$" {
if ![string match "" $message] then {
pass "$message"
}
@@ -696,6 +733,21 @@
set result 1
}
}
+
+ # if the GDB output matched, compare the inferior output
+ if { $result == 0 } {
+ if [ info exists ipattern ] {
+ global mi_inferior_spawn_id
+ expect {
+ -i $mi_inferior_spawn_id -re "$ipattern" {}
+ timeout {
+ fail "inferior output timeout"
+ set result 1
+ }
+ }
+ }
+ }
+
return $result
}
@@ -864,11 +916,11 @@
global decimal
send_gdb "220-$cmd\n"
gdb_expect {
- -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
+ -re "220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
- -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
+ -re "220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-10 15:43 MI testsuite improvements Bob Rossi
@ 2005-02-10 17:43 ` Andrew Cagney
2005-02-10 18:16 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2005-02-10 17:43 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb-patches
Bob Rossi wrote:
> Hi,
>
> This patch is a prerequisite to the patch that includes the syntax
> checker for the MI output commands.
> It does several things,
Please, one change, one patch.
> - Gives the inferior it's own PTY to send output to
I'm ok with this, as I think you noted elsewhere, this has become the
defacto standard. Would you be interested in documenting this?
The change should be applied to just mi-* and not mi2-*, and should only
accept plain text on that PTY. @... output on the PTY should be
rejected ("in theory" so should anything on GDB's pty).
Once you've committed this, we can look at the next problem.
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-10 17:43 ` Andrew Cagney
@ 2005-02-10 18:16 ` Bob Rossi
2005-02-10 19:58 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-10 18:16 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
> Please, one change, one patch.
Sorry, still a little new to this.
> > - Gives the inferior it's own PTY to send output to
>
> I'm ok with this, as I think you noted elsewhere, this has become the
> defacto standard. Would you be interested in documenting this?
Sure, where thought?
> The change should be applied to just mi-* and not mi2-*, and should only
> accept plain text on that PTY. @... output on the PTY should be
> rejected ("in theory" so should anything on GDB's pty).
Just curious, why are you interested in only applying changes to mi-* and
not to mi2-*?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-10 18:16 ` Bob Rossi
@ 2005-02-10 19:58 ` Andrew Cagney
2005-02-10 23:34 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2005-02-10 19:58 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb-patches
>>I'm ok with this, as I think you noted elsewhere, this has become the
>>defacto standard. Would you be interested in documenting this?
>
>
> Sure, where thought?
I've no idea.
>>The change should be applied to just mi-* and not mi2-*, and should only
>>accept plain text on that PTY. @... output on the PTY should be
>>rejected ("in theory" so should anything on GDB's pty).
>
>
> Just curious, why are you interested in only applying changes to mi-* and
> not to mi2-*?
We have effectively changed the interface (or its expected use). New
code should use/expect the PTY, old code should use/expect the @...
mechanism.
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-10 19:58 ` Andrew Cagney
@ 2005-02-10 23:34 ` Bob Rossi
2005-02-11 4:01 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-10 23:34 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Thu, Feb 10, 2005 at 12:46:20PM -0500, Andrew Cagney wrote:
>
> >>I'm ok with this, as I think you noted elsewhere, this has become the
> >>defacto standard. Would you be interested in documenting this?
> >
> >
> >Sure, where thought?
>
> I've no idea.
>
> >>The change should be applied to just mi-* and not mi2-*, and should only
> >>accept plain text on that PTY. @... output on the PTY should be
> >>rejected ("in theory" so should anything on GDB's pty).
> >
> >
> >Just curious, why are you interested in only applying changes to mi-* and
> >not to mi2-*?
>
> We have effectively changed the interface (or its expected use). New
> code should use/expect the PTY, old code should use/expect the @...
> mechanism.
OO, I see, are you saying the mi-* tests will become the new ones, and
the mi2-* are frozen for the mi2-* development cycle?
In order to do this for only the new tests, I'll have to add a new
parameter to mi_gdb_start to tell it to either open or not open a pty
for the inferior. Hope this will be OK.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-10 23:34 ` Bob Rossi
@ 2005-02-11 4:01 ` Andrew Cagney
2005-02-11 19:07 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2005-02-11 4:01 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb-patches
> OO, I see, are you saying the mi-* tests will become the new ones, and
> the mi2-* are frozen for the mi2-* development cycle?
>
> In order to do this for only the new tests, I'll have to add a new
> parameter to mi_gdb_start to tell it to either open or not open a pty
> for the inferior. Hope this will be OK.
M'kay.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-11 4:01 ` Andrew Cagney
@ 2005-02-11 19:07 ` Bob Rossi
2005-02-12 3:13 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-11 19:07 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Thu, Feb 10, 2005 at 03:52:08PM -0500, Andrew Cagney wrote:
>
> >OO, I see, are you saying the mi-* tests will become the new ones, and
> >the mi2-* are frozen for the mi2-* development cycle?
> >
> >In order to do this for only the new tests, I'll have to add a new
> >parameter to mi_gdb_start to tell it to either open or not open a pty
> >for the inferior. Hope this will be OK.
>
> M'kay.
Here is the patch that give's the inferior it's own PTY and only changes
the mi-* testcase's and not the the mi2-* testcases. Just to mention, it
will definatly be more complicated to have only the mi-* testcase's use
the PTY and have the mi2-* not. However, if this is what you want, it is
possible to do.
Few things to note is that
- mi_gdb_start now takes an optional parameter. This tells it to have
the inferior use a tty or not. I could make this parameter not
optional, and put 'false' everywhere for the mi2-* tests. Is this
what you want? Sorry, don't know what normal conventions are for
Tcl programming, since I'm a newbie.
- mi_gdb_test now takes an IPATTERN parameter, which refer's to the
pattern the inferior must match if the parameter is present. A
PASS is given if the output is matched, otherwise a FAIL. So, when
calling mi_gdb_test, when you give the IPATTERN, 2 PASS's are given
instead of just 1.
Here is the result's of the entire MI testsuite, with my changes,
# of expected passes 1220
# of unexpected failures 6
# of expected failures 28
# of known failures 1
Here it is without my changes,
# of expected passes 1216
# of unexpected failures 6
# of expected failures 28
# of known failures 2
Here's why the results change,
mi-console.exp -> used to produce 1 pass and 1 kfail for the
'47-exec-next' command. Now it produces 2 passed.
mi-syn-frame.exp -> I called mi_gdb_test 3 times there with inferior
output expected. This add's the extra 3 PASS's.
So with 4 more passes and 1 less kfail, the results line up.
Thanks,
Bob Rossi
2005-02-11 Bob Rossi <bob@brasko.net>
* gdb.mi/mi-basics.exp: tell mi_gdb_start to use PTY for inferior
* gdb.mi/mi-break.exp: Ditto
* gdb.mi/mi-cli.exp: Ditto
* gdb.mi/mi-disassemble.exp: Ditto
* gdb.mi/mi-eval.exp: Ditto
* gdb.mi/mi-file.exp: Ditto
* gdb.mi/mi-hack-cli.exp: Ditto
* gdb.mi/mi-pthreads.exp: Ditto
* gdb.mi/mi-read-memory.exp: Ditto
* gdb.mi/mi-regs.exp: Ditto
* gdb.mi/mi-return.exp: Ditto
* gdb.mi/mi-simplerun.exp: Ditto
* gdb.mi/mi-stack.exp: Ditto
* gdb.mi/mi-stepi.exp: Ditto
* gdb.mi/mi-until.exp: Ditto
* gdb.mi/mi-var-block.exp: Ditto
* gdb.mi/mi-var-child.exp: Ditto
* gdb.mi/mi-var-cmd.exp: Ditto
* gdb.mi/mi-var-display.exp: Ditto
* gdb.mi/mi-watch.exp: Ditto
* gdb.mi/mi-syn-frame.exp: tell mi_gdb_start to use PTY for inferior
(403-exec-continue): Use mi_gdb_test to get GDB and Inferior output
(406-data-evaluate-expression have_a_very_merry_interrupt()):
Use mi_gdb_test to get GDB and Inferior output
(408-exec-continue): Use mi_gdb_test to get GDB output
(410-data-evaluate-expression bar()):
Use mi_gdb_test to get GDB and Inferior output
* gdb.mi/mi-conole.exp: tell mi_gdb_start to use PTY for inferior
Change 47-exec-next command to use the mi_gdb_test to have the
output from GDB and inferior matched in 1 command.
* lib/mi-support.exp (mi_inferior_spawn_id): add inferior PTY
descriptor
(mi_gdb_start): Add INERIOR_PTY parameter, if TRUE, use PTY for
inferior, otherwise share GDB's PTY.
(mi_gdb_test): Add IPATTERN parameter, match inferior output from
the inferior's very own PTY.
Index: gdb.mi/mi-basics.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-basics.exp,v
retrieving revision 1.9
diff -w -u -r1.9 mi-basics.exp
--- gdb.mi/mi-basics.exp 9 Aug 2004 16:32:44 -0000 1.9
+++ gdb.mi/mi-basics.exp 11 Feb 2005 17:01:44 -0000
@@ -33,7 +33,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
retrieving revision 1.7
diff -w -u -r1.7 mi-break.exp
--- gdb.mi/mi-break.exp 13 Aug 2004 16:21:29 -0000 1.7
+++ gdb.mi/mi-break.exp 11 Feb 2005 17:01:44 -0000
@@ -29,7 +29,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-cli.exp,v
retrieving revision 1.3
diff -w -u -r1.3 mi-cli.exp
--- gdb.mi/mi-cli.exp 15 Aug 2004 10:15:58 -0000 1.3
+++ gdb.mi/mi-cli.exp 11 Feb 2005 17:01:44 -0000
@@ -24,7 +24,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-console.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-console.exp,v
retrieving revision 1.12
diff -w -u -r1.12 mi-console.exp
--- gdb.mi/mi-console.exp 9 Aug 2004 16:32:44 -0000 1.12
+++ gdb.mi/mi-console.exp 11 Feb 2005 17:01:44 -0000
@@ -36,7 +36,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
@@ -54,35 +54,11 @@
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)"
- }
-}
-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" \
+ "Hello \\\\\"!\[\r\n\]+" \
+ "Testing console output"
gdb_expect {
-re "47\\*stopped.*$mi_gdb_prompt$" {
Index: gdb.mi/mi-disassemble.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-disassemble.exp,v
retrieving revision 1.13
diff -w -u -r1.13 mi-disassemble.exp
--- gdb.mi/mi-disassemble.exp 15 Aug 2004 10:15:58 -0000 1.13
+++ gdb.mi/mi-disassemble.exp 11 Feb 2005 17:01:44 -0000
@@ -25,7 +25,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-eval.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-eval.exp,v
retrieving revision 1.9
diff -w -u -r1.9 mi-eval.exp
--- gdb.mi/mi-eval.exp 15 Aug 2004 10:15:58 -0000 1.9
+++ gdb.mi/mi-eval.exp 11 Feb 2005 17:01:44 -0000
@@ -27,7 +27,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-file.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-file.exp,v
retrieving revision 1.4
diff -w -u -r1.4 mi-file.exp
--- gdb.mi/mi-file.exp 15 Aug 2004 10:15:58 -0000 1.4
+++ gdb.mi/mi-file.exp 11 Feb 2005 17:01:44 -0000
@@ -29,7 +29,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-hack-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-hack-cli.exp,v
retrieving revision 1.6
diff -w -u -r1.6 mi-hack-cli.exp
--- gdb.mi/mi-hack-cli.exp 9 Aug 2004 16:32:44 -0000 1.6
+++ gdb.mi/mi-hack-cli.exp 11 Feb 2005 17:01:44 -0000
@@ -24,7 +24,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-pthreads.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-pthreads.exp,v
retrieving revision 1.7
diff -w -u -r1.7 mi-pthreads.exp
--- gdb.mi/mi-pthreads.exp 13 Jan 2004 17:08:03 -0000 1.7
+++ gdb.mi/mi-pthreads.exp 11 Feb 2005 17:01:45 -0000
@@ -32,7 +32,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if {[mi_gdb_start]} {
+if {[mi_gdb_start true]} {
continue
}
Index: gdb.mi/mi-read-memory.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-read-memory.exp,v
retrieving revision 1.9
diff -w -u -r1.9 mi-read-memory.exp
--- gdb.mi/mi-read-memory.exp 9 Aug 2004 16:32:44 -0000 1.9
+++ gdb.mi/mi-read-memory.exp 11 Feb 2005 17:01:45 -0000
@@ -33,7 +33,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-regs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-regs.exp,v
retrieving revision 1.12
diff -w -u -r1.12 mi-regs.exp
--- gdb.mi/mi-regs.exp 9 Aug 2004 16:32:44 -0000 1.12
+++ gdb.mi/mi-regs.exp 11 Feb 2005 17:01:45 -0000
@@ -30,7 +30,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-return.exp,v
retrieving revision 1.11
diff -w -u -r1.11 mi-return.exp
--- gdb.mi/mi-return.exp 15 Aug 2004 10:15:58 -0000 1.11
+++ gdb.mi/mi-return.exp 11 Feb 2005 17:01:45 -0000
@@ -27,7 +27,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.12
diff -w -u -r1.12 mi-simplerun.exp
--- gdb.mi/mi-simplerun.exp 15 Aug 2004 10:15:58 -0000 1.12
+++ gdb.mi/mi-simplerun.exp 11 Feb 2005 17:01:45 -0000
@@ -29,7 +29,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.14
diff -w -u -r1.14 mi-stack.exp
--- gdb.mi/mi-stack.exp 15 Aug 2004 10:15:58 -0000 1.14
+++ gdb.mi/mi-stack.exp 11 Feb 2005 17:01:45 -0000
@@ -27,7 +27,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stepi.exp,v
retrieving revision 1.10
diff -w -u -r1.10 mi-stepi.exp
--- gdb.mi/mi-stepi.exp 15 Aug 2004 10:15:58 -0000 1.10
+++ gdb.mi/mi-stepi.exp 11 Feb 2005 17:01:45 -0000
@@ -27,7 +27,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
retrieving revision 1.2
diff -w -u -r1.2 mi-syn-frame.exp
--- gdb.mi/mi-syn-frame.exp 24 Feb 2003 20:15:47 -0000 1.2
+++ gdb.mi/mi-syn-frame.exp 11 Feb 2005 17:01:45 -0000
@@ -38,7 +38,7 @@
set my_mi_gdb_prompt "\\(gdb\\)\[ \]*\[\r\n\]*"
mi_gdb_exit
-mi_gdb_start
+mi_gdb_start true
mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
@@ -58,16 +58,10 @@
#
# 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" \
+ "hi in foo\[\r\n\]\+" \
+ "testing exec continue"
mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
@@ -78,7 +72,11 @@
mi_gdb_test "405-break-insert subroutine" "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}"
-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\\).\""
+mi_gdb_test "406-data-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\\).\"" \
+ "Waiting to get a signal\[\r\n\]+" \
+ "data evaluate expression"
+
# We should have both a signal handler and a call dummy frame
# in this next output.
@@ -86,15 +84,8 @@
mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},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\"\}.*\\\]"
-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\",line=\"$decimal\"\}.*\\\]"
@@ -102,7 +93,10 @@
# 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.\"" \
+ "hi in bar\[\r\n\]+" \
+ "call inferior function which raises exception"
mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",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 at exception"
Index: gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.8
diff -w -u -r1.8 mi-until.exp
--- gdb.mi/mi-until.exp 9 Aug 2004 16:32:44 -0000 1.8
+++ gdb.mi/mi-until.exp 11 Feb 2005 17:01:45 -0000
@@ -30,7 +30,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-var-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-block.exp,v
retrieving revision 1.11
diff -w -u -r1.11 mi-var-block.exp
--- gdb.mi/mi-var-block.exp 17 Aug 2004 09:38:29 -0000 1.11
+++ gdb.mi/mi-var-block.exp 11 Feb 2005 17:01:45 -0000
@@ -24,7 +24,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child.exp,v
retrieving revision 1.17
diff -w -u -r1.17 mi-var-child.exp
--- gdb.mi/mi-var-child.exp 17 Aug 2004 09:38:29 -0000 1.17
+++ gdb.mi/mi-var-child.exp 11 Feb 2005 17:01:46 -0000
@@ -24,7 +24,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp,v
retrieving revision 1.18
diff -w -u -r1.18 mi-var-cmd.exp
--- gdb.mi/mi-var-cmd.exp 14 Jan 2005 18:17:19 -0000 1.18
+++ gdb.mi/mi-var-cmd.exp 11 Feb 2005 17:01:47 -0000
@@ -25,7 +25,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.12
diff -w -u -r1.12 mi-var-display.exp
--- gdb.mi/mi-var-display.exp 17 Aug 2004 09:38:29 -0000 1.12
+++ gdb.mi/mi-var-display.exp 11 Feb 2005 17:01:47 -0000
@@ -24,7 +24,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.11
diff -w -u -r1.11 mi-watch.exp
--- gdb.mi/mi-watch.exp 15 Aug 2004 10:15:58 -0000 1.11
+++ gdb.mi/mi-watch.exp 11 Feb 2005 17:01:47 -0000
@@ -29,7 +29,7 @@
set MIFLAGS "-i=mi"
gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start true] {
continue
}
Index: lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.24
diff -w -u -r1.24 mi-support.exp
--- lib/mi-support.exp 18 Jan 2004 15:23:30 -0000 1.24
+++ lib/mi-support.exp 11 Feb 2005 17:01:49 -0000
@@ -28,6 +28,8 @@
set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
}
+global mi_inferior_spawn_id
+
set MIFLAGS "-i=mi"
#
@@ -81,13 +83,16 @@
}
#
-# start gdb -- start gdb running, default procedure
+# start gdb INFERIOR_PTY -- start gdb running, default procedure
+#
+# INFERIOR_PTY should be set to TRUE to have the inferior work with it's
+# own PTY. If set to FALSE, the inferior shares GDB's PTY.
#
# When running over NFS, particularly if running many simultaneous
# tests on different hosts all using the same server, things can
# get really slow. Give gdb at least 3 minutes to start up.
#
-proc mi_gdb_start { } {
+proc mi_gdb_start { args } {
global verbose
global GDB
global GDBFLAGS
@@ -99,6 +104,10 @@
gdb_stop_suppressing_tests;
+ if { [llength $args] == 1} {
+ set inferior_pty [lindex $args 0]
+ }
+
# Start SID.
if { [info procs sid_start] != "" } {
verbose "Spawning SID"
@@ -117,6 +126,15 @@
exit 1
}
}
+
+ # spawn off the new pty for the inferior process
+ if { [ info exists inferior_pty ] } {
+ spawn -pty
+ global mi_inferior_spawn_id
+ set mi_inferior_spawn_id $spawn_id
+ set mi_inferior_tty_name $spawn_out(slave,name)
+ }
+
set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
@@ -189,6 +207,19 @@
warning "Couldn't set the width to 0."
}
}
+ # If allowing the inferior to have it's own PTY then assign the inferior
+ # it's own terminal device here
+ if { [ info exists inferior_pty ] } {
+ send_gdb "102-interpreter-exec console \"tty $mi_inferior_tty_name\"\n"
+ gdb_expect 10 {
+ -re ".*$mi_gdb_prompt$" {
+ verbose "redirect inferior output to new terminal device."
+ }
+ timeout {
+ warning "Couldn't redirect inferior output." 2
+ }
+ }
+ }
return 0;
}
@@ -516,12 +547,14 @@
return 0
}
-# mi_gdb_test COMMAND PATTERN MESSAGE -- send a command to gdb; test the result.
+# mi_gdb_test COMMAND PATTERN IPATTERN MESSAGE -- send a command to gdb; test the result.
#
# COMMAND is the command to execute, send to GDB with send_gdb. If
# this is the null string no command is sent.
# PATTERN is the pattern to match for a PASS, and must NOT include
# the \r\n sequence immediately before the gdb prompt.
+# IPATTERN is the pattern to match for the inferior's output. This will not
+# produce a PASS if successfull, but will produce a FAIL if unsuccessful.
# MESSAGE is an optional message to be printed. If this is
# omitted, then the pass/fail messages use the command string as the
# message. (If this is the empty string, then sometimes we don't
@@ -538,14 +571,20 @@
global GDB expect_out
upvar timeout timeout
- if [llength $args]>2 then {
+ if { [llength $args] == 3} {
set message [lindex $args 2]
+ } elseif {[llength $args] == 4 } {
+ set message [lindex $args 3]
} else {
set message [lindex $args 0]
}
set command [lindex $args 0]
set pattern [lindex $args 1]
+ if [llength $args]==4 {
+ set ipattern [lindex $args 2]
+ }
+
if [llength $args]==5 {
set question_string [lindex $args 3];
set response_string [lindex $args 4];
@@ -696,6 +735,23 @@
set result 1
}
}
+
+ # if the GDB output matched, compare the inferior output
+ if { $result == 0 } {
+ if [ info exists ipattern ] {
+ global mi_inferior_spawn_id
+ expect {
+ -i $mi_inferior_spawn_id -re "$ipattern" {
+ pass "inferior_output:$message"
+ }
+ timeout {
+ fail "inferior output timeout"
+ set result 1
+ }
+ }
+ }
+ }
+
return $result
}
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-11 19:07 ` Bob Rossi
@ 2005-02-12 3:13 ` Andrew Cagney
2005-02-12 10:59 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2005-02-12 3:13 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb-patches
Bob Rossi wrote:
> On Thu, Feb 10, 2005 at 03:52:08PM -0500, Andrew Cagney wrote:
>
>>>OO, I see, are you saying the mi-* tests will become the new ones, and
>>>the mi2-* are frozen for the mi2-* development cycle?
>>>
>>>In order to do this for only the new tests, I'll have to add a new
>>>parameter to mi_gdb_start to tell it to either open or not open a pty
>>>for the inferior. Hope this will be OK.
>>
>>M'kay.
I've thought hard about this one. I'm ok with the theory in that we
should have a test of GDB against a "pipe" (i.e., something that doesn't
echo). I've reservations about applying it across all tests though.
At present you can look at the log and see the exact interaction as
you'll get when you run that same GDB in a normal terminal. This change
alters that.
Can you post an example log so that we can see what it looks like.
Andrew
> Here is the patch that give's the inferior it's own PTY and only changes
> the mi-* testcase's and not the the mi2-* testcases. Just to mention, it
> will definatly be more complicated to have only the mi-* testcase's use
> the PTY and have the mi2-* not. However, if this is what you want, it is
> possible to do.
>
> Few things to note is that
> - mi_gdb_start now takes an optional parameter. This tells it to have
> the inferior use a tty or not. I could make this parameter not
> optional, and put 'false' everywhere for the mi2-* tests. Is this
> what you want? Sorry, don't know what normal conventions are for
> Tcl programming, since I'm a newbie.
> - mi_gdb_test now takes an IPATTERN parameter, which refer's to the
> pattern the inferior must match if the parameter is present. A
> PASS is given if the output is matched, otherwise a FAIL. So, when
> calling mi_gdb_test, when you give the IPATTERN, 2 PASS's are given
> instead of just 1.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-12 3:13 ` Andrew Cagney
@ 2005-02-12 10:59 ` Bob Rossi
2005-02-15 15:07 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-12 10:59 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]
On Fri, Feb 11, 2005 at 02:34:52PM -0500, Andrew Cagney wrote:
> Bob Rossi wrote:
> >On Thu, Feb 10, 2005 at 03:52:08PM -0500, Andrew Cagney wrote:
> >
> >>>OO, I see, are you saying the mi-* tests will become the new ones, and
> >>>the mi2-* are frozen for the mi2-* development cycle?
> >>>
> >>>In order to do this for only the new tests, I'll have to add a new
> >>>parameter to mi_gdb_start to tell it to either open or not open a pty
> >>>for the inferior. Hope this will be OK.
> >>
> >>M'kay.
>
> I've thought hard about this one. I'm ok with the theory in that we
> should have a test of GDB against a "pipe" (i.e., something that doesn't
> echo). I've reservations about applying it across all tests though.
>
> At present you can look at the log and see the exact interaction as
> you'll get when you run that same GDB in a normal terminal. This change
> alters that.
>
> Can you post an example log so that we can see what it looks like.
Andrew, sorry if you recieved the last Email from me directly.
Sourceware bounced the Email from the GDB list, because it was to large.
For your info, I attached mi-console.exp and mi-syn-frame.exp log
information, because those 2 have the most inferior I/O.
I've attached new_gdb.log and original_gdb.log. I actually modified
new_gdb.log so that the PATH is the same in both. Let me know if this
isn't OK. It does make looking at the diff much simpler.
It's obviously your call on if it's OK to use the new PTY on all the
tests. I kind of prefer it, since at this point, there is no way to
write a reliable front end to GDB without using the PTY. For example,
there's no way to reliably parse the output of GDB when the inferior is
mixing it's output in the same stream. Especially if you are debugging
your own front end to GDB!
Also, there's several other advanatage which I mentioned, including,
- anchoring all the output of the GDB
- anchoring all the output of the Inferior
- parsing the output of GDB to get a syntax check
- later advantages of parsing the output of GDB to use semantically
Let me know what you think. If you want the dbg.log files, I can provide
them.
Thanks,
Bob Rossi
[-- Attachment #2: new_gdb.log --]
[-- Type: text/plain, Size: 13521 bytes --]
Test Run By bob on Fri Feb 11 21:13:45 2005
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../../../src/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running ../../../src/gdb/testsuite/gdb.mi/mi-console.exp ...
~"GNU gdb 6.3.50.20050210-cvs\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"."
~"\n"
(gdb)
100-gdb-set height 0
100^done
(gdb)
101-gdb-set width 0
101^done
(gdb)
102-interpreter-exec console "tty /dev/pts/1"
102^done
(gdb)
Executing on host: gcc ../../../src/gdb/testsuite/gdb.mi/mi-console.c -DFAKEARGV -g -lm -o /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-console (timeout = 300)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
104^done,source-path="$cdir:$cwd"
(gdb)
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-console
~"Using host libthread_db library \"/lib/libthread_db.so.1\".\n"
105^done
(gdb)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
104^done,source-path="$cdir:$cwd"
(gdb)
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-console
105^done
(gdb)
200-break-insert main
200^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x080483ec",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-console.c",line="13",times="0"}
(gdb)
PASS: gdb.mi/mi-console.exp: breakpoint at main
000-exec-run
000^running
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080483ec",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-console.c",line="13"}
(gdb)
PASS: gdb.mi/mi-console.exp: mi runto main
47-exec-next
47^running
(gdb)
PASS: gdb.mi/mi-console.exp: Testing console output
Hello \"!\rPASS: gdb.mi/mi-console.exp: inferior_output:Testing console output
47*stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x080483f1",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-console.c",line="14"}
(gdb)
PASS: gdb.mi/mi-console.exp: Finished step over hello
testcase ../../../src/gdb/testsuite/gdb.mi/mi-console.exp completed in 1 seconds
Running ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.exp ...
Executing on host: gcc ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c -DFAKEARGV -g -lm -o /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-syn-frame (timeout = 300)
~"GNU gdb 6.3.50.20050210-cvs\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"."
~"\n"
(gdb)
100-gdb-set height 0
100^done
(gdb)
101-gdb-set width 0
101^done
(gdb)
102-interpreter-exec console "tty /dev/pts/2"
102^done
(gdb)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
104^done,source-path="$cdir:$cwd"
(gdb)
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-syn-frame
~"Using host libthread_db library \"/lib/libthread_db.so.1\".\n"
105^done
(gdb)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
104^done,source-path="$cdir:$cwd"
(gdb)
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-syn-frame
105^done
(gdb)
200-break-insert main
200^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14",times="0"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: breakpoint at main
000-exec-run
000^running
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048444",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: mi runto main
400-break-insert foo
400^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0804846e",func="foo",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="27",times="0"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 400-break-insert foo
401-data-evaluate-expression foo()
&"The program being debugged stopped while in a function called from GDB.\n"
&"When the function (foo) is done executing, GDB will silently\n"
&"stop (instead of continuing to evaluate the expression containing\n"
&"the function call).\n"
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)."
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: call inferior's function with a breakpoint set in it
402-stack-list-frames
402^done,reason="breakpoint-hit",bkptno="2",thread-id="0",frame={addr="0x0804846e",func="foo",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="27"},stack=[frame={level="0",addr="0x0804846e",func="foo",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="27"},frame={level="1",addr="0x08048370",func="<function called from gdb>"},frame={level="2",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: backtrace from inferior function stopped at bp, showing gdb dummy frame
403-exec-continue
403^running
(gdb)
403*stopped
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: testing exec continue
hi in foo
PASS: gdb.mi/mi-syn-frame.exp: inferior_output:testing exec continue
404-stack-list-frames 0 0
404^done,stack=[frame={level="0",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 404-stack-list-frames 0 0
405-break-insert subroutine
405^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x080484b6",func="subroutine",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="53",times="0"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 405-break-insert subroutine
406-data-evaluate-expression have_a_very_merry_interrupt()
&"The program being debugged stopped while in a function called from GDB.\n"
&"When the function (have_a_very_merry_interrupt) is done executing, GDB will silently\n"
&"stop (instead of continuing to evaluate the expression containing\n"
&"the function call).\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)."
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: data evaluate expression
Waiting to get a signal
PASS: gdb.mi/mi-syn-frame.exp: inferior_output:data evaluate expression
407-stack-list-frames
407^done,reason="breakpoint-hit",bkptno="3",thread-id="0",frame={addr="0x080484b6",func="subroutine",args=[{name="in",value="14"}],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="53"},stack=[frame={level="0",addr="0x080484b6",func="subroutine",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="53"},frame={level="1",addr="0x080484ae",func="handler",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="43"},frame={level="2",addr="0x4006f678",func="<signal handler called>"},frame={level="3",addr="0x400edca5",func="nanosleep",from="/lib/libc.so.6"},frame={level="4",addr="0x400edb0f",func="sleep",from="/lib/libc.so.6"},frame={level="5",addr="0x0804850b",func="have_a_very_merry_interrupt",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="64"},frame={level="6",addr="0x08048370",func="<function called from gdb>"},frame={level="7",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 407-stack-list-frames
408-exec-continue
408^running
(gdb)
408*stopped
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 408-exec-continue
409-stack-list-frames 0 0
409^done,stack=[frame={level="0",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 409-stack-list-frames 0 0
410-data-evaluate-expression bar()
&"The program being debugged was signaled while in a function called from GDB.\n"
&"GDB remains in the frame where the signal was received.\n"
&"To change this behavior use \"set unwindonsignal on\"\n"
&"Evaluation of the expression containing the function (bar) will be abandoned.\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."
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: call inferior function which raises exception
hi in bar
PASS: gdb.mi/mi-syn-frame.exp: inferior_output:call inferior function which raises exception
411-stack-list-frames
411^done,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",thread-id="0",frame={addr="0x08048498",func="bar",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="37"},stack=[frame={level="0",addr="0x08048498",func="bar",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="37"},frame={level="1",addr="0x08048370",func="<function called from gdb>"},frame={level="2",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: backtrace from inferior function at exception
testcase ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.exp completed in 1 seconds
=== gdb Summary ===
# of expected passes 22
Executing on host: /home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../gdb/gdb -nw --command gdb_cmd (timeout = 300)
GNU gdb 6.3.50.20050210-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../gdb/gdb version 6.3.50.20050210-cvs -nx
runtest completed at Fri Feb 11 21:13:47 2005
[-- Attachment #3: original_gdb.log --]
[-- Type: text/plain, Size: 13210 bytes --]
Test Run By bob on Fri Feb 11 21:14:19 2005
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../../../src/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running ../../../src/gdb/testsuite/gdb.mi/mi-console.exp ...
~"GNU gdb 6.3.50.20050210-cvs\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"."
~"\n"
(gdb)
100-gdb-set height 0
100^done
(gdb)
101-gdb-set width 0
101^done
(gdb)
Executing on host: gcc ../../../src/gdb/testsuite/gdb.mi/mi-console.c -DFAKEARGV -g -lm -o /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-console (timeout = 300)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
104^done,source-path="$cdir:$cwd"
(gdb)
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-console
~"Using host libthread_db library \"/lib/libthread_db.so.1\".\n"
105^done
(gdb)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
104^done,source-path="$cdir:$cwd"
(gdb)
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-console
105^done
(gdb)
200-break-insert main
200^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x080483ec",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-console.c",line="13",times="0"}
(gdb)
PASS: gdb.mi/mi-console.exp: breakpoint at main
000-exec-run
000^running
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080483ec",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-console.c",line="13"}
(gdb)
PASS: gdb.mi/mi-console.exp: mi runto main
47-exec-next
47^running
(gdb)
PASS: gdb.mi/mi-console.exp: Started step over hello
HelloKFAIL: gdb.mi/mi-console.exp: Hello message (PRMS: gdb/623)
\"!
47*stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x080483f1",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-console.c",line="14"}
(gdb)
PASS: gdb.mi/mi-console.exp: Finished step over hello
testcase ../../../src/gdb/testsuite/gdb.mi/mi-console.exp completed in 0 seconds
Running ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.exp ...
Executing on host: gcc ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c -DFAKEARGV -g -lm -o /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-syn-frame (timeout = 300)
~"GNU gdb 6.3.50.20050210-cvs\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"."
~"\n"
(gdb)
100-gdb-set height 0
100^done
(gdb)
101-gdb-set width 0
101^done
(gdb)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
104^done,source-path="$cdir:$cwd"
(gdb)
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-syn-frame
~"Using host libthread_db library \"/lib/libthread_db.so.1\".\n"
105^done
(gdb)
102-break-delete
102^done
(gdb)
103-break-list
103^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
104-environment-directory -r
104^done,source-path="$cdir:$cwd"
(gdb)
105-environment-directory ../../../src/gdb/testsuite/gdb.mi
105^done,source-path="/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../../src/gdb/testsuite/gdb.mi:$cdir:$cwd"
(gdb)
105-file-exec-and-symbols /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-syn-frame
105^done
(gdb)
200-break-insert main
200^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14",times="0"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: breakpoint at main
000-exec-run
000^running
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048444",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: mi runto main
400-break-insert foo
400^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0804846e",func="foo",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="27",times="0"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 400-break-insert foo
401-data-evaluate-expression foo()
&"The program being debugged stopped while in a function called from GDB.\n"
&"When the function (foo) is done executing, GDB will silently\n"
&"stop (instead of continuing to evaluate the expression containing\n"
&"the function call).\n"
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)."
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: call inferior's function with a breakpoint set in it
402-stack-list-frames
402^done,reason="breakpoint-hit",bkptno="2",thread-id="0",frame={addr="0x0804846e",func="foo",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="27"},stack=[frame={level="0",addr="0x0804846e",func="foo",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="27"},frame={level="1",addr="0x08048370",func="<function called from gdb>"},frame={level="2",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: backtrace from inferior function stopped at bp, showing gdb dummy frame
403-exec-continue
403^running
(gdb)
hi in foo
403*stopped
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 403-exec-continue
404-stack-list-frames 0 0
404^done,stack=[frame={level="0",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 404-stack-list-frames 0 0
405-break-insert subroutine
405^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x080484b6",func="subroutine",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="53",times="0"}
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 405-break-insert subroutine
406-data-evaluate-expression have_a_very_merry_interrupt()
Waiting to get a signal
&"The program being debugged stopped while in a function called from GDB.\n"
&"When the function (have_a_very_merry_interrupt) is done executing, GDB will silently\n"
&"stop (instead of continuing to evaluate the expression containing\n"
&"the function call).\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)."
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 406-data-evaluate-expression have_a_very_merry_interrupt()
407-stack-list-frames
407^done,reason="breakpoint-hit",bkptno="3",thread-id="0",frame={addr="0x080484b6",func="subroutine",args=[{name="in",value="14"}],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="53"},stack=[frame={level="0",addr="0x080484b6",func="subroutine",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="53"},frame={level="1",addr="0x080484ae",func="handler",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="43"},frame={level="2",addr="0x4006f678",func="<signal handler called>"},frame={level="3",addr="0x400edca5",func="nanosleep",from="/lib/libc.so.6"},frame={level="4",addr="0x400edb0f",func="sleep",from="/lib/libc.so.6"},frame={level="5",addr="0x0804850b",func="have_a_very_merry_interrupt",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="64"},frame={level="6",addr="0x08048370",func="<function called from gdb>"},frame={level="7",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 407-stack-list-frames
408-exec-continue
408^running
(gdb)
408*stopped
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 408-exec-continue
409-stack-list-frames 0 0
409^done,stack=[frame={level="0",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: 409-stack-list-frames 0 0
410-data-evaluate-expression bar()
hi in bar
&"The program being debugged was signaled while in a function called from GDB.\n"
&"GDB remains in the frame where the signal was received.\n"
&"To change this behavior use \"set unwindonsignal on\"\n"
&"Evaluation of the expression containing the function (bar) will be abandoned.\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."
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: call inferior function which raises exception
411-stack-list-frames
411^done,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",thread-id="0",frame={addr="0x08048498",func="bar",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="37"},stack=[frame={level="0",addr="0x08048498",func="bar",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="37"},frame={level="1",addr="0x08048370",func="<function called from gdb>"},frame={level="2",addr="0x08048444",func="main",file="../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: backtrace from inferior function at exception
testcase ../../../src/gdb/testsuite/gdb.mi/mi-syn-frame.exp completed in 2 seconds
=== gdb Summary ===
# of expected passes 18
# of known failures 1
Executing on host: /home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../gdb/gdb -nw --command gdb_cmd (timeout = 300)
GNU gdb 6.3.50.20050210-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
/home/bob/cvs/gdb/original/builddir/gdb/testsuite/../../gdb/gdb version 6.3.50.20050210-cvs -nx
runtest completed at Fri Feb 11 21:14:21 2005
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-12 10:59 ` Bob Rossi
@ 2005-02-15 15:07 ` Bob Rossi
2005-02-16 20:03 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-15 15:07 UTC (permalink / raw)
To: Andrew Cagney, gdb-patches
On Fri, Feb 11, 2005 at 09:19:13PM -0500, Bob Rossi wrote:
> On Fri, Feb 11, 2005 at 02:34:52PM -0500, Andrew Cagney wrote:
> > Bob Rossi wrote:
> > >On Thu, Feb 10, 2005 at 03:52:08PM -0500, Andrew Cagney wrote:
> > >
> > >>>OO, I see, are you saying the mi-* tests will become the new ones, and
> > >>>the mi2-* are frozen for the mi2-* development cycle?
> > >>>
> > >>>In order to do this for only the new tests, I'll have to add a new
> > >>>parameter to mi_gdb_start to tell it to either open or not open a pty
> > >>>for the inferior. Hope this will be OK.
> > >>
> > >>M'kay.
> >
> > I've thought hard about this one. I'm ok with the theory in that we
> > should have a test of GDB against a "pipe" (i.e., something that doesn't
> > echo). I've reservations about applying it across all tests though.
> >
> > At present you can look at the log and see the exact interaction as
> > you'll get when you run that same GDB in a normal terminal. This change
> > alters that.
> >
> > Can you post an example log so that we can see what it looks like.
>
> Andrew, sorry if you recieved the last Email from me directly.
> Sourceware bounced the Email from the GDB list, because it was to large.
> For your info, I attached mi-console.exp and mi-syn-frame.exp log
> information, because those 2 have the most inferior I/O.
>
> I've attached new_gdb.log and original_gdb.log. I actually modified
> new_gdb.log so that the PATH is the same in both. Let me know if this
> isn't OK. It does make looking at the diff much simpler.
>
> It's obviously your call on if it's OK to use the new PTY on all the
> tests. I kind of prefer it, since at this point, there is no way to
> write a reliable front end to GDB without using the PTY. For example,
> there's no way to reliably parse the output of GDB when the inferior is
> mixing it's output in the same stream. Especially if you are debugging
> your own front end to GDB!
>
> Also, there's several other advanatage which I mentioned, including,
> - anchoring all the output of the GDB
> - anchoring all the output of the Inferior
> - parsing the output of GDB to get a syntax check
> - later advantages of parsing the output of GDB to use semantically
>
> Let me know what you think. If you want the dbg.log files, I can provide
> them.
Any headway on this? Need some more info?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-15 15:07 ` Bob Rossi
@ 2005-02-16 20:03 ` Andrew Cagney
2005-02-17 0:28 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2005-02-16 20:03 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
Bob Rossi wrote:
>>Let me know what you think. If you want the dbg.log files, I can provide
>>them.
I was kind of looking for an executive summary :-) I've attached a
trimmed diff.
Two things:
- it should't be using --interpreter console ...
Can you and/or: add a new -mi-tty command (+test, +doco) and use that;
invoke GDB with the --tty=... option. Your call. Either pre-approved
(but get thumbs up from Eli on the doco).
- can the TTY output be identified in someway?
That might make debugging easier, but if it isn't possible I guess we
live with that.
With that, ok.
Andrew
PS: Yes, we need to find a place for explaining how to invoke this.
Looking at the TUI chapter opening there is:
- paragraph stating what TUI is
- paragraph stating how to invoke TUI
MI's chapter should probably do the same.
> Any headway on this? Need some more info?
>
> Thanks,
> Bob Rossi
>
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 776 bytes --]
@@ -41,6 +41,12 @@
(gdb)
+102-interpreter-exec console "tty /dev/pts/1"
+
+102^done
+
+(gdb)
+
Executing on host: gcc ../../../src/gdb/testsuite/gdb.mi/mi-console.c -DFAKEARGV -g -lm -o /home/bob/cvs/gdb/original/builddir/gdb/testsuite/gdb.mi/mi-console (timeout = 300)
102-break-delete
@@ -128,17 +134,15 @@
(gdb)
-PASS: gdb.mi/mi-console.exp: Started step over hello
-HelloKFAIL: gdb.mi/mi-console.exp: Hello message (PRMS: gdb/623)
- \"!
-
-
+PASS: gdb.mi/mi-console.exp: Testing console output
+Hello \"!
+PASS: gdb.mi/mi-console.exp: inferior_output:Testing console output
47*stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x080483f1",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/mi-console.c",line="14"}
(gdb)
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-16 20:03 ` Andrew Cagney
@ 2005-02-17 0:28 ` Bob Rossi
2005-02-17 13:51 ` Daniel Jacobowitz
2005-02-17 16:58 ` Andrew Cagney
0 siblings, 2 replies; 25+ messages in thread
From: Bob Rossi @ 2005-02-17 0:28 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Wed, Feb 16, 2005 at 09:41:56AM -0500, Andrew Cagney wrote:
> Bob Rossi wrote:
>
> >>Let me know what you think. If you want the dbg.log files, I can provide
> >>them.
>
> I was kind of looking for an executive summary :-) I've attached a
> trimmed diff.
>
> Two things:
>
> - it should't be using --interpreter console ...
> Can you and/or: add a new -mi-tty command (+test, +doco) and use that;
> invoke GDB with the --tty=... option. Your call. Either pre-approved
> (but get thumbs up from Eli on the doco).
>
> - can the TTY output be identified in someway?
> That might make debugging easier, but if it isn't possible I guess we
> live with that.
OK, I like this idea a lot. I'll make a new mi function that allows you
to set a tty. I'll also make a new MI function that will allow you to
retrieve the tty device being used, both GDB and the inferior.
Finally, I think it would be helpful to have GDB actually be able to
create a pty for the front end. In case you didn't know, creating a pty
can be a non portable task, and GDB should be capable of doing it every
where it ports to. This would help out the Front Ends a lot. What do you
think? Something like -mi-tty-new -mi-tty-close?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-17 0:28 ` Bob Rossi
@ 2005-02-17 13:51 ` Daniel Jacobowitz
2005-02-17 16:58 ` Andrew Cagney
1 sibling, 0 replies; 25+ messages in thread
From: Daniel Jacobowitz @ 2005-02-17 13:51 UTC (permalink / raw)
To: gdb-patches
On Wed, Feb 16, 2005 at 03:02:05PM -0500, Bob Rossi wrote:
> On Wed, Feb 16, 2005 at 09:41:56AM -0500, Andrew Cagney wrote:
> > Bob Rossi wrote:
> >
> > >>Let me know what you think. If you want the dbg.log files, I can provide
> > >>them.
> >
> > I was kind of looking for an executive summary :-) I've attached a
> > trimmed diff.
> >
> > Two things:
> >
> > - it should't be using --interpreter console ...
> > Can you and/or: add a new -mi-tty command (+test, +doco) and use that;
> > invoke GDB with the --tty=... option. Your call. Either pre-approved
> > (but get thumbs up from Eli on the doco).
> >
> > - can the TTY output be identified in someway?
> > That might make debugging easier, but if it isn't possible I guess we
> > live with that.
>
> OK, I like this idea a lot. I'll make a new mi function that allows you
> to set a tty. I'll also make a new MI function that will allow you to
> retrieve the tty device being used, both GDB and the inferior.
>
> Finally, I think it would be helpful to have GDB actually be able to
> create a pty for the front end. In case you didn't know, creating a pty
> can be a non portable task, and GDB should be capable of doing it every
> where it ports to. This would help out the Front Ends a lot. What do you
> think? Something like -mi-tty-new -mi-tty-close?
Are you sure this is a good idea? Not only is it non-portable, but
there's a lot of alternatives. For instance, the front end probably
wants to create the PTY with its other end pointed somewhere useful,
and in some frontend-private namespace. A text-based front end might
want to connect the PTY to an already running screen session. And so
forth.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-17 0:28 ` Bob Rossi
2005-02-17 13:51 ` Daniel Jacobowitz
@ 2005-02-17 16:58 ` Andrew Cagney
2005-02-17 20:09 ` Alain Magloire
` (3 more replies)
1 sibling, 4 replies; 25+ messages in thread
From: Andrew Cagney @ 2005-02-17 16:58 UTC (permalink / raw)
To: Alain Magloire, Nick Roberts; +Cc: Bob Rossi, gdb-patches
Bob Rossi wrote:
> On Wed, Feb 16, 2005 at 09:41:56AM -0500, Andrew Cagney wrote:
>
>>Bob Rossi wrote:
>>
>>
>>>>Let me know what you think. If you want the dbg.log files, I can provide
>>>>them.
>>
>>I was kind of looking for an executive summary :-) I've attached a
>>trimmed diff.
>>
>>Two things:
>>
>>- it should't be using --interpreter console ...
>>Can you and/or: add a new -mi-tty command (+test, +doco) and use that;
>>invoke GDB with the --tty=... option. Your call. Either pre-approved
>>(but get thumbs up from Eli on the doco).
>>
>>- can the TTY output be identified in someway?
>>That might make debugging easier, but if it isn't possible I guess we
>>live with that.
>
>
> OK, I like this idea a lot. I'll make a new mi function that allows you
> to set a tty. I'll also make a new MI function that will allow you to
> retrieve the tty device being used, both GDB and the inferior.
Ok. Wonder if it should be ``set/show tty'', "tty ..." just a wrapper.
> Finally, I think it would be helpful to have GDB actually be able to
> create a pty for the front end. In case you didn't know, creating a pty
> can be a non portable task, and GDB should be capable of doing it every
> where it ports to. This would help out the Front Ends a lot. What do you
> think? Something like -mi-tty-new -mi-tty-close?
I suspect this is correct.
Alain, how does the CDT currently hande the PTY problem? Would this be
useful?
[Nick, any thoughts]
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-17 16:58 ` Andrew Cagney
@ 2005-02-17 20:09 ` Alain Magloire
[not found] ` <200502171658.LAA02386@smtp.ott.qnx.com>
` (2 subsequent siblings)
3 siblings, 0 replies; 25+ messages in thread
From: Alain Magloire @ 2005-02-17 20:09 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Alain Magloire, Nick Roberts, Bob Rossi, gdb-patches
>
> Bob Rossi wrote:
> > On Wed, Feb 16, 2005 at 09:41:56AM -0500, Andrew Cagney wrote:
> >
> >>Bob Rossi wrote:
> >>
> >>
> >>>>Let me know what you think. If you want the dbg.log files, I can provide
> >>>>them.
> >>
> >>I was kind of looking for an executive summary :-) I've attached a
> >>trimmed diff.
> >>
> >>Two things:
> >>
> >>- it should't be using --interpreter console ...
> >>Can you and/or: add a new -mi-tty command (+test, +doco) and use that;
> >>invoke GDB with the --tty=... option. Your call. Either pre-approved
> >>(but get thumbs up from Eli on the doco).
> >>
> >>- can the TTY output be identified in someway?
> >>That might make debugging easier, but if it isn't possible I guess we
> >>live with that.
> >
> >
> > OK, I like this idea a lot. I'll make a new mi function that allows you
> > to set a tty. I'll also make a new MI function that will allow you to
> > retrieve the tty device being used, both GDB and the inferior.
>
> Ok. Wonder if it should be ``set/show tty'', "tty ..." just a wrapper.
>
> > Finally, I think it would be helpful to have GDB actually be able to
> > create a pty for the front end. In case you didn't know, creating a pty
> > can be a non portable task, and GDB should be capable of doing it every
> > where it ports to. This would help out the Front Ends a lot. What do you
> > think? Something like -mi-tty-new -mi-tty-close?
>
> I suspect this is correct.
>
> Alain, how does the CDT currently hande the PTY problem? Would this be
> useful?
>
Yes, it would be.
The problem comes from local inferior outputs that are intertwine
with MI stream(The remote case is ok since the output is properly
wrap in @"..." steam).
CDT handles this by creating JNI code per platform that
will create a pseudo pty, the slave pty is pass to gdb
gdb --tty /dev/ptys/n app
And the IDE is reading at the other end of the master and
redirecting the outputs to the IDE console widget.
Caveats:
- Not all platform supports pseudo tty, we still have
no solution for Win32/cygwin.
- On some platform like Solaris, because the way the suspend is
implemented, CTRL-C will no longer work.
- When we relaunch/restart, it probably will not work, since
the tty is close by the inferior. (Relaunching is important when you have an
huge executable .. loading the symbols can be a pain).
Now if gdb can create the pty and can give back the master/slave
pty so we can redirect the output to the IDE ... that would be perfect
making the JNI code obsolete.
Sorry, I did not follow Bob's proposals in the mailing list.
So maybe I'm completely of track.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
[not found] ` <200502171658.LAA02386@smtp.ott.qnx.com>
@ 2005-02-18 2:46 ` Bob Rossi
0 siblings, 0 replies; 25+ messages in thread
From: Bob Rossi @ 2005-02-18 2:46 UTC (permalink / raw)
To: Alain Magloire; +Cc: Andrew Cagney, Nick Roberts, gdb-patches
On Thu, Feb 17, 2005 at 11:58:45AM -0500, Alain Magloire wrote:
> >
> > Bob Rossi wrote:
> > > On Wed, Feb 16, 2005 at 09:41:56AM -0500, Andrew Cagney wrote:
> > >
> > >>Bob Rossi wrote:
> > >>
> > >>
> > >>>>Let me know what you think. If you want the dbg.log files, I can provide
> > >>>>them.
> > >>
> > >>I was kind of looking for an executive summary :-) I've attached a
> > >>trimmed diff.
> > >>
> > >>Two things:
> > >>
> > >>- it should't be using --interpreter console ...
> > >>Can you and/or: add a new -mi-tty command (+test, +doco) and use that;
> > >>invoke GDB with the --tty=... option. Your call. Either pre-approved
> > >>(but get thumbs up from Eli on the doco).
> > >>
> > >>- can the TTY output be identified in someway?
> > >>That might make debugging easier, but if it isn't possible I guess we
> > >>live with that.
> > >
> > >
> > > OK, I like this idea a lot. I'll make a new mi function that allows you
> > > to set a tty. I'll also make a new MI function that will allow you to
> > > retrieve the tty device being used, both GDB and the inferior.
> >
> > Ok. Wonder if it should be ``set/show tty'', "tty ..." just a wrapper.
> >
> > > Finally, I think it would be helpful to have GDB actually be able to
> > > create a pty for the front end. In case you didn't know, creating a pty
> > > can be a non portable task, and GDB should be capable of doing it every
> > > where it ports to. This would help out the Front Ends a lot. What do you
> > > think? Something like -mi-tty-new -mi-tty-close?
> >
> > I suspect this is correct.
> >
> > Alain, how does the CDT currently hande the PTY problem? Would this be
> > useful?
> >
>
> Yes, it would be.
> The problem comes from local inferior outputs that are intertwine
> with MI stream(The remote case is ok since the output is properly
> wrap in @"..." steam).
>
> CDT handles this by creating JNI code per platform that
> will create a pseudo pty, the slave pty is pass to gdb
>
> gdb --tty /dev/ptys/n app
>
> And the IDE is reading at the other end of the master and
> redirecting the outputs to the IDE console widget.
Yes, this is similar to what I'm doing for CGDB.
>
>
> Caveats:
>
> - Not all platform supports pseudo tty, we still have
> no solution for Win32/cygwin.
I still did not get GDB on Cygwin to work with the tty command. However,
I did create my own program that opened a pty and spit out the tty
device name and I wrote another program that took that as an argument
and was able to do I/O with the first program. So, I think pty's work
with Cygwin, but for some reason, it doesn't work with GDB on Cygwin.
However, I never looked furthor into it.
At some point, I'll need this to work, so if no one get's there before
me ...
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-17 16:58 ` Andrew Cagney
2005-02-17 20:09 ` Alain Magloire
[not found] ` <200502171658.LAA02386@smtp.ott.qnx.com>
@ 2005-02-18 12:10 ` Nick Roberts
2005-02-18 19:51 ` Bob Rossi
3 siblings, 0 replies; 25+ messages in thread
From: Nick Roberts @ 2005-02-18 12:10 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Alain Magloire, Bob Rossi, gdb-patches
> Alain, how does the CDT currently hande the PTY problem? Would this be
> useful?
>
> [Nick, any thoughts]
I would like to be able to separate the streams in Emacs using MI at some
stage. If that is what these proposed changes would allow, then that would be
useful. However, I don't currently know enough about ptys to be able to
contribute patches.
Nick
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-17 16:58 ` Andrew Cagney
` (2 preceding siblings ...)
2005-02-18 12:10 ` Nick Roberts
@ 2005-02-18 19:51 ` Bob Rossi
2005-02-18 21:05 ` Alain Magloire
3 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-18 19:51 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Alain Magloire, Nick Roberts, gdb-patches
On Thu, Feb 17, 2005 at 09:28:45AM -0500, Andrew Cagney wrote:
> Bob Rossi wrote:
> >On Wed, Feb 16, 2005 at 09:41:56AM -0500, Andrew Cagney wrote:
> >
> >>Bob Rossi wrote:
> >>
> >>
> >>>>Let me know what you think. If you want the dbg.log files, I can provide
> >>>>them.
> >>
> >>I was kind of looking for an executive summary :-) I've attached a
> >>trimmed diff.
> >>
> >>Two things:
> >>
> >>- it should't be using --interpreter console ...
> >>Can you and/or: add a new -mi-tty command (+test, +doco) and use that;
> >>invoke GDB with the --tty=... option. Your call. Either pre-approved
> >>(but get thumbs up from Eli on the doco).
> >>
> >>- can the TTY output be identified in someway?
> >>That might make debugging easier, but if it isn't possible I guess we
> >>live with that.
> >
> >
> >OK, I like this idea a lot. I'll make a new mi function that allows you
> >to set a tty. I'll also make a new MI function that will allow you to
> >retrieve the tty device being used, both GDB and the inferior.
>
> Ok. Wonder if it should be ``set/show tty'', "tty ..." just a wrapper.
Ok, I'm going to implement this before even thinking about anything
else. Do you care what file the -mi-tty command's go in? or should I
create a new file?
Also, is there an easy way to use the set/show internally to GDB? This
way, as you suggessted, there will be 3 ways to access the inferior's
tty device name.
- through the MI commands
- through the set/show
- and you can only set the tty through the 'tty' console command
there is no way to get the name. This should probably be
depricated ...
Internally, they should all use the same data, so, is there an
interface to modify the set/show value internally to GDB?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-18 19:51 ` Bob Rossi
@ 2005-02-18 21:05 ` Alain Magloire
2005-02-19 23:51 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Alain Magloire @ 2005-02-18 21:05 UTC (permalink / raw)
To: Bob Rossi; +Cc: Andrew Cagney, Alain Magloire, Nick Roberts, gdb-patches
> >
> > Ok. Wonder if it should be ``set/show tty'', "tty ..." just a wrapper.
>
> Ok, I'm going to implement this before even thinking about anything
> else. Do you care what file the -mi-tty command's go in? or should I
> create a new file?
>
> Also, is there an easy way to use the set/show internally to GDB? This
> way, as you suggessted, there will be 3 ways to access the inferior's
> tty device name.
>
> - through the MI commands
> - through the set/show
> - and you can only set the tty through the 'tty' console command
> there is no way to get the name. This should probably be
> depricated ...
>
> Internally, they should all use the same data, so, is there an
> interface to modify the set/show value internally to GDB?
>
Bob,
I did not see the original of your proposal, so ..
Am I correct to assume that the "show" tty will print the master side
and not the slave or vice versa ...
Meaning the frontends are interested in the other side of the pipe
not the tty given by gdb to the inferior.
--
au revoir, alain
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-18 21:05 ` Alain Magloire
@ 2005-02-19 23:51 ` Bob Rossi
2005-02-21 2:12 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-02-19 23:51 UTC (permalink / raw)
To: Alain Magloire; +Cc: Andrew Cagney, Nick Roberts, gdb-patches
On Fri, Feb 18, 2005 at 02:27:24PM -0500, Alain Magloire wrote:
> > >
> > > Ok. Wonder if it should be ``set/show tty'', "tty ..." just a wrapper.
> >
> > Ok, I'm going to implement this before even thinking about anything
> > else. Do you care what file the -mi-tty command's go in? or should I
> > create a new file?
> >
> > Also, is there an easy way to use the set/show internally to GDB? This
> > way, as you suggessted, there will be 3 ways to access the inferior's
> > tty device name.
> >
> > - through the MI commands
> > - through the set/show
> > - and you can only set the tty through the 'tty' console command
> > there is no way to get the name. This should probably be
> > depricated ...
> >
> > Internally, they should all use the same data, so, is there an
> > interface to modify the set/show value internally to GDB?
> >
>
> Bob,
> I did not see the original of your proposal, so ..
> Am I correct to assume that the "show" tty will print the master side
> and not the slave or vice versa ...
> Meaning the frontends are interested in the other side of the pipe
> not the tty given by gdb to the inferior.
Hi Alain,
There are 2 different ideas being suggested,
- To create an mi command, that does the same thing as the console
'tty' command, and each of these internally can be wrappers around
some data that can be accessed with GDB's set/show mechanism. For
example,
-mi-set-tty /dev/pts/1 (mi command)
tty /dev/pts/1 (console command)
set tty /dev/pts/1 (set command)
- The second idea was to have GDB internally create a pty. That would
result in a master and slave side. Neither of these are important,
AFAIK, only the slavename (file name of the terminal created,
ie. /dev/pts/1) is important. For example, here is what could
happen
1. The user asks GDB to open a new pty and the name is given back
-mi-create-pty
/dev/pts/1
2. The user asks GDB to use that pty for the inferior
-mi-set-tty /dev/pts/1
3. The user opens /dev/pts/1 in there own program to read the
output of the inferior.
4. The user asks GDB to close the device
-mi-destroy-pty /dev/pts/1
Either way, it will probably be a while before I have time to work on
the second task, since I'm already swamped trying to validate the MI
testsuite with a syntax checker and changing the grammar to match
what GDB actually outputs.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-19 23:51 ` Bob Rossi
@ 2005-02-21 2:12 ` Andrew Cagney
2005-02-22 23:24 ` Alain Magloire
[not found] ` <200502221635.LAA07270@smtp.ott.qnx.com>
0 siblings, 2 replies; 25+ messages in thread
From: Andrew Cagney @ 2005-02-21 2:12 UTC (permalink / raw)
To: Bob Rossi; +Cc: Alain Magloire, Nick Roberts, gdb-patches
Bob Rossi wrote:
> On Fri, Feb 18, 2005 at 02:27:24PM -0500, Alain Magloire wrote:
>
>>>>Ok. Wonder if it should be ``set/show tty'', "tty ..." just a wrapper.
>>>
>>>Ok, I'm going to implement this before even thinking about anything
>>>else. Do you care what file the -mi-tty command's go in? or should I
>>>create a new file?
>>>
>>>Also, is there an easy way to use the set/show internally to GDB? This
>>>way, as you suggessted, there will be 3 ways to access the inferior's
>>>tty device name.
>>>
>>> - through the MI commands
>>> - through the set/show
>>> - and you can only set the tty through the 'tty' console command
>>> there is no way to get the name. This should probably be
>>> depricated ...
>>>
>>>Internally, they should all use the same data, so, is there an
>>>interface to modify the set/show value internally to GDB?
>>>
>>
>>Bob,
>> I did not see the original of your proposal, so ..
>>Am I correct to assume that the "show" tty will print the master side
>>and not the slave or vice versa ...
>>Meaning the frontends are interested in the other side of the pipe
>>not the tty given by gdb to the inferior.
>
>
> Hi Alain,
>
> There are 2 different ideas being suggested,
> - To create an mi command, that does the same thing as the console
> 'tty' command, and each of these internally can be wrappers around
> some data that can be accessed with GDB's set/show mechanism. For
> example,
> -mi-set-tty /dev/pts/1 (mi command)
> tty /dev/pts/1 (console command)
> set tty /dev/pts/1 (set command)
and I belive:
set tty
I need to confirm it but it appears that there's an ``optional
filename'' class of variable (grep for filename_completer in the sources).
If the last is implemented, an existing MI command should already let
you set/show the variable.
> - The second idea was to have GDB internally create a pty. That would
> result in a master and slave side. Neither of these are important,
> AFAIK, only the slavename (file name of the terminal created,
> ie. /dev/pts/1) is important. For example, here is what could
> happen
> 1. The user asks GDB to open a new pty and the name is given back
> -mi-create-pty
> /dev/pts/1
> 2. The user asks GDB to use that pty for the inferior
> -mi-set-tty /dev/pts/1
> 3. The user opens /dev/pts/1 in there own program to read the
> output of the inferior.
> 4. The user asks GDB to close the device
> -mi-destroy-pty /dev/pts/1
>
> Either way, it will probably be a while before I have time to work on
> the second task, since I'm already swamped trying to validate the MI
> testsuite with a syntax checker and changing the grammar to match
> what GDB actually outputs.
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-02-21 2:12 ` Andrew Cagney
@ 2005-02-22 23:24 ` Alain Magloire
[not found] ` <200502221635.LAA07270@smtp.ott.qnx.com>
1 sibling, 0 replies; 25+ messages in thread
From: Alain Magloire @ 2005-02-22 23:24 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Bob Rossi, Alain Magloire, Nick Roberts, gdb-patches
> > Hi Alain,
> >
Bonjour,
> > There are 2 different ideas being suggested,
> > - To create an mi command, that does the same thing as the console
> > 'tty' command, and each of these internally can be wrappers around
> > some data that can be accessed with GDB's set/show mechanism. For
> > example,
> > -mi-set-tty /dev/pts/1 (mi command)
> > tty /dev/pts/1 (console command)
> > set tty /dev/pts/1 (set command)
>
> and I belive:
> set tty
> I need to confirm it but it appears that there's an ``optional
> filename'' class of variable (grep for filename_completer in the sources).
>
> If the last is implemented, an existing MI command should already let
> you set/show the variable.
Ok, so far.
> > - The second idea was to have GDB internally create a pty. That would
> > result in a master and slave side. Neither of these are important,
> > AFAIK, only the slavename (file name of the terminal created,
> > ie. /dev/pts/1) is important. For example, here is what could
> > happen
> > 1. The user asks GDB to open a new pty and the name is given back
> > -mi-create-pty
> > /dev/pts/1
> > 2. The user asks GDB to use that pty for the inferior
> > -mi-set-tty /dev/pts/1
> > 3. The user opens /dev/pts/1 in there own program to read the
> > output of the inferior.
> > 4. The user asks GDB to close the device
> > -mi-destroy-pty /dev/pts/1
> >
> > Either way, it will probably be a while before I have time to work on
> > the second task, since I'm already swamped trying to validate the MI
> > testsuite with a syntax checker and changing the grammar to match
> > what GDB actually outputs.
This is not clear to me ... one more scenario so you can see
from my point of view 8-)
As you pointed out, when creating the pseudo pty
we have a master and slave side and both should be important :
(gdb) -mi-create-pty
^done,pty={master="/dev/ptyp0",slave="/dev/ptyTf"}
(gdb)
The master is given to gdb to set std{in,out,err} of the inferior after forking
(gdb) -mi-set-tty /dev/ptyp0
^done
(gdb) -exec-run
^running
And the slave is use internally by the front end to read/write when
communicating with the inferior.
TTY is good for a few things:
- allow to separate the inferior stream from the mi protocol
- some programs need a real pty to work i.e. passwd, ...
- correct behaviour of buffering, stdio will be line buffer
we have a lot of PR from folks asking after doing a next on
printf("print this\n");
why is the pring not showing up.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
[not found] ` <200502221635.LAA07270@smtp.ott.qnx.com>
@ 2005-03-01 2:40 ` Bob Rossi
2005-03-01 15:14 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-03-01 2:40 UTC (permalink / raw)
To: Alain Magloire; +Cc: Andrew Cagney, Nick Roberts, gdb-patches
> > > - The second idea was to have GDB internally create a pty. That would
> > > result in a master and slave side. Neither of these are important,
> > > AFAIK, only the slavename (file name of the terminal created,
> > > ie. /dev/pts/1) is important. For example, here is what could
> > > happen
> > > 1. The user asks GDB to open a new pty and the name is given back
> > > -mi-create-pty
> > > /dev/pts/1
> > > 2. The user asks GDB to use that pty for the inferior
> > > -mi-set-tty /dev/pts/1
> > > 3. The user opens /dev/pts/1 in there own program to read the
> > > output of the inferior.
> > > 4. The user asks GDB to close the device
> > > -mi-destroy-pty /dev/pts/1
> > >
> > > Either way, it will probably be a while before I have time to work on
> > > the second task, since I'm already swamped trying to validate the MI
> > > testsuite with a syntax checker and changing the grammar to match
> > > what GDB actually outputs.
>
> This is not clear to me ... one more scenario so you can see
> from my point of view 8-)
>
> As you pointed out, when creating the pseudo pty
> we have a master and slave side and both should be important :
> (gdb) -mi-create-pty
> ^done,pty={master="/dev/ptyp0",slave="/dev/ptyTf"}
> (gdb)
>
> The master is given to gdb to set std{in,out,err} of the inferior after forking
> (gdb) -mi-set-tty /dev/ptyp0
> ^done
> (gdb) -exec-run
> ^running
I didn't even know you could get a device name for the master side. If
you have the master fd, you can get the slave name via ptsname, how do
you get the master device name?
> And the slave is use internally by the front end to read/write when
> communicating with the inferior.
I have been giving GDB the slave name for the inferior program. Then I
also internally read/write using the slave name. Is this wrong? Why are
we using different methods?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-03-01 2:40 ` Bob Rossi
@ 2005-03-01 15:14 ` Bob Rossi
2005-03-01 19:24 ` Alain Magloire
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2005-03-01 15:14 UTC (permalink / raw)
To: Alain Magloire, Andrew Cagney, Nick Roberts, gdb-patches
On Mon, Feb 28, 2005 at 09:40:37PM -0500, Bob Rossi wrote:
> > > > - The second idea was to have GDB internally create a pty. That would
> > > > result in a master and slave side. Neither of these are important,
> > > > AFAIK, only the slavename (file name of the terminal created,
> > > > ie. /dev/pts/1) is important. For example, here is what could
> > > > happen
> > > > 1. The user asks GDB to open a new pty and the name is given back
> > > > -mi-create-pty
> > > > /dev/pts/1
> > > > 2. The user asks GDB to use that pty for the inferior
> > > > -mi-set-tty /dev/pts/1
> > > > 3. The user opens /dev/pts/1 in there own program to read the
> > > > output of the inferior.
> > > > 4. The user asks GDB to close the device
> > > > -mi-destroy-pty /dev/pts/1
> > > >
> > > > Either way, it will probably be a while before I have time to work on
> > > > the second task, since I'm already swamped trying to validate the MI
> > > > testsuite with a syntax checker and changing the grammar to match
> > > > what GDB actually outputs.
> >
> > This is not clear to me ... one more scenario so you can see
> > from my point of view 8-)
> >
> > As you pointed out, when creating the pseudo pty
> > we have a master and slave side and both should be important :
> > (gdb) -mi-create-pty
> > ^done,pty={master="/dev/ptyp0",slave="/dev/ptyTf"}
> > (gdb)
> >
> > The master is given to gdb to set std{in,out,err} of the inferior after forking
> > (gdb) -mi-set-tty /dev/ptyp0
> > ^done
> > (gdb) -exec-run
> > ^running
>
> I didn't even know you could get a device name for the master side. If
> you have the master fd, you can get the slave name via ptsname, how do
> you get the master device name?
>
> > And the slave is use internally by the front end to read/write when
> > communicating with the inferior.
>
> I have been giving GDB the slave name for the inferior program. Then I
> also internally read/write using the slave name. Is this wrong? Why are
> we using different methods?
Please forgive me, I re-thought this.
I get a master fd, a slave fd and a slave device name when I open a new
pty. I give the slavename to GDB to initialize the inferior. Then, I
read/write from the master fd. Thus, using both sides of the pty.
I don't know how to get the master device name, is this possible?
One problem is, you give the master device name to GDB for the inferior,
I give the slave device name. So, we are using the terminal device in
different directions from the inferior's point of view. This is probably
not OK. Any ideas or opinion on this?
For instance, I think the terminal semantics is between the slave side and
the process (inferior) talking to the slave. I think that if the inferior did a
terminal operation on the slave side, things would act differently than
if it did a terminal operation on the master side. Or a different
example, if you send '^u' as the inferior, to the slave side of a pty,
then I would expect all data on the line to be erased, and data would start
again at the beggining of the line. However, if the inferior was
attached to the master side of the pty, I wouldn't expect this to work.
Am I confused here?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: MI testsuite improvements
2005-03-01 15:14 ` Bob Rossi
@ 2005-03-01 19:24 ` Alain Magloire
0 siblings, 0 replies; 25+ messages in thread
From: Alain Magloire @ 2005-03-01 19:24 UTC (permalink / raw)
To: Bob Rossi; +Cc: Alain Magloire, Andrew Cagney, Nick Roberts, gdb-patches
>
> On Mon, Feb 28, 2005 at 09:40:37PM -0500, Bob Rossi wrote:
> > > > > - The second idea was to have GDB internally create a pty. That would
> > > > > result in a master and slave side. Neither of these are important,
> > > > > AFAIK, only the slavename (file name of the terminal created,
> > > > > ie. /dev/pts/1) is important. For example, here is what could
> > > > > happen
> > > > > 1. The user asks GDB to open a new pty and the name is given back
> > > > > -mi-create-pty
> > > > > /dev/pts/1
> > > > > 2. The user asks GDB to use that pty for the inferior
> > > > > -mi-set-tty /dev/pts/1
> > > > > 3. The user opens /dev/pts/1 in there own program to read the
> > > > > output of the inferior.
> > > > > 4. The user asks GDB to close the device
> > > > > -mi-destroy-pty /dev/pts/1
> > > > >
> > > > > Either way, it will probably be a while before I have time to work on
> > > > > the second task, since I'm already swamped trying to validate the MI
> > > > > testsuite with a syntax checker and changing the grammar to match
> > > > > what GDB actually outputs.
> > >
> > > This is not clear to me ... one more scenario so you can see
> > > from my point of view 8-)
> > >
> > > As you pointed out, when creating the pseudo pty
> > > we have a master and slave side and both should be important :
> > > (gdb) -mi-create-pty
> > > ^done,pty={master="/dev/ptyp0",slave="/dev/ptyTf"}
> > > (gdb)
> > >
> > > The master is given to gdb to set std{in,out,err} of the inferior after forking
> > > (gdb) -mi-set-tty /dev/ptyp0
> > > ^done
> > > (gdb) -exec-run
> > > ^running
> >
> > I didn't even know you could get a device name for the master side. If
> > you have the master fd, you can get the slave name via ptsname, how do
> > you get the master device name?
> >
> > > And the slave is use internally by the front end to read/write when
> > > communicating with the inferior.
> >
> > I have been giving GDB the slave name for the inferior program. Then I
> > also internally read/write using the slave name. Is this wrong? Why are
> > we using different methods?
>
> Please forgive me, I re-thought this.
>
> I get a master fd, a slave fd and a slave device name when I open a new
> pty. I give the slavename to GDB to initialize the inferior. Then, I
> read/write from the master fd. Thus, using both sides of the pty.
>
> I don't know how to get the master device name, is this possible?
>
sigh ... I think it is platform dependent.
For BSD style, it used to be
master: /dev/ptyXY
slave: /dev/ttyXY
meaning the same name except 'p' was change to 't'.
There is a ttyname(3c) but I do not think it works as expected i.e.
it will not return the master name if you do:
ttyname(fd_master);
> One problem is, you give the master device name to GDB for the inferior,
> I give the slave device name. So, we are using the terminal device in
> different directions from the inferior's point of view. This is probably
> not OK. Any ideas or opinion on this?
>
Sorry my confusion, I give gdb the slave pty.
> For instance, I think the terminal semantics is between the slave side and
> the process (inferior) talking to the slave. I think that if the inferior did a
> terminal operation on the slave side, things would act differently than
> if it did a terminal operation on the master side. Or a different
> example, if you send '^u' as the inferior, to the slave side of a pty,
> then I would expect all data on the line to be erased, and data would start
> again at the beggining of the line. However, if the inferior was
> attached to the master side of the pty, I wouldn't expect this to work.
>
> Am I confused here?
>
No.
But even if you do not get the master pty name, this is still usefull for a few reason:
- some programs need, to work correctly, a tty as the input.
- since gdb knows when an output comes from the inferior, you could
wrap any reads coming from the master_fd in an MI Target Stream
* TARGET-STREAM-OUTPUT is the output produced by the target program.
All the target output is prefixed by `@'.
@"Hello worl\n"
This will still help the frontend, one of the major problem, was inferior
outputs were mixed with normal mi outputs.
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2005-03-01 19:24 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-10 15:43 MI testsuite improvements Bob Rossi
2005-02-10 17:43 ` Andrew Cagney
2005-02-10 18:16 ` Bob Rossi
2005-02-10 19:58 ` Andrew Cagney
2005-02-10 23:34 ` Bob Rossi
2005-02-11 4:01 ` Andrew Cagney
2005-02-11 19:07 ` Bob Rossi
2005-02-12 3:13 ` Andrew Cagney
2005-02-12 10:59 ` Bob Rossi
2005-02-15 15:07 ` Bob Rossi
2005-02-16 20:03 ` Andrew Cagney
2005-02-17 0:28 ` Bob Rossi
2005-02-17 13:51 ` Daniel Jacobowitz
2005-02-17 16:58 ` Andrew Cagney
2005-02-17 20:09 ` Alain Magloire
[not found] ` <200502171658.LAA02386@smtp.ott.qnx.com>
2005-02-18 2:46 ` Bob Rossi
2005-02-18 12:10 ` Nick Roberts
2005-02-18 19:51 ` Bob Rossi
2005-02-18 21:05 ` Alain Magloire
2005-02-19 23:51 ` Bob Rossi
2005-02-21 2:12 ` Andrew Cagney
2005-02-22 23:24 ` Alain Magloire
[not found] ` <200502221635.LAA07270@smtp.ott.qnx.com>
2005-03-01 2:40 ` Bob Rossi
2005-03-01 15:14 ` Bob Rossi
2005-03-01 19:24 ` Alain Magloire
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox