This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 11/15] Don't check $ after gdb_prompt.
On 04/17/2012 09:38 AM, Doug Evans wrote:
> My concern is that going down this road, handling each such failure in
> isolation, is going to result in a lot of changes that aren't as
> maintainable as they could be. Patch 11/15 isn't ok as is because it
> ignores the stdio case (I guess it's possible that the problem doesn't
> occur in the stdio case situation, but that just reinforces my general
> concern - how many more cases are we going to need of handling both
> "$gdb_prompt $" and "$gdb_prompt "? So I'd like to understand *why*
> removing the $ fixes things).
That is fine to me to throw patch 11/15 out of this series.
I am not sure I read your question correctly. I'll try to answer your
question (why removing the $ fixes things) as much as I can. First of
all, removing the $ is not the right or perfect fix, although it can fix
the fails.
In current gdbserver-support.exp:gdb_target_cmd {}, it is expected to
match "Remote debugging using .*$serialport_re.*$gdb_prompt $".
However, when turning non-stop on, after printing "Remote debugging
using XXXX", the gdb prompt is printed with an extra char `^M' like this,
Remote debugging using localhost:2346
....
[New Thread 7454]
(gdb) ^M
[Thread 7454] #1 stopped.
The output here doesn't match the regexp above because of that extra `^M'.
Once we remove $ from that regexp, then output matches it. Again, I
don't believe removing $ is the right fix, just explain why fails
disappear after that.
--
Yao (éå)