StringRef comm_file)
: m_io(comm_file, "runInTerminal launcher") {}
-std::future<Error> RunInTerminalDebugAdapterCommChannel::NotifyDidAttach() {
+// Can't use \a std::future<llvm::Error> because it doesn't compile on Windows
+std::future<lldb::SBError>
+RunInTerminalDebugAdapterCommChannel::NotifyDidAttach() {
return std::async(std::launch::async, [&]() {
- return m_io.SendJSON(RunInTerminalMessageDidAttach().ToJSON());
+ lldb::SBError error;
+ if (llvm::Error err =
+ m_io.SendJSON(RunInTerminalMessageDidAttach().ToJSON()))
+ error.SetErrorString(llvm::toString(std::move(err)).c_str());
+ return error;
});
}
/// \return
/// A future indicated whether the runInTerminal launcher received the
/// message correctly or not.
- std::future<llvm::Error> NotifyDidAttach();
+ std::future<lldb::SBError> NotifyDidAttach();
/// Fetch the pid of the runInTerminal launcher.
///
// This will notify the runInTerminal launcher that we attached.
// We have to make this async, as the function won't return until the launcher
// resumes and reads the data.
- std::future<llvm::Error> did_attach_message_success =
+ std::future<lldb::SBError> did_attach_message_success =
comm_channel.NotifyDidAttach();
// We just attached to the runInTerminal launcher, which was waiting to be
// the async didAttach notification should have an error message, so we
// return it. Otherwise, everything was a success.
did_attach_message_success.wait();
- return did_attach_message_success.get();
+ error = did_attach_message_success.get();
+ if (error.Success())
+ return llvm::Error::success();
+ return llvm::createStringError(llvm::inconvertibleErrorCode(),
+ error.GetCString());
}
// "LaunchRequest": {