This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] fix gdbserver test with non-stop
- From: Yao Qi <yao at codesourcery dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>
- Date: Wed, 29 May 2013 10:23:51 +0800
- Subject: Re: [PATCH] fix gdbserver test with non-stop
- References: <CANFwon1f6tTq9wHm9Th=dvKjcJ_UG6px=LJmDi-J6G8rws4yEA at mail dot gmail dot com>
On 05/28/2013 10:14 AM, Hui Zhu wrote:
This bug is because handler inside gdb_target_cmd handle the non-stop
output not very well.
Yes, in non-stop mode, there might be some output after gdb_prompt,
which makes troubles on pattern matching. We can see the patterns in
proc gdb_target_cmd,
-re "Remote debugging using .*$serialport_re.*$gdb_prompt $" {
verbose "Set target to $targetname"
return 0
}
-re "Remote debugging using stdio.*$gdb_prompt $" {
verbose "Set target to $targetname"
return 0
}
it is expected that gdb_prompt appear at the end of the output, but that
is not true in non-stop. In some test, such as
gdb.serversolib-list.exp, the trailing "$" is removed from the pattern, like
set test "target $gdbserver_protocol"
gdb_test_multiple "target $gdbserver_protocol $gdbserver_gdbport"
$test {
-re "Remote debugging using .*\r\n$gdb_prompt " {
# Do not anchor end, there may be more output in non-stop mode.
pass $test
}
}
I am not sure we can apply this trick to 'proc gdb_target_cmd'. I did
that in patch
[PATCH 11/15] Don't check $ after gdb_prompt.
http://sourceware.org/ml/gdb-patches/2012-04/msg00291.html
Doug expressed some concerns on this approach. The conclusion of the
discuss was that 1) I finally drop this patch from my patch series,
because it is not related much, 2) there are some inconsistencies on
using "gdb_prompt " vs "gdb_prompt" vs "gdb_prompt $" :)
Post a patch for it.
I have no comments on it, because I am not confident to say your patch
is right, but I don't have a proof that your patch is wrong.
--
Yao (éå)