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]

[PATCH 1/4] Remote exit events on Linux


This patch implements support for the extended ptrace event 
PTRACE_EVENT_EXIT on Linux.  This is a preparatory patch for exec event
support.

The use of this event is entirely internal to gdbserver; these events are
not reported to GDB or the user.  If an existing thread is not the last
thread in a process, its lwp entry is simply deleted, since this is what
happens in the absence of exit events.  If it is the last thread of a
process, the wait status is set to the actual wait status of the thread,
instead of the status that indicates the extended event, and the existing
mechanisms for handling thread exit proceed as usual.

The only purpose in using the exit events instead of the existing wait
mechanisms is to ensure that the exit of a thread group leader is detected
reliably when a non-leader thread calls exec.


gdb/
2014-04-02  Don Breazeal  <donb@codesourcery.com>

        * common/linux-ptrace.c (linux_test_for_tracefork)
        [GDBSERVER]: Add support for PTRACE_EVENT_EXIT if the OS
        supports it.

gdbserver/
2014-04-02  Don Breazeal  <donb@codesourcery.com>

        * linux-low.c (is_extended_waitstatus): New function.
        (is_extended_exit): New function.
        (handle_extended_wait): Change type from void to int, change
        wait status arg to pointer, add support for PTRACE_EVENT_EXIT.
        (get_stop_pc): Use is_extended_waitstatus instead of hardcoded
        shift operation.
        (get_detach_signal): Use is_extended_waitstatus instead of
        hardcoded shift operation.
        (linux_low_filter_event): Handle new return value from
        handle_extended_wait.  Check for extended events as needed.
        Allow status arg to be modified.
        (linux_wait_for_event_filtered): Allow status arg to be
        modified.

Attachment: 0001-remote-exit.patch
Description: 0001-remote-exit.patch


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