summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2019-03-06 18:20:23 +0000
committerZachary Turner <zturner@google.com>2019-03-06 18:20:23 +0000
commita89ce43cec5ee6aa621173a5cba716d7d734ddd1 (patch)
treeb5b24a255ce2d7efdd2cb9a9621f38f4be01f9f4 /lldb/source
parentc01140ef1ff66869d4ea9465c3cd198d82d30cab (diff)
downloadbcm5719-llvm-a89ce43cec5ee6aa621173a5cba716d7d734ddd1.tar.gz
bcm5719-llvm-a89ce43cec5ee6aa621173a5cba716d7d734ddd1.zip
Resubmit "Don't include UnixSignals.h from Host."
This was reverted because it breaks the GreenDragon bot, but the reason for the breakage is lost, so I'm resubmitting this now so we can find out what the problem is. llvm-svn: 355528
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Host/common/Host.cpp7
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp6
-rw-r--r--lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp5
-rw-r--r--lldb/source/Symbol/LocateSymbolFile.cpp9
-rw-r--r--lldb/source/Target/Platform.cpp4
-rw-r--r--lldb/source/Target/UnixSignals.cpp7
7 files changed, 24 insertions, 16 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index acdb92d4993..2906fe8a908 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -56,7 +56,6 @@
#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"
@@ -613,12 +612,6 @@ bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
#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://"))
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
index 808299120c3..e19eb23ced5 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -398,7 +398,7 @@ GDBRemoteCommunicationServerPlatform::Handle_jSignalsInfo(
StringExtractorGDBRemote &packet) {
StructuredData::Array signal_array;
- const auto &signals = Host::GetUnixSignals();
+ lldb::UnixSignalsSP signals = UnixSignals::CreateForHost();
for (auto signo = signals->GetFirstSignalNumber();
signo != LLDB_INVALID_SIGNAL_NUMBER;
signo = signals->GetNextSignalNumber(signo)) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 5fbae52c524..734f066b836 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -49,6 +49,7 @@
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Language.h"
+#include "lldb/Target/Target.h"
#include "AppleDWARFIndex.h"
#include "DWARFASTParser.h"
@@ -3836,7 +3837,10 @@ SymbolFileDWARFDwp *SymbolFileDWARF::GetDwpSymbolFile() {
module_spec.GetFileSpec() = m_obj_file->GetFileSpec();
module_spec.GetSymbolFileSpec() =
FileSpec(m_obj_file->GetFileSpec().GetPath() + ".dwp");
- FileSpec dwp_filespec = Symbols::LocateExecutableSymbolFile(module_spec);
+
+ FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
+ FileSpec dwp_filespec =
+ Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
if (FileSystem::Instance().Exists(dwp_filespec)) {
m_dwp_symfile = SymbolFileDWARFDwp::Create(GetObjectFile()->GetModule(),
dwp_filespec);
diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index 472fd2ffd50..fd4925254ea 100644
--- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -17,6 +17,7 @@
#include "lldb/Host/Host.h"
#include "lldb/Symbol/LocateSymbolFile.h"
#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Target/Target.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
@@ -103,7 +104,9 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
FileSystem::Instance().Resolve(module_spec.GetFileSpec());
module_spec.GetSymbolFileSpec() = fspec;
module_spec.GetUUID() = uuid;
- FileSpec dsym_fspec = Symbols::LocateExecutableSymbolFile(module_spec);
+ FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
+ FileSpec dsym_fspec =
+ Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
if (dsym_fspec) {
DataBufferSP dsym_file_data_sp;
lldb::offset_t dsym_file_data_offset = 0;
diff --git a/lldb/source/Symbol/LocateSymbolFile.cpp b/lldb/source/Symbol/LocateSymbolFile.cpp
index e45eb2e2c36..2a4d49cfbaf 100644
--- a/lldb/source/Symbol/LocateSymbolFile.cpp
+++ b/lldb/source/Symbol/LocateSymbolFile.cpp
@@ -8,10 +8,10 @@
#include "lldb/Symbol/LocateSymbolFile.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"
@@ -252,7 +252,9 @@ ModuleSpec Symbols::LocateExecutableObjectFile(const ModuleSpec &module_spec) {
// Keep "symbols.enable-external-lookup" description in sync with this function.
-FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
+FileSpec
+Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec,
+ const FileSpecList &default_search_paths) {
FileSpec symbol_file_spec = module_spec.GetSymbolFileSpec();
if (symbol_file_spec.IsAbsolute() &&
FileSystem::Instance().Exists(symbol_file_spec))
@@ -260,8 +262,7 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
const char *symbol_filename = symbol_file_spec.GetFilename().AsCString();
if (symbol_filename && symbol_filename[0]) {
- FileSpecList debug_file_search_paths(
- Target::GetDefaultDebugFileSearchPaths());
+ FileSpecList debug_file_search_paths = default_search_paths;
// Add module directory.
FileSpec module_file_spec = module_spec.GetFileSpec();
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index b57c3523e72..6dab52390fc 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -1712,9 +1712,9 @@ const UnixSignalsSP &Platform::GetRemoteUnixSignals() {
return s_default_unix_signals_sp;
}
-const UnixSignalsSP &Platform::GetUnixSignals() {
+UnixSignalsSP Platform::GetUnixSignals() {
if (IsHost())
- return Host::GetUnixSignals();
+ return UnixSignals::CreateForHost();
return GetRemoteUnixSignals();
}
diff --git a/lldb/source/Target/UnixSignals.cpp b/lldb/source/Target/UnixSignals.cpp
index fc08e8438c5..970510367f0 100644
--- a/lldb/source/Target/UnixSignals.cpp
+++ b/lldb/source/Target/UnixSignals.cpp
@@ -11,6 +11,7 @@
#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"
@@ -50,6 +51,12 @@ lldb::UnixSignalsSP UnixSignals::Create(const ArchSpec &arch) {
}
}
+lldb::UnixSignalsSP UnixSignals::CreateForHost() {
+ static lldb::UnixSignalsSP s_unix_signals_sp =
+ Create(HostInfo::GetArchitecture());
+ return s_unix_signals_sp;
+}
+
//----------------------------------------------------------------------
// UnixSignals constructor
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud