[lldb] Fix incorrect error handling in GDBRemoteCommunicationClient::SendGetSupporte...
authorRaphael Isemann <teemperor@gmail.com>
Thu, 19 Nov 2020 18:13:39 +0000 (19:13 +0100)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 19 Nov 2020 18:14:04 +0000 (19:14 +0100)
commit47b7138b484b8fc94633ac4750a11acad797473e
treec76ca0b2a2e01fd12937b257bbaa84dcca5836b7
parent41c9f4c1cea7314c0a6a32f2e59dab60cd575c1f
[lldb] Fix incorrect error handling in  GDBRemoteCommunicationClient::SendGetSupportedTraceType

GDBRemoteCommunicationClient::SendGetSupportedTraceType is checking whether the
response is `!response.IsNormalResponse()` and infers from that that it is an error response.
However, it could be either "unsupported" or "error". If we get an unsupported response,
the code then tries to generate an llvm::Expected from the non-error response which then asserts.

Debugserver doesn't implement `jLLDBTraceSupportedType`, so we get an unsupported response
whenever this function is called on macOS.

This fixes the TestAproposWithProcess on macOS (where the `apropos` command will query
the CommandObjectTraceStart which then sends the trace type query package).

Reviewed By: wallace, shafik

Differential Revision: https://reviews.llvm.org/D91801
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp