This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Tue, Apr 17, 2012 at 1:39 AM, Yao Qi <yao@codesourcery.com> wrote:
> 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.

Ah.
It's not just the ^M, it's everything after that as well ("[Thread ...").

I don't want to add work to this patch set, but to me this just fixes
one example of a much larger problem, and I'm uncomfortable with going
down the road that this patch establishes.

As a sanity check, are you running with "target-async on"?
I wouldn't expect non-stop mode to result in anything being printed
after the prompt.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]