forked from OSchip/llvm-project
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
This commit is contained in:
parent
c01140ef1f
commit
a89ce43cec
|
@ -199,8 +199,6 @@ 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.
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "lldb/Core/FileSpecList.h"
|
||||
#include "lldb/Utility/FileSpec.h"
|
||||
|
||||
namespace lldb_private {
|
||||
|
@ -35,7 +36,9 @@ 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);
|
||||
static FileSpec
|
||||
LocateExecutableSymbolFile(const ModuleSpec &module_spec,
|
||||
const FileSpecList &default_search_paths);
|
||||
|
||||
static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec,
|
||||
const lldb_private::UUID *uuid,
|
||||
|
|
|
@ -692,7 +692,7 @@ public:
|
|||
|
||||
virtual const lldb::UnixSignalsSP &GetRemoteUnixSignals();
|
||||
|
||||
const lldb::UnixSignalsSP &GetUnixSignals();
|
||||
lldb::UnixSignalsSP GetUnixSignals();
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Locate a queue name given a thread's qaddr
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace lldb_private {
|
|||
class UnixSignals {
|
||||
public:
|
||||
static lldb::UnixSignalsSP Create(const ArchSpec &arch);
|
||||
static lldb::UnixSignalsSP CreateForHost();
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Constructors and Destructors
|
||||
|
|
|
@ -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://"))
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "lldb/Host/FileSystem.h"
|
||||
#include "lldb/Host/HostInfo.h"
|
||||
#include "lldb/Symbol/LocateSymbolFile.h"
|
||||
#include "lldb/Target/Target.h"
|
||||
|
||||
using namespace lldb_private;
|
||||
|
||||
|
@ -33,7 +34,9 @@ TEST_F(
|
|||
SymbolsTest,
|
||||
TerminateLocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) {
|
||||
ModuleSpec module_spec;
|
||||
FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec);
|
||||
FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
|
||||
FileSpec symbol_file_spec =
|
||||
Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
|
||||
EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
|
||||
}
|
||||
|
||||
|
@ -43,6 +46,8 @@ 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);
|
||||
FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec);
|
||||
FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
|
||||
FileSpec symbol_file_spec =
|
||||
Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
|
||||
EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue