This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Host GDB disconnect while waiting for tracee status change
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Dmitry Antipov <dantipov at nvidia dot com>
- Cc: <gdb at sourceware dot org>, Ryan Bissell <rbissell at nvidia dot com>, Mikhail Filimonov <mfilimonov at nvidia dot com>
- Date: Wed, 23 Aug 2017 09:18:19 +0100
- Subject: Re: Host GDB disconnect while waiting for tracee status change
- Authentication-results: sourceware.org; auth=none
- References: <5febbe3e-926f-78bb-db88-901b44e2e258@nvidia.com>
Dmitry Antipov <dantipov@nvidia.com> writes:
> Is there a feature/option/etc. to gracefully handle the situation when gdbserver
> sits waiting for tracee status change and the network connection is
> getting lost?
>
I didn't try GDBserver under the case you described, but I find
something related int GDB manual,
https://sourceware.org/gdb/onlinedocs/gdb/Server.html
"Therefore, when the connection drops unexpectedly, and GDB cannot ask
gdbserver to kill its debugged processes, gdbserver stays running even
in the target remote mode."
GDBserver is able to handle this for tracepoint, which is called
disconnected-tracing.
https://sourceware.org/gdb/onlinedocs/gdb/Starting-and-Stopping-Trace-Experiments.html#disconnected-tracing
With tracepoint, GDBserver knows what it should do when tracee status
changed and don't have to communicate with GDB.
> AFAICS in case of Linux, linux_wait_for_event_filtered() just enters
> sigsuspend()
> waiting for SIGCHLD and ignoring anything else, thus having no
> opportunity to detect
> any socket status changes even if the latter are signaled with SIGIOs requested
> in enable_async_notification().
--
Yao (齐尧)