This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] PR 15075 dprintf interferes with "next"
- From: Yao Qi <yao at codesourcery dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: Pedro Alves <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>, <gdb-patches at sourceware dot org>, Keith Seitz <keiths at redhat dot com>
- Date: Tue, 28 May 2013 11:36:27 +0800
- Subject: Re: [RFC] PR 15075 dprintf interferes with "next"
- References: <1361192891-29341-1-git-send-email-yao at codesourcery dot com> <8738wpd3qe dot fsf at fleche dot redhat dot com> <CANFwon3DymreN3ost7ZSrd0deb_sBC6YTzk1fpv8k+7d0ADnLg at mail dot gmail dot com> <5176C14B dot 6010603 at redhat dot com> <CANFwon1tTZTVcn7ieP5=HnPy+2hCKP1my-UE1-Xosp=Q6WrGug at mail dot gmail dot com> <51774714 dot 9060306 at codesourcery dot com> <CANFwon2Q_=++=WbZD25Ch6qnRtpmuVBOsmkqhevyMAnM3y+ZZA at mail dot gmail dot com> <CANFwon0A4wmgEuREeQHYfRWMfn_cct6dHCZ6_oFH+wVr1Wym4A at mail dot gmail dot com> <51969A92 dot 80003 at redhat dot com> <CANFwon3OaNBrvw4jwv_RJ8ws+SVx9NctfTw2FSDVowaxAmgF9Q at mail dot gmail dot com> <519CBE2B dot 7060007 at redhat dot com> <CANFwon0-r4ozDwZ5Av_3Uv_r=FFG4QFRs79-9+g1s0SxjMbUSg at mail dot gmail dot com>
On 05/28/2013 08:01 AM, Hui Zhu wrote:
+gdb_test_multiple $test $test {
>>+ -re "interrupt\r\n$gdb_prompt " {
>>+ pass $test
>>+ }
>>+}
>>+
>>+set test "inferior stopped"
>>+gdb_test_multiple "" $test {
>>+ -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n" {
>>+ pass $test
>>+ }
>>+}
>
>This leaves the prompt in the expect buffer. I think
>this is likely to confuse the following test that runs.
>
After change this part to:
gdb_test_multiple "" $test {
-re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n$gdb_prompt" {
pass $test
}
}
I got:
Running ../../../src/gdb/testsuite/gdb.base/dprintf-non-stop.exp ...
FAIL: gdb.base/dprintf-non-stop.exp: inferior stopped (timeout)
because the gdb_prompt has been consumed by the previous matching:
gdb_test_multiple $test $test {
-re "interrupt\r\n$gdb_prompt " {
^^^^^^^^^^^^
pass $test
}
}
+set test "interrupt"
+gdb_test_multiple $test $test {
+ -re "interrupt\r\n$gdb_prompt " {
+ pass $test
+ }
+}
+
+set test "inferior stopped"
+gdb_test_multiple "" $test {
+ -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n" {
+ pass $test
+ }
+}
I raise a question here that no one asked before, why don't combine
these two gdb_test_multiple into one? like:
set test "interrupt inferior"
gdb_test_multiple "interrupt" $test {
-re "interrupt\r\n.*\\\[.* \[0-9\]+\\\] #1 stopped\\\." {
pass $test
}
}
--
Yao (éå)