diff options
-rw-r--r-- | lldb/include/lldb/Core/ArchSpec.h | 12 | ||||
-rw-r--r-- | lldb/include/lldb/Host/HostInfoBase.h | 7 | ||||
-rw-r--r-- | lldb/include/lldb/Target/Platform.h | 16 | ||||
-rw-r--r-- | lldb/source/API/SBDebugger.cpp | 4 | ||||
-rw-r--r-- | lldb/source/API/SBInstruction.cpp | 4 | ||||
-rw-r--r-- | lldb/source/API/SBTarget.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectDisassemble.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectPlatform.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Core/ArchSpec.cpp | 92 | ||||
-rw-r--r-- | lldb/source/Host/common/HostInfoBase.cpp | 18 | ||||
-rw-r--r-- | lldb/source/Interpreter/OptionGroupArchitecture.cpp | 11 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | 7 | ||||
-rw-r--r-- | lldb/source/Target/Platform.cpp | 31 | ||||
-rw-r--r-- | lldb/source/Target/Process.cpp | 4 | ||||
-rw-r--r-- | lldb/unittests/Host/CMakeLists.txt | 1 | ||||
-rw-r--r-- | lldb/unittests/Host/HostInfoTest.cpp | 40 | ||||
-rw-r--r-- | lldb/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp | 10 | ||||
-rw-r--r-- | lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp | 4 |
18 files changed, 144 insertions, 128 deletions
diff --git a/lldb/include/lldb/Core/ArchSpec.h b/lldb/include/lldb/Core/ArchSpec.h index 544211e2ea6..038cc928784 100644 --- a/lldb/include/lldb/Core/ArchSpec.h +++ b/lldb/include/lldb/Core/ArchSpec.h @@ -263,8 +263,6 @@ public: explicit ArchSpec(const llvm::Triple &triple); explicit ArchSpec(const char *triple_cstr); explicit ArchSpec(llvm::StringRef triple_str); - ArchSpec(const char *triple_cstr, Platform *platform); - ArchSpec(llvm::StringRef triple_str, Platform *platform); //------------------------------------------------------------------ /// Constructor over architecture name. /// @@ -288,6 +286,12 @@ public: //------------------------------------------------------------------ const ArchSpec &operator=(const ArchSpec &rhs); + //--------------------------------------------------------------------------- + /// Returns true if the OS, vendor and environment fields of the triple are + /// unset. The triple is expected to be normalized (llvm::Triple::normalize). + //--------------------------------------------------------------------------- + static bool ContainsOnlyArch(const llvm::Triple &normalized_triple); + static size_t AutoComplete(llvm::StringRef name, StringList &matches); //------------------------------------------------------------------ @@ -520,10 +524,6 @@ public: bool SetTriple(const llvm::Triple &triple); bool SetTriple(llvm::StringRef triple_str); - bool SetTriple(llvm::StringRef triple_str, Platform *platform); - - bool SetTriple(const char *triple_cstr); - bool SetTriple(const char *triple_cstr, Platform *platform); //------------------------------------------------------------------ /// Returns the default endianness of the architecture. diff --git a/lldb/include/lldb/Host/HostInfoBase.h b/lldb/include/lldb/Host/HostInfoBase.h index 42e3fc3fd1d..d8e1085f39c 100644 --- a/lldb/include/lldb/Host/HostInfoBase.h +++ b/lldb/include/lldb/Host/HostInfoBase.h @@ -81,6 +81,13 @@ public: //------------------------------------------------------------------ static bool GetLLDBPath(lldb::PathType type, FileSpec &file_spec); + //--------------------------------------------------------------------------- + /// If the triple does not specify the vendor, os, and environment parts, we + /// "augment" these using information from the host and return the resulting + /// ArchSpec object. + //--------------------------------------------------------------------------- + static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple); + protected: static bool ComputeSharedLibraryDirectory(FileSpec &file_spec); static bool ComputeSupportExeDirectory(FileSpec &file_spec); diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h index f28a5641568..ac11374935d 100644 --- a/lldb/include/lldb/Target/Platform.h +++ b/lldb/include/lldb/Target/Platform.h @@ -117,9 +117,12 @@ public: static lldb::PlatformSP Create(const ArchSpec &arch, ArchSpec *platform_arch_ptr, Status &error); - static uint32_t GetNumConnectedRemotePlatforms(); - - static lldb::PlatformSP GetConnectedRemotePlatformAtIndex(uint32_t idx); + //------------------------------------------------------------------------ + /// Augments the triple either with information from platform or the host + /// system (if platform is null). + //------------------------------------------------------------------------ + static ArchSpec GetAugmentedArchSpec(Platform *platform, + llvm::StringRef triple); //------------------------------------------------------------------ /// Find a platform plugin for a given process. @@ -513,6 +516,13 @@ public: m_os_version_set_while_connected = m_system_arch.IsValid(); } + //--------------------------------------------------------------------------- + /// If the triple contains not specify the vendor, os, and environment parts, + /// we "augment" these using information from the platform and return the + /// resulting ArchSpec object. + //--------------------------------------------------------------------------- + ArchSpec GetAugmentedArchSpec(llvm::StringRef triple); + // Used for column widths size_t GetMaxUserIDNameLength() const { return m_max_uid_name_len; } diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 3170dc72405..d3294dab582 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -694,8 +694,8 @@ SBTarget SBDebugger::FindTargetWithFileAndArch(const char *filename, SBTarget sb_target; if (m_opaque_sp && filename && filename[0]) { // No need to lock, the target list is thread safe - ArchSpec arch(arch_name, - m_opaque_sp->GetPlatformList().GetSelectedPlatform().get()); + ArchSpec arch = Platform::GetAugmentedArchSpec( + m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name); TargetSP target_sp( m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture( FileSpec(filename, false), arch_name ? &arch : nullptr)); diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp index 8b7deb7011b..181ce362ea7 100644 --- a/lldb/source/API/SBInstruction.cpp +++ b/lldb/source/API/SBInstruction.cpp @@ -20,6 +20,7 @@ #include "lldb/Core/EmulateInstruction.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" @@ -259,8 +260,7 @@ bool SBInstruction::EmulateWithFrame(lldb::SBFrame &frame, bool SBInstruction::DumpEmulation(const char *triple) { lldb::InstructionSP inst_sp(GetOpaque()); if (inst_sp && triple) { - lldb_private::ArchSpec arch(triple, NULL); - return inst_sp->DumpEmulation(arch); + return inst_sp->DumpEmulation(HostInfo::GetAugmentedArchSpec(triple)); } return false; } diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 4b9c64f70f5..19cd53ec0ff 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -1442,8 +1442,8 @@ lldb::SBModule SBTarget::AddModule(const char *path, const char *triple, module_spec.GetUUID().SetFromCString(uuid_cstr); if (triple) - module_spec.GetArchitecture().SetTriple(triple, - target_sp->GetPlatform().get()); + module_spec.GetArchitecture() = Platform::GetAugmentedArchSpec( + target_sp->GetPlatform().get(), triple); else module_spec.GetArchitecture() = target_sp->GetArchitecture(); diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 5d0f2417f99..31c54b7d433 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -163,8 +163,7 @@ Status CommandObjectDisassemble::CommandOptions::SetOptionValue( auto target_sp = execution_context ? execution_context->GetTargetSP() : TargetSP(); auto platform_sp = target_sp ? target_sp->GetPlatform() : PlatformSP(); - if (!arch.SetTriple(option_arg, platform_sp.get())) - arch.SetTriple(option_arg); + arch = Platform::GetAugmentedArchSpec(platform_sp.get(), option_arg); } break; diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 8003ae88ac0..8ed003767d5 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -1337,8 +1337,8 @@ protected: PlatformSP platform_sp = debugger_sp ? debugger_sp->GetPlatformList().GetSelectedPlatform() : PlatformSP(); - match_info.GetProcessInfo().GetArchitecture().SetTriple( - option_arg, platform_sp.get()); + match_info.GetProcessInfo().GetArchitecture() = + Platform::GetAugmentedArchSpec(platform_sp.get(), option_arg); } break; case 'n': diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp index 07c31f391ab..dc2b98250c1 100644 --- a/lldb/source/Core/ArchSpec.cpp +++ b/lldb/source/Core/ArchSpec.cpp @@ -10,7 +10,6 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Host/HostInfo.h" -#include "lldb/Target/Platform.h" #include "lldb/Utility/NameMatches.h" #include "lldb/Utility/Stream.h" // for Stream #include "lldb/Utility/StringList.h" @@ -555,15 +554,6 @@ FindArchDefinitionEntry(const ArchDefinition *def, ArchSpec::Core core) { ArchSpec::ArchSpec() {} -ArchSpec::ArchSpec(const char *triple_cstr, Platform *platform) { - if (triple_cstr) - SetTriple(triple_cstr, platform); -} - -ArchSpec::ArchSpec(llvm::StringRef triple_str, Platform *platform) { - SetTriple(triple_str, platform); -} - ArchSpec::ArchSpec(const char *triple_cstr) { if (triple_cstr) SetTriple(triple_cstr); @@ -873,16 +863,6 @@ bool lldb_private::ParseMachCPUDashSubtypeTriple(llvm::StringRef triple_str, return true; } -bool ArchSpec::SetTriple(const char *triple_cstr) { - llvm::StringRef str(triple_cstr ? triple_cstr : ""); - return SetTriple(str); -} - -bool ArchSpec::SetTriple(const char *triple_cstr, Platform *platform) { - llvm::StringRef str(triple_cstr ? triple_cstr : ""); - return SetTriple(str, platform); -} - bool ArchSpec::SetTriple(llvm::StringRef triple) { if (triple.empty()) { Clear(); @@ -906,73 +886,11 @@ bool ArchSpec::SetTriple(llvm::StringRef triple) { return IsValid(); } -bool ArchSpec::SetTriple(llvm::StringRef triple, Platform *platform) { - if (triple.empty()) { - Clear(); - return false; - } - if (ParseMachCPUDashSubtypeTriple(triple, *this)) - return true; - - if (triple.startswith(LLDB_ARCH_DEFAULT)) { - // Special case for the current host default architectures... - if (triple.equals(LLDB_ARCH_DEFAULT_32BIT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKind32); - else if (triple.equals(LLDB_ARCH_DEFAULT_64BIT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKind64); - else if (triple.equals(LLDB_ARCH_DEFAULT)) - *this = HostInfo::GetArchitecture(HostInfo::eArchKindDefault); - return IsValid(); - } - - ArchSpec raw_arch(triple); - - llvm::Triple normalized_triple(llvm::Triple::normalize(triple)); - - const bool os_specified = !normalized_triple.getOSName().empty(); - const bool vendor_specified = !normalized_triple.getVendorName().empty(); - const bool env_specified = !normalized_triple.getEnvironmentName().empty(); - - if (os_specified || vendor_specified || env_specified) { - SetTriple(normalized_triple); - return IsValid(); - } - - // We got an arch only. If there is no platform, fallback to the host system - // for defaults. - if (!platform) { - llvm::Triple host_triple(llvm::sys::getDefaultTargetTriple()); - if (!vendor_specified) - normalized_triple.setVendor(host_triple.getVendor()); - if (!vendor_specified) - normalized_triple.setOS(host_triple.getOS()); - if (!env_specified && host_triple.getEnvironmentName().size()) - normalized_triple.setEnvironment(host_triple.getEnvironment()); - SetTriple(normalized_triple); - return IsValid(); - } - - // If we were given a platform, use the platform's system architecture. If - // this is not available (might not be connected) use the first supported - // architecture. - ArchSpec compatible_arch; - if (!platform->IsCompatibleArchitecture(raw_arch, false, &compatible_arch)) { - *this = raw_arch; - return IsValid(); - } - - if (compatible_arch.IsValid()) { - const llvm::Triple &compatible_triple = compatible_arch.GetTriple(); - if (!vendor_specified) - normalized_triple.setVendor(compatible_triple.getVendor()); - if (!os_specified) - normalized_triple.setOS(compatible_triple.getOS()); - if (!env_specified && compatible_triple.hasEnvironment()) - normalized_triple.setEnvironment(compatible_triple.getEnvironment()); - } - - SetTriple(normalized_triple); - return IsValid(); +bool ArchSpec::ContainsOnlyArch(const llvm::Triple &normalized_triple) { + return !normalized_triple.getArchName().empty() && + normalized_triple.getOSName().empty() && + normalized_triple.getVendorName().empty() && + normalized_triple.getEnvironmentName().empty(); } void ArchSpec::MergeFrom(const ArchSpec &other) { diff --git a/lldb/source/Host/common/HostInfoBase.cpp b/lldb/source/Host/common/HostInfoBase.cpp index a6c9e91a98e..1362a0cdd46 100644 --- a/lldb/source/Host/common/HostInfoBase.cpp +++ b/lldb/source/Host/common/HostInfoBase.cpp @@ -251,6 +251,24 @@ bool HostInfoBase::GetLLDBPath(lldb::PathType type, FileSpec &file_spec) { return true; } +ArchSpec HostInfoBase::GetAugmentedArchSpec(llvm::StringRef triple) { + if (triple.empty()) + return ArchSpec(); + llvm::Triple normalized_triple(llvm::Triple::normalize(triple)); + if (!ArchSpec::ContainsOnlyArch(normalized_triple)) + return ArchSpec(triple); + + llvm::Triple host_triple(llvm::sys::getDefaultTargetTriple()); + + if (normalized_triple.getVendorName().empty()) + normalized_triple.setVendor(host_triple.getVendor()); + if (normalized_triple.getOSName().empty()) + normalized_triple.setOS(host_triple.getOS()); + if (normalized_triple.getEnvironmentName().empty()) + normalized_triple.setEnvironment(host_triple.getEnvironment()); + return ArchSpec(normalized_triple); +} + bool HostInfoBase::ComputeSharedLibraryDirectory(FileSpec &file_spec) { // To get paths related to LLDB we get the path to the executable that // contains this function. On MacOSX this will be "LLDB.framework/.../LLDB", diff --git a/lldb/source/Interpreter/OptionGroupArchitecture.cpp b/lldb/source/Interpreter/OptionGroupArchitecture.cpp index d5354fe0739..bbd69b8f13f 100644 --- a/lldb/source/Interpreter/OptionGroupArchitecture.cpp +++ b/lldb/source/Interpreter/OptionGroupArchitecture.cpp @@ -8,12 +8,8 @@ //===----------------------------------------------------------------------===// #include "lldb/Interpreter/OptionGroupArchitecture.h" - -// C Includes -// C++ Includes -// Other libraries and framework includes -// Project includes #include "lldb/Host/OptionParser.h" +#include "lldb/Target/Platform.h" using namespace lldb; using namespace lldb_private; @@ -34,10 +30,7 @@ llvm::ArrayRef<OptionDefinition> OptionGroupArchitecture::GetDefinitions() { bool OptionGroupArchitecture::GetArchitecture(Platform *platform, ArchSpec &arch) { - if (m_arch_str.empty()) - arch.Clear(); - else - arch.SetTriple(m_arch_str.c_str(), platform); + arch = Platform::GetAugmentedArchSpec(platform, m_arch_str); return arch.IsValid(); } diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index f53db502be9..3cf6b8ac07b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -403,8 +403,8 @@ GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo( match_info.SetMatchAllUsers( Args::StringToBoolean(value, false, &success)); } else if (key.equals("triple")) { - match_info.GetProcessInfo().GetArchitecture().SetTriple( - value.str().c_str(), NULL); + match_info.GetProcessInfo().GetArchitecture() = + HostInfo::GetAugmentedArchSpec(value); } else { success = false; } @@ -973,8 +973,7 @@ GDBRemoteCommunicationServerCommon::Handle_QLaunchArch( const uint32_t bytes_left = packet.GetBytesLeft(); if (bytes_left > 0) { const char *arch_triple = packet.Peek(); - ArchSpec arch_spec(arch_triple, NULL); - m_process_launch_info.SetArchitecture(arch_spec); + m_process_launch_info.SetArchitecture(HostInfo::GetAugmentedArchSpec(arch_triple)); return SendOKResponse(); } return SendErrorResponse(13); diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index ab09517b633..60aa0079060 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -356,6 +356,12 @@ PlatformSP Platform::Create(const ArchSpec &arch, ArchSpec *platform_arch_ptr, return platform_sp; } +ArchSpec Platform::GetAugmentedArchSpec(Platform *platform, llvm::StringRef triple) { + if (platform) + return platform->GetAugmentedArchSpec(triple); + return HostInfo::GetAugmentedArchSpec(triple); +} + //------------------------------------------------------------------ /// Default Constructor //------------------------------------------------------------------ @@ -963,6 +969,31 @@ const ArchSpec &Platform::GetSystemArchitecture() { return m_system_arch; } +ArchSpec Platform::GetAugmentedArchSpec(llvm::StringRef triple) { + if (triple.empty()) + return ArchSpec(); + llvm::Triple normalized_triple(llvm::Triple::normalize(triple)); + if (!ArchSpec::ContainsOnlyArch(normalized_triple)) + return ArchSpec(triple); + + ArchSpec compatible_arch; + ArchSpec raw_arch(triple); + if (!IsCompatibleArchitecture(raw_arch, false, &compatible_arch)) + return raw_arch; + + if (!compatible_arch.IsValid()) + return ArchSpec(normalized_triple); + + const llvm::Triple &compatible_triple = compatible_arch.GetTriple(); + if (normalized_triple.getVendorName().empty()) + normalized_triple.setVendor(compatible_triple.getVendor()); + if (normalized_triple.getOSName().empty()) + normalized_triple.setOS(compatible_triple.getOS()); + if (normalized_triple.getEnvironmentName().empty()) + normalized_triple.setEnvironment(compatible_triple.getEnvironment()); + return ArchSpec(normalized_triple); +} + Status Platform::ConnectRemote(Args &args) { Status error; if (IsHost()) diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 6540b906477..812000d2d3a 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -480,8 +480,8 @@ Status ProcessLaunchCommandOptions::SetOptionValue( execution_context ? execution_context->GetTargetSP() : TargetSP(); PlatformSP platform_sp = target_sp ? target_sp->GetPlatform() : PlatformSP(); - if (!launch_info.GetArchitecture().SetTriple(option_arg, platform_sp.get())) - launch_info.GetArchitecture().SetTriple(option_arg); + launch_info.GetArchitecture() = + Platform::GetAugmentedArchSpec(platform_sp.get(), option_arg); } break; case 'A': // Disable ASLR. diff --git a/lldb/unittests/Host/CMakeLists.txt b/lldb/unittests/Host/CMakeLists.txt index b1904761197..238026b64c4 100644 --- a/lldb/unittests/Host/CMakeLists.txt +++ b/lldb/unittests/Host/CMakeLists.txt @@ -1,6 +1,7 @@ set (FILES FileSpecTest.cpp FileSystemTest.cpp + HostInfoTest.cpp HostTest.cpp MainLoopTest.cpp SocketAddressTest.cpp diff --git a/lldb/unittests/Host/HostInfoTest.cpp b/lldb/unittests/Host/HostInfoTest.cpp new file mode 100644 index 00000000000..2df27ea73b9 --- /dev/null +++ b/lldb/unittests/Host/HostInfoTest.cpp @@ -0,0 +1,40 @@ +//===-- HostTest.cpp --------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Host/HostInfo.h" +#include "gtest/gtest.h" + +using namespace lldb_private; +using namespace llvm; + +namespace { +class HostInfoTest: public ::testing::Test { + public: + void SetUp() override { HostInfo::Initialize(); } + void TearDown() override { HostInfo::Terminate(); } +}; +} + +TEST_F(HostInfoTest, GetAugmentedArchSpec) { + // Fully specified triple should not be changed. + ArchSpec spec = HostInfo::GetAugmentedArchSpec("x86_64-pc-linux-gnu"); + EXPECT_EQ(spec.GetTriple().getTriple(), "x86_64-pc-linux-gnu"); + + // Same goes if we specify at least one of (os, vendor, env). + spec = HostInfo::GetAugmentedArchSpec("x86_64-pc"); + EXPECT_EQ(spec.GetTriple().getTriple(), "x86_64-pc"); + + // But if we specify only an arch, we should fill in the rest from the host. + spec = HostInfo::GetAugmentedArchSpec("x86_64"); + Triple triple(sys::getDefaultTargetTriple()); + EXPECT_EQ(spec.GetTriple().getArch(), Triple::x86_64); + EXPECT_EQ(spec.GetTriple().getOS(), triple.getOS()); + EXPECT_EQ(spec.GetTriple().getVendor(), triple.getVendor()); + EXPECT_EQ(spec.GetTriple().getEnvironment(), triple.getEnvironment()); +} diff --git a/lldb/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp b/lldb/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp index d7caf4281d5..ebcaa12d295 100644 --- a/lldb/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp +++ b/lldb/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp @@ -55,7 +55,7 @@ void TestArm64InstEmulation::TearDownTestCase() { } TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) { - ArchSpec arch("arm64-apple-ios10", nullptr); + ArchSpec arch("arm64-apple-ios10"); UnwindAssemblyInstEmulation *engine = static_cast<UnwindAssemblyInstEmulation *>( UnwindAssemblyInstEmulation::CreateInstance(arch)); @@ -151,7 +151,7 @@ TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) { } TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) { - ArchSpec arch("arm64-apple-ios10", nullptr); + ArchSpec arch("arm64-apple-ios10"); UnwindAssemblyInstEmulation *engine = static_cast<UnwindAssemblyInstEmulation *>( UnwindAssemblyInstEmulation::CreateInstance(arch)); @@ -313,7 +313,7 @@ TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) { } TEST_F(TestArm64InstEmulation, TestFramelessThreeEpilogueFunction) { - ArchSpec arch("arm64-apple-ios10", nullptr); + ArchSpec arch("arm64-apple-ios10"); UnwindAssemblyInstEmulation *engine = static_cast<UnwindAssemblyInstEmulation *>( UnwindAssemblyInstEmulation::CreateInstance(arch)); @@ -408,7 +408,7 @@ TEST_F(TestArm64InstEmulation, TestFramelessThreeEpilogueFunction) { } TEST_F(TestArm64InstEmulation, TestRegisterSavedTwice) { - ArchSpec arch("arm64-apple-ios10", nullptr); + ArchSpec arch("arm64-apple-ios10"); UnwindAssemblyInstEmulation *engine = static_cast<UnwindAssemblyInstEmulation *>( UnwindAssemblyInstEmulation::CreateInstance(arch)); @@ -510,7 +510,7 @@ TEST_F(TestArm64InstEmulation, TestRegisterSavedTwice) { } TEST_F(TestArm64InstEmulation, TestRegisterDoubleSpills) { - ArchSpec arch("arm64-apple-ios10", nullptr); + ArchSpec arch("arm64-apple-ios10"); UnwindAssemblyInstEmulation *engine = static_cast<UnwindAssemblyInstEmulation *>( UnwindAssemblyInstEmulation::CreateInstance(arch)); diff --git a/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp b/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp index c3591b2d73e..5cca14b611d 100644 --- a/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp +++ b/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp @@ -95,7 +95,7 @@ enum i386_regs { std::unique_ptr<x86AssemblyInspectionEngine> Getx86_64Inspector() { - ArchSpec arch("x86_64-apple-macosx", nullptr); + ArchSpec arch("x86_64-apple-macosx"); std::unique_ptr<x86AssemblyInspectionEngine> engine( new x86AssemblyInspectionEngine(arch)); @@ -114,7 +114,7 @@ std::unique_ptr<x86AssemblyInspectionEngine> Getx86_64Inspector() { std::unique_ptr<x86AssemblyInspectionEngine> Geti386Inspector() { - ArchSpec arch("i386-apple-macosx", nullptr); + ArchSpec arch("i386-apple-macosx"); std::unique_ptr<x86AssemblyInspectionEngine> engine( new x86AssemblyInspectionEngine(arch)); |