[Lldb-commits] [lldb] r354177 - Revert "Don't include UnixSignals.h from Host."

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 15 13:55:29 PST 2019


Author: davide
Date: Fri Feb 15 13:55:29 2019
New Revision: 354177

URL: http://llvm.org/viewvc/llvm-project?rev=354177&view=rev
Log:
Revert "Don't include UnixSignals.h from Host."

It broke the modules green dragon buildbot.

Modified:
    lldb/trunk/include/lldb/Host/Host.h
    lldb/trunk/include/lldb/Host/Symbols.h
    lldb/trunk/include/lldb/Target/Platform.h
    lldb/trunk/include/lldb/Target/UnixSignals.h
    lldb/trunk/source/Host/common/Host.cpp
    lldb/trunk/source/Host/common/Symbols.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
    lldb/trunk/source/Target/Platform.cpp
    lldb/trunk/source/Target/UnixSignals.cpp
    lldb/trunk/unittests/Host/SymbolsTest.cpp

Modified: lldb/trunk/include/lldb/Host/Host.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/Host.h (original)
+++ lldb/trunk/include/lldb/Host/Host.h Fri Feb 15 13:55:29 2019
@@ -196,6 +196,8 @@ public:
 
   static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info);
 
+  static const lldb::UnixSignalsSP &GetUnixSignals();
+
   /// Launch the process specified in launch_info. The monitoring callback in
   /// launch_info must be set, and it will be called when the process
   /// terminates.

Modified: lldb/trunk/include/lldb/Host/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Symbols.h?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/Symbols.h (original)
+++ lldb/trunk/include/lldb/Host/Symbols.h Fri Feb 15 13:55:29 2019
@@ -11,7 +11,6 @@
 
 #include <stdint.h>
 
-#include "lldb/Core/FileSpecList.h"
 #include "lldb/Utility/FileSpec.h"
 
 namespace lldb_private {
@@ -36,9 +35,7 @@ public:
   // Locating the file should happen only on the local computer or using the
   // current computers global settings.
   //----------------------------------------------------------------------
-  static FileSpec
-  LocateExecutableSymbolFile(const ModuleSpec &module_spec,
-                             const FileSpecList &default_search_paths);
+  static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec);
 
   static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec,
                                          const lldb_private::UUID *uuid,

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Fri Feb 15 13:55:29 2019
@@ -689,7 +689,7 @@ public:
 
   virtual const lldb::UnixSignalsSP &GetRemoteUnixSignals();
 
-  lldb::UnixSignalsSP GetUnixSignals();
+  const lldb::UnixSignalsSP &GetUnixSignals();
 
   //------------------------------------------------------------------
   /// Locate a queue name given a thread's qaddr

