* [PATCH 0/4] Exec events in gdbserver on Linux
@ 2014-04-02 22:24 Breazeal, Don
2014-04-16 16:44 ` Breazeal, Don
0 siblings, 1 reply; 5+ messages in thread
From: Breazeal, Don @ 2014-04-02 22:24 UTC (permalink / raw)
To: gdb-patches
This patch implements support for exec events in gdbserver on GNU/Linux.
This is a step towards the "follow fork/exec" item in the local/remote
debugging feature parity project:
(https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity). Luis had
started work on this last year, and handed it off to me at the end of
January. (BTW, thanks to Luis for his advice on this, although any
problems with this patch are entirely mine.)
Follow-exec-mode and rerun behave as expected in multiprocess mode
(target extended-remote), where follow-exec-mode maintains the
specified inferiors and rerun runs the last executable file to be
exec'd. Catchpoints for exec are not implemented in this patch series,
since this will be easier to do once fork and vfork events are also
supported.
- Patch 1/4 implements support for the extended ptrace event
PTRACE_EVENT_EXIT, which is a prerequisite for the exec event support.
- Patch 2/4 implements the exec event support.
- Patch 3/4 adds documentation for the new RSP "Stop Reply" message.
- Patch 4/4 extends the tests gdb.threads/non-ldr-exc-[1-4].exp to
test in non-stop mode as well as in all-stop mode.
There are a couple of significant aspects to this patch. First, it
uses the ptrace extension PTRACE_EVENT_EXIT to detect thread exit,
in particular the exit of a thread group leader when a non-leader
calls exec. Use of this event was necessary due to a race condition
in the two-thread case. It is only used internally; exit events
detected this way are not exposed to the user, and exit processing
was changed as little as possible.
Second, it sends a signal to each lwp after an exec event in order to
identify and clean up the lwp entry for the exec'ing thread. This
happens in the normal course of things for all-stop mode, but in non-stop
mode gdbserver uses SIGSTOP to stop, then resume all of the non-leader
threads to accomplish this.
More detailed explanations of these issues is included in the patch 2/4
email.
My intent is to follow up with implementations of remote fork/vfork events and
associated catchpoints.
--Don
gdb/common/linux-ptrace.c | 45 ++++-
gdb/doc/gdb.texinfo | 6 +
gdb/gdbserver/linux-low.c | 274 +++++++++++++++++++++++++---
gdb/gdbserver/linux-low.h | 5 +
gdb/gdbserver/remote-utils.c | 28 ++-
gdb/remote.c | 27 ++-
gdb/testsuite/gdb.threads/non-ldr-exc-1.exp | 15 +-
gdb/testsuite/gdb.threads/non-ldr-exc-2.exp | 15 +-
gdb/testsuite/gdb.threads/non-ldr-exc-3.exp | 15 +-
gdb/testsuite/gdb.threads/non-ldr-exc-4.exp | 15 +-
10 files changed, 395 insertions(+), 50 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 0/4] Exec events in gdbserver on Linux
2014-04-02 22:24 [PATCH 0/4] Exec events in gdbserver on Linux Breazeal, Don
@ 2014-04-16 16:44 ` Breazeal, Don
2014-04-28 17:18 ` Breazeal, Don
0 siblings, 1 reply; 5+ messages in thread
From: Breazeal, Don @ 2014-04-16 16:44 UTC (permalink / raw)
To: gdb-patches
Ping for maintainer comments on this patch series:
https://sourceware.org/ml/gdb-patches/2014-04/msg00037.html
https://sourceware.org/ml/gdb-patches/2014-04/msg00040.html
https://sourceware.org/ml/gdb-patches/2014-04/msg00072.html
The documentation piece was previously approved:
https://sourceware.org/ml/gdb-patches/2014-04/msg00071.html
Thanks,
--Don
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Breazeal, Don
> Sent: Wednesday, April 02, 2014 3:24 PM
> To: gdb-patches@sourceware.org
> Subject: [PATCH 0/4] Exec events in gdbserver on Linux
>
> This patch implements support for exec events in gdbserver on GNU/Linux.
> This is a step towards the "follow fork/exec" item in the local/remote
> debugging feature parity project:
> (https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity). Luis had
> started work on this last year, and handed it off to me at the end of
> January. (BTW, thanks to Luis for his advice on this, although any
> problems with this patch are entirely mine.)
>
> Follow-exec-mode and rerun behave as expected in multiprocess mode
> (target extended-remote), where follow-exec-mode maintains the specified
> inferiors and rerun runs the last executable file to be exec'd.
> Catchpoints for exec are not implemented in this patch series, since
> this will be easier to do once fork and vfork events are also supported.
>
> - Patch 1/4 implements support for the extended ptrace event
> PTRACE_EVENT_EXIT, which is a prerequisite for the exec event support.
> - Patch 2/4 implements the exec event support.
> - Patch 3/4 adds documentation for the new RSP "Stop Reply" message.
> - Patch 4/4 extends the tests gdb.threads/non-ldr-exc-[1-4].exp to test
> in non-stop mode as well as in all-stop mode.
>
> There are a couple of significant aspects to this patch. First, it uses
> the ptrace extension PTRACE_EVENT_EXIT to detect thread exit, in
> particular the exit of a thread group leader when a non-leader calls
> exec. Use of this event was necessary due to a race condition in the
> two-thread case. It is only used internally; exit events detected this
> way are not exposed to the user, and exit processing was changed as
> little as possible.
>
> Second, it sends a signal to each lwp after an exec event in order to
> identify and clean up the lwp entry for the exec'ing thread. This
> happens in the normal course of things for all-stop mode, but in non-
> stop mode gdbserver uses SIGSTOP to stop, then resume all of the non-
> leader threads to accomplish this.
>
> More detailed explanations of these issues is included in the patch 2/4
> email.
>
> My intent is to follow up with implementations of remote fork/vfork
> events and associated catchpoints.
>
> --Don
>
> gdb/common/linux-ptrace.c | 45 ++++-
> gdb/doc/gdb.texinfo | 6 +
> gdb/gdbserver/linux-low.c | 274
> +++++++++++++++++++++++++---
> gdb/gdbserver/linux-low.h | 5 +
> gdb/gdbserver/remote-utils.c | 28 ++-
> gdb/remote.c | 27 ++-
> gdb/testsuite/gdb.threads/non-ldr-exc-1.exp | 15 +-
> gdb/testsuite/gdb.threads/non-ldr-exc-2.exp | 15 +-
> gdb/testsuite/gdb.threads/non-ldr-exc-3.exp | 15 +-
> gdb/testsuite/gdb.threads/non-ldr-exc-4.exp | 15 +-
> 10 files changed, 395 insertions(+), 50 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 0/4] Exec events in gdbserver on Linux
2014-04-16 16:44 ` Breazeal, Don
@ 2014-04-28 17:18 ` Breazeal, Don
2014-05-06 15:42 ` Breazeal, Don
0 siblings, 1 reply; 5+ messages in thread
From: Breazeal, Don @ 2014-04-28 17:18 UTC (permalink / raw)
To: gdb-patches
Ping^2
thanks
--Don
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Breazeal, Don
> Sent: Wednesday, April 16, 2014 9:45 AM
> To: gdb-patches@sourceware.org
> Subject: RE: [PATCH 0/4] Exec events in gdbserver on Linux
>
> Ping for maintainer comments on this patch series:
> https://sourceware.org/ml/gdb-patches/2014-04/msg00037.html
> https://sourceware.org/ml/gdb-patches/2014-04/msg00040.html
> https://sourceware.org/ml/gdb-patches/2014-04/msg00072.html
>
> The documentation piece was previously approved:
> https://sourceware.org/ml/gdb-patches/2014-04/msg00071.html
>
> Thanks,
> --Don
>
>
> > -----Original Message-----
> > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> > owner@sourceware.org] On Behalf Of Breazeal, Don
> > Sent: Wednesday, April 02, 2014 3:24 PM
> > To: gdb-patches@sourceware.org
> > Subject: [PATCH 0/4] Exec events in gdbserver on Linux
> >
> > This patch implements support for exec events in gdbserver on
> GNU/Linux.
> > This is a step towards the "follow fork/exec" item in the local/remote
> > debugging feature parity project:
> > (https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity). Luis had
> > started work on this last year, and handed it off to me at the end of
> > January. (BTW, thanks to Luis for his advice on this, although any
> > problems with this patch are entirely mine.)
> >
> > Follow-exec-mode and rerun behave as expected in multiprocess mode
> > (target extended-remote), where follow-exec-mode maintains the
> > specified inferiors and rerun runs the last executable file to be
> exec'd.
> > Catchpoints for exec are not implemented in this patch series, since
> > this will be easier to do once fork and vfork events are also
> supported.
> >
> > - Patch 1/4 implements support for the extended ptrace event
> > PTRACE_EVENT_EXIT, which is a prerequisite for the exec event support.
> > - Patch 2/4 implements the exec event support.
> > - Patch 3/4 adds documentation for the new RSP "Stop Reply" message.
> > - Patch 4/4 extends the tests gdb.threads/non-ldr-exc-[1-4].exp to
> > test in non-stop mode as well as in all-stop mode.
> >
> > There are a couple of significant aspects to this patch. First, it
> > uses the ptrace extension PTRACE_EVENT_EXIT to detect thread exit, in
> > particular the exit of a thread group leader when a non-leader calls
> > exec. Use of this event was necessary due to a race condition in the
> > two-thread case. It is only used internally; exit events detected
> > this way are not exposed to the user, and exit processing was changed
> > as little as possible.
> >
> > Second, it sends a signal to each lwp after an exec event in order to
> > identify and clean up the lwp entry for the exec'ing thread. This
> > happens in the normal course of things for all-stop mode, but in non-
> > stop mode gdbserver uses SIGSTOP to stop, then resume all of the non-
> > leader threads to accomplish this.
> >
> > More detailed explanations of these issues is included in the patch
> > 2/4 email.
> >
> > My intent is to follow up with implementations of remote fork/vfork
> > events and associated catchpoints.
> >
> > --Don
> >
> > gdb/common/linux-ptrace.c | 45 ++++-
> > gdb/doc/gdb.texinfo | 6 +
> > gdb/gdbserver/linux-low.c | 274
> > +++++++++++++++++++++++++---
> > gdb/gdbserver/linux-low.h | 5 +
> > gdb/gdbserver/remote-utils.c | 28 ++-
> > gdb/remote.c | 27 ++-
> > gdb/testsuite/gdb.threads/non-ldr-exc-1.exp | 15 +-
> > gdb/testsuite/gdb.threads/non-ldr-exc-2.exp | 15 +-
> > gdb/testsuite/gdb.threads/non-ldr-exc-3.exp | 15 +-
> > gdb/testsuite/gdb.threads/non-ldr-exc-4.exp | 15 +-
> > 10 files changed, 395 insertions(+), 50 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/4] Exec events in gdbserver on Linux
2014-04-28 17:18 ` Breazeal, Don
@ 2014-05-06 15:42 ` Breazeal, Don
2014-05-07 14:08 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Breazeal, Don @ 2014-05-06 15:42 UTC (permalink / raw)
To: gdb-patches
Ping^3. I reposted the patch series on 4/30 so it would show up in
Patchwork. Here are the new links:
[0/4] https://sourceware.org/ml/gdb-patches/2014-04/msg00648.html
[1/4] https://sourceware.org/ml/gdb-patches/2014-04/msg00647.html
[2/4] https://sourceware.org/ml/gdb-patches/2014-04/msg00651.html
[4/4] https://sourceware.org/ml/gdb-patches/2014-04/msg00649.html
The documentation piece was previously approved:
[3/4] https://sourceware.org/ml/gdb-patches/2014-04/msg00650.html
Thanks,
--Don
On 4/28/2014 10:18 AM, Breazeal, Don wrote:
> Ping^2
> thanks
> --Don
>
>> -----Original Message-----
>> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
>> owner@sourceware.org] On Behalf Of Breazeal, Don
>> Sent: Wednesday, April 16, 2014 9:45 AM
>> To: gdb-patches@sourceware.org
>> Subject: RE: [PATCH 0/4] Exec events in gdbserver on Linux
>>
>> Ping for maintainer comments on this patch series:
>> https://sourceware.org/ml/gdb-patches/2014-04/msg00037.html
>> https://sourceware.org/ml/gdb-patches/2014-04/msg00040.html
>> https://sourceware.org/ml/gdb-patches/2014-04/msg00072.html
>>
>> The documentation piece was previously approved:
>> https://sourceware.org/ml/gdb-patches/2014-04/msg00071.html
>>
>> Thanks,
>> --Don
>>
>>
>> > -----Original Message-----
>> > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
>> > owner@sourceware.org] On Behalf Of Breazeal, Don
>> > Sent: Wednesday, April 02, 2014 3:24 PM
>> > To: gdb-patches@sourceware.org
>> > Subject: [PATCH 0/4] Exec events in gdbserver on Linux
>> >
>> > This patch implements support for exec events in gdbserver on
>> GNU/Linux.
>> > This is a step towards the "follow fork/exec" item in the local/remote
>> > debugging feature parity project:
>> > (https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity). Luis had
>> > started work on this last year, and handed it off to me at the end of
>> > January. (BTW, thanks to Luis for his advice on this, although any
>> > problems with this patch are entirely mine.)
>> >
>> > Follow-exec-mode and rerun behave as expected in multiprocess mode
>> > (target extended-remote), where follow-exec-mode maintains the
>> > specified inferiors and rerun runs the last executable file to be
>> exec'd.
>> > Catchpoints for exec are not implemented in this patch series, since
>> > this will be easier to do once fork and vfork events are also
>> supported.
>> >
>> > - Patch 1/4 implements support for the extended ptrace event
>> > PTRACE_EVENT_EXIT, which is a prerequisite for the exec event support.
>> > - Patch 2/4 implements the exec event support.
>> > - Patch 3/4 adds documentation for the new RSP "Stop Reply" message.
>> > - Patch 4/4 extends the tests gdb.threads/non-ldr-exc-[1-4].exp to
>> > test in non-stop mode as well as in all-stop mode.
>> >
>> > There are a couple of significant aspects to this patch. First, it
>> > uses the ptrace extension PTRACE_EVENT_EXIT to detect thread exit, in
>> > particular the exit of a thread group leader when a non-leader calls
>> > exec. Use of this event was necessary due to a race condition in the
>> > two-thread case. It is only used internally; exit events detected
>> > this way are not exposed to the user, and exit processing was changed
>> > as little as possible.
>> >
>> > Second, it sends a signal to each lwp after an exec event in order to
>> > identify and clean up the lwp entry for the exec'ing thread. This
>> > happens in the normal course of things for all-stop mode, but in non-
>> > stop mode gdbserver uses SIGSTOP to stop, then resume all of the non-
>> > leader threads to accomplish this.
>> >
>> > More detailed explanations of these issues is included in the patch
>> > 2/4 email.
>> >
>> > My intent is to follow up with implementations of remote fork/vfork
>> > events and associated catchpoints.
>> >
>> > --Don
>> >
>> > gdb/common/linux-ptrace.c | 45 ++++-
>> > gdb/doc/gdb.texinfo | 6 +
>> > gdb/gdbserver/linux-low.c | 274
>> > +++++++++++++++++++++++++---
>> > gdb/gdbserver/linux-low.h | 5 +
>> > gdb/gdbserver/remote-utils.c | 28 ++-
>> > gdb/remote.c | 27 ++-
>> > gdb/testsuite/gdb.threads/non-ldr-exc-1.exp | 15 +-
>> > gdb/testsuite/gdb.threads/non-ldr-exc-2.exp | 15 +-
>> > gdb/testsuite/gdb.threads/non-ldr-exc-3.exp | 15 +-
>> > gdb/testsuite/gdb.threads/non-ldr-exc-4.exp | 15 +-
>> > 10 files changed, 395 insertions(+), 50 deletions(-)
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/4] Exec events in gdbserver on Linux
2014-05-06 15:42 ` Breazeal, Don
@ 2014-05-07 14:08 ` Pedro Alves
0 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2014-05-07 14:08 UTC (permalink / raw)
To: Breazeal, Don; +Cc: gdb-patches
Sorry, I'm out of office the whole week. I'll try hard to look at
this next week when I get back.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-07 14:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02 22:24 [PATCH 0/4] Exec events in gdbserver on Linux Breazeal, Don
2014-04-16 16:44 ` Breazeal, Don
2014-04-28 17:18 ` Breazeal, Don
2014-05-06 15:42 ` Breazeal, Don
2014-05-07 14:08 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox