diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h index d56c71d61068f..9757daaf8f928 100644 --- a/lldb/include/lldb/Core/Debugger.h +++ b/lldb/include/lldb/Core/Debugger.h @@ -311,7 +311,6 @@ class Debugger : public std::enable_shared_from_this, bool GetShowStatusline() const; const FormatEntity::Entry *GetStatuslineFormat() const; - bool SetStatuslineFormat(const FormatEntity::Entry &format); llvm::StringRef GetShowProgressAnsiPrefix() const; diff --git a/lldb/include/lldb/Interpreter/OptionValue.h b/lldb/include/lldb/Interpreter/OptionValue.h index ebc438517a7b1..d19c8b8fab622 100644 --- a/lldb/include/lldb/Interpreter/OptionValue.h +++ b/lldb/include/lldb/Interpreter/OptionValue.h @@ -72,7 +72,7 @@ class OptionValue { virtual ~OptionValue() = default; OptionValue(const OptionValue &other); - + OptionValue& operator=(const OptionValue &other); // Subclasses should override these functions @@ -330,10 +330,6 @@ class OptionValue { bool SetValueAs(ArchSpec v) { return SetArchSpecValue(v); } - bool SetValueAs(const FormatEntity::Entry &v) { - return SetFormatEntityValue(v); - } - template , bool> = true> bool SetValueAs(T t) { return SetEnumerationValue(t); @@ -391,10 +387,8 @@ class OptionValue { bool SetUUIDValue(const UUID &uuid); const FormatEntity::Entry *GetFormatEntity() const; - bool SetFormatEntityValue(const FormatEntity::Entry &entry); - const RegularExpression *GetRegexValue() const; - + mutable std::mutex m_mutex; }; diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index e85002141e33b..aef3c8f1e7322 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -480,13 +480,6 @@ const FormatEntity::Entry *Debugger::GetStatuslineFormat() const { return GetPropertyAtIndexAs(idx); } -bool Debugger::SetStatuslineFormat(const FormatEntity::Entry &format) { - constexpr uint32_t idx = ePropertyStatuslineFormat; - bool ret = SetPropertyAtIndex(idx, format); - RedrawStatusline(); - return ret; -} - bool Debugger::GetUseAutosuggestion() const { const uint32_t idx = ePropertyShowAutosuggestion; return GetPropertyAtIndexAs( diff --git a/lldb/source/Interpreter/OptionValue.cpp b/lldb/source/Interpreter/OptionValue.cpp index 28bc57a07ac71..b95f4fec33949 100644 --- a/lldb/source/Interpreter/OptionValue.cpp +++ b/lldb/source/Interpreter/OptionValue.cpp @@ -474,15 +474,6 @@ bool OptionValue::SetArchSpecValue(ArchSpec arch_spec) { return false; } -bool OptionValue::SetFormatEntityValue(const FormatEntity::Entry &entry) { - std::lock_guard lock(m_mutex); - if (OptionValueFormatEntity *option_value = GetAsFormatEntity()) { - option_value->SetCurrentValue(entry); - return true; - } - return false; -} - const char *OptionValue::GetBuiltinTypeAsCString(Type t) { switch (t) { case eTypeInvalid: diff --git a/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp b/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp index 09c99d58e4ccc..53e8df708720b 100644 --- a/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp +++ b/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp @@ -303,16 +303,7 @@ Status SwiftREPL::DoInitialization() { std::static_pointer_cast( *type_system_or_err) ->SetCompilerOptions(m_compiler_options.c_str()); - - std::string format_str = "${ansi.negative}Swift " + - swift::version::getCompilerVersion() + - "{ | {${progress.count} }${progress.message}}"; - FormatEntity::Entry format_entry; - Status error = FormatEntity::Parse(format_str, format_entry); - if (error.Success()) - m_target.GetDebugger().SetStatuslineFormat(format_entry); - - return error; + return Status(); } llvm::StringRef SwiftREPL::GetSourceFileBasename() { diff --git a/lldb/unittests/Core/CMakeLists.txt b/lldb/unittests/Core/CMakeLists.txt index f06fcd250cf7d..949963fd40346 100644 --- a/lldb/unittests/Core/CMakeLists.txt +++ b/lldb/unittests/Core/CMakeLists.txt @@ -1,5 +1,4 @@ add_lldb_unittest(LLDBCoreTests - DebuggerTest.cpp CommunicationTest.cpp DiagnosticEventTest.cpp DumpDataExtractorTest.cpp diff --git a/lldb/unittests/Core/DebuggerTest.cpp b/lldb/unittests/Core/DebuggerTest.cpp deleted file mode 100644 index df7d999788553..0000000000000 --- a/lldb/unittests/Core/DebuggerTest.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//===-- DebuggerTest.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 "lldb/Core/Debugger.h" -#include "Plugins/Platform/MacOSX/PlatformMacOSX.h" -#include "Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h" -#include "TestingSupport/TestUtilities.h" -#include "lldb/Host/FileSystem.h" -#include "lldb/Host/HostInfo.h" -#include "gtest/gtest.h" - -using namespace lldb; -using namespace lldb_private; - -namespace { -class DebuggerTest : public ::testing::Test { -public: - void SetUp() override { - FileSystem::Initialize(); - HostInfo::Initialize(); - PlatformMacOSX::Initialize(); - std::call_once(TestUtilities::g_debugger_initialize_flag, - []() { Debugger::Initialize(nullptr); }); - ArchSpec arch("x86_64-apple-macosx-"); - Platform::SetHostPlatform( - PlatformRemoteMacOSX::CreateInstance(true, &arch)); - } - void TearDown() override { - PlatformMacOSX::Terminate(); - HostInfo::Terminate(); - FileSystem::Terminate(); - } -}; -} // namespace - -TEST_F(DebuggerTest, TestSettings) { - DebuggerSP debugger_sp = Debugger::CreateInstance(); - - EXPECT_TRUE(debugger_sp->SetUseColor(true)); - EXPECT_TRUE(debugger_sp->GetUseColor()); - - FormatEntity::Entry format("foo"); - EXPECT_TRUE(debugger_sp->SetStatuslineFormat(format)); - EXPECT_EQ(debugger_sp->GetStatuslineFormat()->string, "foo"); - - Debugger::Destroy(debugger_sp); -}