Modified: lldb/trunk/include/lldb/Target/UnixSignals.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/UnixSignals.h?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/UnixSignals.h (original)
+++ lldb/trunk/include/lldb/Target/UnixSignals.h Fri Feb 15 13:55:29 2019
@@ -22,7 +22,6 @@ namespace lldb_private {
 class UnixSignals {
 public:
   static lldb::UnixSignalsSP Create(const ArchSpec &arch);
-  static lldb::UnixSignalsSP CreateForHost();
 
   //------------------------------------------------------------------
   // Constructors and Destructors

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Fri Feb 15 13:55:29 2019
@@ -56,6 +56,7 @@
 #include "lldb/Host/ProcessLauncher.h"
 #include "lldb/Host/ThreadLauncher.h"
 #include "lldb/Host/posix/ConnectionFileDescriptorPosix.h"
+#include "lldb/Target/UnixSignals.h"
 #include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Log.h"
@@ -612,6 +613,12 @@ bool Host::OpenFileInExternalEditor(cons
 
 #endif
 
+const UnixSignalsSP &Host::GetUnixSignals() {
+  static const auto s_unix_signals_sp =
+      UnixSignals::Create(HostInfo::GetArchitecture());
+  return s_unix_signals_sp;
+}
+
 std::unique_ptr<Connection> Host::CreateDefaultConnection(llvm::StringRef url) {
 #if defined(_WIN32)
   if (url.startswith("file://"))

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Fri Feb 15 13:55:29 2019
@@ -7,10 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Host/Symbols.h"
-#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Target/Target.h"
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/DataExtractor.h"
@@ -248,9 +248,7 @@ ModuleSpec Symbols::LocateExecutableObje
 
 // Keep "symbols.enable-external-lookup" description in sync with this function.
 
-FileSpec
-Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec,
-                                    const FileSpecList &default_search_paths) {
+FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
   FileSpec symbol_file_spec = module_spec.GetSymbolFileSpec();
   if (symbol_file_spec.IsAbsolute() &&
       FileSystem::Instance().Exists(symbol_file_spec))
@@ -258,7 +256,8 @@ Symbols::LocateExecutableSymbolFile(cons
 
   const char *symbol_filename = symbol_file_spec.GetFilename().AsCString();
   if (symbol_filename && symbol_filename[0]) {
-    FileSpecList debug_file_search_paths = default_search_paths;
+    FileSpecList debug_file_search_paths(
+        Target::GetDefaultDebugFileSearchPaths());
 
     // Add module directory.
     FileSpec module_file_spec = module_spec.GetFileSpec();

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp Fri Feb 15 13:55:29 2019
@@ -398,7 +398,7 @@ GDBRemoteCommunicationServerPlatform::Ha
     StringExtractorGDBRemote &packet) {
   StructuredData::Array signal_array;
 
-  lldb::UnixSignalsSP signals = UnixSignals::CreateForHost();
+  const auto &signals = Host::GetUnixSignals();
   for (auto signo = signals->GetFirstSignalNumber();
        signo != LLDB_INVALID_SIGNAL_NUMBER;
        signo = signals->GetNextSignalNumber(signo)) {

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Feb 15 13:55:29 2019
@@ -49,7 +49,6 @@
 #include "lldb/Symbol/VariableList.h"
 
 #include "lldb/Target/Language.h"
-#include "lldb/Target/Target.h"
 
 #include "AppleDWARFIndex.h"
 #include "DWARFASTParser.h"
@@ -3837,10 +3836,7 @@ SymbolFileDWARFDwp *SymbolFileDWARF::Get
     module_spec.GetFileSpec() = m_obj_file->GetFileSpec();
     module_spec.GetSymbolFileSpec() =
         FileSpec(m_obj_file->GetFileSpec().GetPath() + ".dwp");
-
-    FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
-    FileSpec dwp_filespec =
-        Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
+    FileSpec dwp_filespec = Symbols::LocateExecutableSymbolFile(module_spec);
     if (FileSystem::Instance().Exists(dwp_filespec)) {
       m_dwp_symfile = SymbolFileDWARFDwp::Create(GetObjectFile()->GetModule(),
                                                  dwp_filespec);

Modified: lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp Fri Feb 15 13:55:29 2019
@@ -17,7 +17,6 @@
 #include "lldb/Host/Host.h"
 #include "lldb/Host/Symbols.h"
 #include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Target/Target.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/Timer.h"
 
@@ -104,9 +103,7 @@ SymbolVendorELF::CreateInstance(const ll
     FileSystem::Instance().Resolve(module_spec.GetFileSpec());
     module_spec.GetSymbolFileSpec() = fspec;
     module_spec.GetUUID() = uuid;
-    FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
-    FileSpec dsym_fspec =
-        Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
+    FileSpec dsym_fspec = Symbols::LocateExecutableSymbolFile(module_spec);
     if (dsym_fspec) {
       DataBufferSP dsym_file_data_sp;
       lldb::offset_t dsym_file_data_offset = 0;

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Fri Feb 15 13:55:29 2019
@@ -1740,9 +1740,9 @@ const UnixSignalsSP &Platform::GetRemote
   return s_default_unix_signals_sp;
 }
 
-UnixSignalsSP Platform::GetUnixSignals() {
+const UnixSignalsSP &Platform::GetUnixSignals() {
   if (IsHost())
-    return UnixSignals::CreateForHost();
+    return Host::GetUnixSignals();
   return GetRemoteUnixSignals();
 }
 

Modified: lldb/trunk/source/Target/UnixSignals.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/UnixSignals.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/source/Target/UnixSignals.cpp (original)
+++ lldb/trunk/source/Target/UnixSignals.cpp Fri Feb 15 13:55:29 2019
@@ -11,7 +11,6 @@
 #include "Plugins/Process/Utility/LinuxSignals.h"
 #include "Plugins/Process/Utility/MipsLinuxSignals.h"
 #include "Plugins/Process/Utility/NetBSDSignals.h"
-#include "lldb/Host/HostInfo.h"
 #include "lldb/Host/StringConvert.h"
 #include "lldb/Utility/ArchSpec.h"
 
@@ -51,12 +50,6 @@ lldb::UnixSignalsSP UnixSignals::Create(
   }
 }
 
-lldb::UnixSignalsSP UnixSignals::CreateForHost() {
-  static lldb::UnixSignalsSP s_unix_signals_sp =
-      Create(HostInfo::GetArchitecture());
-  return s_unix_signals_sp;
-}
-
 //----------------------------------------------------------------------
 // UnixSignals constructor
 //----------------------------------------------------------------------

Modified: lldb/trunk/unittests/Host/SymbolsTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SymbolsTest.cpp?rev=354177&r1=354176&r2=354177&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/SymbolsTest.cpp (original)
+++ lldb/trunk/unittests/Host/SymbolsTest.cpp Fri Feb 15 13:55:29 2019
@@ -12,7 +12,6 @@
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/Symbols.h"
-#include "lldb/Target/Target.h"
 
 using namespace lldb_private;
 
@@ -34,9 +33,7 @@ TEST_F(
     SymbolsTest,
     TerminateLocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) {
   ModuleSpec module_spec;
-  FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
-  FileSpec symbol_file_spec =
-      Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
+  FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec);
   EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
 }
 
@@ -46,8 +43,6 @@ TEST_F(SymbolsTest,
   // using a GUID here because the symbol file shouldn't actually exist on disk
   module_spec.GetSymbolFileSpec().SetFile(
       "4A524676-B24B-4F4E-968A-551D465EBAF1.so", FileSpec::Style::native);
-  FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
-  FileSpec symbol_file_spec =
-      Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
+  FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec);
   EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
 }




More information about the lldb-commits mailing list