Revert "Revert "[lldb][LocateModuleCallback] Fix LocateModuleCallbackTest""
authorShubham Sandeep Rastogi <srastogi22@apple.com>
Fri, 14 Jul 2023 15:18:53 +0000 (11:18 -0400)
committerShubham Sandeep Rastogi <srastogi22@apple.com>
Fri, 14 Jul 2023 15:19:16 +0000 (11:19 -0400)
This reverts commit 668a3efd42e7fea19a0d331f73345f2ac13cdf4f.

Reverting because of build errors:

In file included from /Users/buildslave/jenkins/workspace/as-lldb-cmake/llvm-project/lldb/source/API/SBPlatform.cpp:19:
/Users/buildslave/jenkins/workspace/as-lldb-cmake/llvm-project/lldb/include/lldb/Target/Target.h:1035:18: warning: parameter 'merged' not found in the function declaration [-Wdocumentation]

lldb/unittests/Target/LocateModuleCallbackTest.cpp

index cd5eb44..42a0790 100644 (file)
@@ -22,6 +22,7 @@
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::platform_android;
+using namespace lldb_private::platform_linux;
 using namespace lldb_private::breakpad;
 using namespace testing;
 
@@ -190,7 +191,8 @@ ProcessSP MockProcessCreateInstance(TargetSP target_sp, ListenerSP listener_sp,
 
 class LocateModuleCallbackTest : public testing::Test {
   SubsystemRAII<FileSystem, HostInfo, ObjectFileBreakpad, ObjectFileELF,
-                PlatformAndroid, SymbolFileBreakpad, SymbolFileSymtab>
+                PlatformAndroid, PlatformLinux, SymbolFileBreakpad,
+                SymbolFileSymtab>
       subsystems;
 
 public:
@@ -202,6 +204,9 @@ public:
         m_test_dir);
 
     // Create Debugger.
+    ArchSpec host_arch("i386-pc-linux");
+    Platform::SetHostPlatform(
+        platform_linux::PlatformLinux::CreateInstance(true, &host_arch));
     m_debugger_sp = Debugger::CreateInstance();
     EXPECT_TRUE(m_debugger_sp);