John Harrison 087a5d2ec7
[lldb-dap] Adding additional asserts to unit tests. (#140107)
Adding an assert that the 'continue' request succeeds caused a number of
tests to fail. This showed a number of tests that were not specifying if
they should be stopped or not at key points in the test. This is likely
contributing to these tests being flaky since the debugger is not in the
expected state.

Additionally, I spent a little time trying to improve the readability of
the dap_server.py and lldbdap_testcase.py.
2025-05-16 08:47:01 -07:00

39 lines
1.2 KiB
C++

//===-- DAPError.cpp ------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "DAPError.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"
#include <system_error>
namespace lldb_dap {
char DAPError::ID;
DAPError::DAPError(std::string message, std::error_code EC, bool show_user,
std::optional<std::string> url,
std::optional<std::string> url_label)
: m_message(message), m_ec(EC), m_show_user(show_user), m_url(url),
m_url_label(url_label) {}
void DAPError::log(llvm::raw_ostream &OS) const { OS << m_message; }
std::error_code DAPError::convertToErrorCode() const {
return llvm::inconvertibleErrorCode();
}
char NotStoppedError::ID;
void NotStoppedError::log(llvm::raw_ostream &OS) const { OS << "not stopped"; }
std::error_code NotStoppedError::convertToErrorCode() const {
return llvm::inconvertibleErrorCode();
}
} // namespace lldb_dap