llgs: Send "rich" errors in response to vAttach packets
authorPavel Labath <labath@google.com>
Wed, 11 Apr 2018 13:30:54 +0000 (13:30 +0000)
committerPavel Labath <labath@google.com>
Wed, 11 Apr 2018 13:30:54 +0000 (13:30 +0000)
commita70512a9587c40e66035c53c170e8d44c8d2e911
tree04e18d8a0b7b68f1db4235f26c6fa91f5a5091cb
parent6f97328b1f7a30cc5049d041d9d72403ba23e3d1
llgs: Send "rich" errors in response to vAttach packets

There are plenty of ways attaching can go wrong. Having the server
report the exact error means we can give better feedback to the user.
(This patch does not do the second part, it only makes sure the
information is sent from the server.)

Triggering all possible error conditions in a test would prove
challenging, but there is one error that is very easy to reproduce
(attempting to attach while debugging), so I write a test based on that.

The test immediately exposed a bug where the m_send_error_strings field
was being used uninitialized (so it was sometimes true from the get-go),
so I fix that as well.

llvm-svn: 329803
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/unittests/tools/lldb-server/tests/LLGSTest.cpp
lldb/unittests/tools/lldb-server/tests/TestClient.cpp