splhack created this revision.
splhack added reviewers: clayborg, jingham, bulbazord, jasonmolenda, 
JDevlieghere, mib.
Herald added a project: All.
splhack requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

D153734 <https://reviews.llvm.org/D153734> forgot to call 
`Platform::SetHostPlatform` before
`Debugger::CreateInstance`. Copy similar code.
https://github.com/llvm/llvm-project/blob/5007c78ce0936824972ec6ba3cfa598192087ee1/lldb/unittests/Expression/DWARFExpressionTest.cpp#L371-L374


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155135

Files:
  lldb/unittests/Target/LocateModuleCallbackTest.cpp


Index: lldb/unittests/Target/LocateModuleCallbackTest.cpp
===================================================================
--- lldb/unittests/Target/LocateModuleCallbackTest.cpp
+++ lldb/unittests/Target/LocateModuleCallbackTest.cpp
@@ -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 @@
 
 class LocateModuleCallbackTest : public testing::Test {
   SubsystemRAII<FileSystem, HostInfo, ObjectFileBreakpad, ObjectFileELF,
-                PlatformAndroid, SymbolFileBreakpad, SymbolFileSymtab>
+                PlatformAndroid, PlatformLinux, SymbolFileBreakpad,
+                SymbolFileSymtab>
       subsystems;
 
 public:
@@ -202,6 +204,9 @@
         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);
 


Index: lldb/unittests/Target/LocateModuleCallbackTest.cpp
===================================================================
--- lldb/unittests/Target/LocateModuleCallbackTest.cpp
+++ lldb/unittests/Target/LocateModuleCallbackTest.cpp
@@ -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 @@
 
 class LocateModuleCallbackTest : public testing::Test {
   SubsystemRAII<FileSystem, HostInfo, ObjectFileBreakpad, ObjectFileELF,
-                PlatformAndroid, SymbolFileBreakpad, SymbolFileSymtab>
+                PlatformAndroid, PlatformLinux, SymbolFileBreakpad,
+                SymbolFileSymtab>
       subsystems;
 
 public:
@@ -202,6 +204,9 @@
         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);
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to