* [PATCH] remote target interrupt before ack
@ 2011-04-04 20:00 Michael Walle
2011-04-04 20:21 ` Pedro Alves
0 siblings, 1 reply; 6+ messages in thread
From: Michael Walle @ 2011-04-04 20:00 UTC (permalink / raw)
To: gdb-patches
Hi,
the following patch puts the sending of the interrupt/break sequence before
the proforma ACK. This guarantees the ACK won't be delivered to an application
on the remote side.
--- remote.c.orig 2011-04-03 22:01:56.000000000 +0200
+++ remote.c 2011-04-03 22:02:02.000000000 +0200
@@ -2948,12 +2948,12 @@
immediate_quit++; /* Allow user to interrupt it. */
- /* Ack any packet which the remote side has already sent. */
- serial_write (remote_desc, "+", 1);
-
if (interrupt_on_connect)
send_interrupt_sequence ();
+ /* Ack any packet which the remote side has already sent. */
+ serial_write (remote_desc, "+", 1);
+
/* The first packet we send to the target is the optional "supported
packets" request. If the target can answer this, it will tell us
which later probes to skip. */
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] remote target interrupt before ack
2011-04-04 20:00 [PATCH] remote target interrupt before ack Michael Walle
@ 2011-04-04 20:21 ` Pedro Alves
2011-04-04 20:38 ` Michael Walle
0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2011-04-04 20:21 UTC (permalink / raw)
To: gdb-patches; +Cc: Michael Walle
On Monday 04 April 2011 21:00:15, Michael Walle wrote:
> Hi,
>
> the following patch puts the sending of the interrupt/break sequence before
> the proforma ACK. This guarantees the ACK won't be delivered to an application
> on the remote side.
Can you explain what the latter sentence means a bit better?
--
Pedro Alves
>
>
> --- remote.c.orig 2011-04-03 22:01:56.000000000 +0200
> +++ remote.c 2011-04-03 22:02:02.000000000 +0200
> @@ -2948,12 +2948,12 @@
>
> immediate_quit++; /* Allow user to interrupt it. */
>
> - /* Ack any packet which the remote side has already sent. */
> - serial_write (remote_desc, "+", 1);
> -
> if (interrupt_on_connect)
> send_interrupt_sequence ();
>
> + /* Ack any packet which the remote side has already sent. */
> + serial_write (remote_desc, "+", 1);
> +
> /* The first packet we send to the target is the optional "supported
> packets" request. If the target can answer this, it will tell us
> which later probes to skip. */
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remote target interrupt before ack
2011-04-04 20:21 ` Pedro Alves
@ 2011-04-04 20:38 ` Michael Walle
2011-04-05 16:10 ` Pedro Alves
0 siblings, 1 reply; 6+ messages in thread
From: Michael Walle @ 2011-04-04 20:38 UTC (permalink / raw)
To: gdb-patches; +Cc: Pedro Alves
Am Montag 04 April 2011, 22:21:21 schrieb Pedro Alves:
> On Monday 04 April 2011 21:00:15, Michael Walle wrote:
> > Hi,
> >
> > the following patch puts the sending of the interrupt/break sequence
> > before the proforma ACK. This guarantees the ACK won't be delivered to
> > an application on the remote side.
>
> Can you explain what the latter sentence means a bit better?
>
Oh, i forgot to mention that this bug affects serial lines which are shared
with the GDB stub. Assume the remote needs a BREAK to start its gdb stub. If
you send the '+' before the BREAK it will be delivered to the actual
application running on the device (and of course listening on the serial
port). [If there happens to be some echo service things will even go worse,
because the echoed '+' will be interpreted by GDB as an ACK to the first sent
packet.]
--
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remote target interrupt before ack
2011-04-04 20:38 ` Michael Walle
@ 2011-04-05 16:10 ` Pedro Alves
2011-04-26 11:01 ` Michael Walle
0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2011-04-05 16:10 UTC (permalink / raw)
To: gdb-patches; +Cc: Michael Walle
On Monday 04 April 2011 21:38:32, Michael Walle wrote:
> Am Montag 04 April 2011, 22:21:21 schrieb Pedro Alves:
> > On Monday 04 April 2011 21:00:15, Michael Walle wrote:
> > > the following patch puts the sending of the interrupt/break sequence
> > > before the proforma ACK. This guarantees the ACK won't be delivered to
> > > an application on the remote side.
>
> >
> > Can you explain what the latter sentence means a bit better?
> >
> Oh, i forgot to mention that this bug affects serial lines which are shared
> with the GDB stub. Assume the remote needs a BREAK to start its gdb stub. If
> you send the '+' before the BREAK it will be delivered to the actual
> application running on the device (and of course listening on the serial
> port). [If there happens to be some echo service things will even go worse,
> because the echoed '+' will be interpreted by GDB as an ACK to the first sent
> packet.]
Okay, makes sense. I figured it was something like that, but doesn't hurt
to be explicit so we don't have to guess, and for the benefit of
the archives.
Patch is okay, thanks.
--
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remote target interrupt before ack
2011-04-05 16:10 ` Pedro Alves
@ 2011-04-26 11:01 ` Michael Walle
2011-04-26 15:40 ` Tom Tromey
0 siblings, 1 reply; 6+ messages in thread
From: Michael Walle @ 2011-04-26 11:01 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Michael Walle
Am Di, 5.04.2011, 18:10, schrieb Pedro Alves:
> On Monday 04 April 2011 21:38:32, Michael Walle wrote:
>> Am Montag 04 April 2011, 22:21:21 schrieb Pedro Alves:
>> > On Monday 04 April 2011 21:00:15, Michael Walle wrote:
>> > > the following patch puts the sending of the interrupt/break sequence
>> > > before the proforma ACK. This guarantees the ACK won't be delivered
>> to
>> > > an application on the remote side.
>>
>> >
>> > Can you explain what the latter sentence means a bit better?
>> >
>> Oh, i forgot to mention that this bug affects serial lines which are
>> shared
>> with the GDB stub. Assume the remote needs a BREAK to start its gdb
>> stub. If
>> you send the '+' before the BREAK it will be delivered to the actual
>> application running on the device (and of course listening on the serial
>> port). [If there happens to be some echo service things will even go
>> worse,
>> because the echoed '+' will be interpreted by GDB as an ACK to the first
>> sent
>> packet.]
>
> Okay, makes sense. I figured it was something like that, but doesn't hurt
> to be explicit so we don't have to guess, and for the benefit of
> the archives.
>
> Patch is okay, thanks.
Any news on merging this patch?
--
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-04-26 15:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-04 20:00 [PATCH] remote target interrupt before ack Michael Walle
2011-04-04 20:21 ` Pedro Alves
2011-04-04 20:38 ` Michael Walle
2011-04-05 16:10 ` Pedro Alves
2011-04-26 11:01 ` Michael Walle
2011-04-26 15:40 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox