[PATCH 11/15] Don't check $ after gdb_prompt.

Doug Evans dje@google.com
Tue Apr 17 01:56:00 GMT 2012


On Mon, Apr 16, 2012 at 5:54 PM, Yao Qi <yao@codesourcery.com> wrote:
> On 04/17/2012 01:54 AM, Doug Evans wrote:
>> I tried to recreate the problem in cvs head so that I could better
>> understand the issue myself, but I can't recreate it, I see a
>> different problem: gdb hangs after doing "target remote ...".
>> Dejagnu then sends a ^c and tries "target remote ..." again but by
>> this time gdbserver has detected the EOF and exits.
>
> That is the same problem or the same cause of problems.
>
> in testsuite/lib/gdbserver-support.exp:proc gdb_target_cmd {}, if the
> output doesn't match any of "-re", it will send "^C" to GDB because of
> timeout.
>
>        send_gdb "target $targetname $serialport\n"
>        gdb_expect 60 {
>           -re ....
>            }
>            timeout {
>                send_gdb "^C"
>                break
>            }

Ah, I was hoping I could get away with not having to apply all the
patches (1-10).
[I'm assuming they're needed to fix what I see.]
Oh well.

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).

[for reference sake]
grepping the testsuite, I found 119 cases of 'gdb_prompt "', 2795
cases of 'gdb_prompt $"', and 87 cases of 'gdb_prompt"'.  IWBN to have
a bit more consistency (but we don't have to do that today of course
:-)).

Also, IWBN to change the ^C to \003, easier to grep for and seems to
be reasonably common (but that doesn't have to be done today either).



More information about the Gdb-patches mailing list