[Lldb-commits] [PATCH] D41069: NPL: Clean up handling of inferior exit

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 11 07:39:36 PST 2017


labath created this revision.

lldb-server was sending the "exit" packet (W??) twice. This happened
because it was handling both the pre-exit (PTRACE_EVENT_EXIT) and
post-exit (WIFEXITED) as exit events. We had some code which was trying
to detect when we've already sent the exit packet, but this stopped
working quite a while ago.

This never really caused any problems in practice because the client
automatically closes the connection after receiving the first packet, so
the only effect of this was some warning messages about extra packets
from the lldb-server test suite, which were ignored because they didn't
fail the test.

The new test suite will be stricter about this, so I fix this issue
ignoring the first event. I think this is the correct behavior, as the
inferior is not really dead at that point, so it's premature to send the
exit packet.

There isn't an actual test yet which would verify the exit behavior, but
in my next patch I will add a test which will also test this
functionality.


https://reviews.llvm.org/D41069

Files:
  source/Plugins/Process/Linux/NativeProcessLinux.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  unittests/tools/lldb-server/tests/TestClient.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41069.126364.patch
Type: text/x-patch
Size: 5926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171211/2ffeec16/attachment.bin>


More information about the lldb-commits mailing list