HomePhabricator

[lldb] Fix incorrect error handling in GDBRemoteCommunicationClient…

Authored by teemperor on Nov 19 2020, 10:13 AM.

Description

[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