diff options
Diffstat (limited to 'source/Plugins/Platform/MacOSX')
21 files changed, 147 insertions, 144 deletions
diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp index 478d482eb0247..0197d27e76ef7 100644 --- a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp @@ -21,8 +21,8 @@ // Project includes #include "lldb/Host/PseudoTerminal.h" #include "lldb/Target/Process.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" #include "llvm/Support/Threading.h" @@ -55,14 +55,14 @@ PlatformAppleSimulator::PlatformAppleSimulator() //------------------------------------------------------------------ PlatformAppleSimulator::~PlatformAppleSimulator() {} -lldb_private::Error PlatformAppleSimulator::LaunchProcess( +lldb_private::Status PlatformAppleSimulator::LaunchProcess( lldb_private::ProcessLaunchInfo &launch_info) { #if defined(__APPLE__) LoadCoreSimulator(); CoreSimulatorSupport::Device device(GetSimulatorDevice()); if (device.GetState() != CoreSimulatorSupport::Device::State::Booted) { - Error boot_err; + Status boot_err; device.Boot(boot_err); if (boot_err.Fail()) return boot_err; @@ -72,11 +72,11 @@ lldb_private::Error PlatformAppleSimulator::LaunchProcess( if (spawned) { launch_info.SetProcessID(spawned.GetPID()); - return Error(); + return Status(); } else return spawned.GetError(); #else - Error err; + Status err; err.SetErrorString(UNSUPPORTED_ERROR); return err; #endif @@ -124,9 +124,9 @@ void PlatformAppleSimulator::GetStatus(Stream &strm) { #endif } -Error PlatformAppleSimulator::ConnectRemote(Args &args) { +Status PlatformAppleSimulator::ConnectRemote(Args &args) { #if defined(__APPLE__) - Error error; + Status error; if (args.GetArgumentCount() == 1) { if (m_device) DisconnectRemote(); @@ -156,18 +156,18 @@ Error PlatformAppleSimulator::ConnectRemote(Args &args) { } return error; #else - Error err; + Status err; err.SetErrorString(UNSUPPORTED_ERROR); return err; #endif } -Error PlatformAppleSimulator::DisconnectRemote() { +Status PlatformAppleSimulator::DisconnectRemote() { #if defined(__APPLE__) m_device.reset(); - return Error(); + return Status(); #else - Error err; + Status err; err.SetErrorString(UNSUPPORTED_ERROR); return err; #endif @@ -177,7 +177,7 @@ lldb::ProcessSP PlatformAppleSimulator::DebugProcess( ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, // Can be NULL, if NULL create a new target, else use // existing one - Error &error) { + Status &error) { #if defined(__APPLE__) ProcessSP process_sp; // Make sure we stop at the entry point diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h index 34f2ba2d9bfb6..44feb019dc73c 100644 --- a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h +++ b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h @@ -38,19 +38,19 @@ public: virtual ~PlatformAppleSimulator(); - lldb_private::Error + lldb_private::Status LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) override; void GetStatus(lldb_private::Stream &strm) override; - lldb_private::Error ConnectRemote(lldb_private::Args &args) override; + lldb_private::Status ConnectRemote(lldb_private::Args &args) override; - lldb_private::Error DisconnectRemote() override; + lldb_private::Status DisconnectRemote() override; lldb::ProcessSP DebugProcess(lldb_private::ProcessLaunchInfo &launch_info, lldb_private::Debugger &debugger, lldb_private::Target *target, - lldb_private::Error &error) override; + lldb_private::Status &error) override; protected: std::mutex m_core_sim_path_mutex; diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp index 38fe412c85743..52188eefb3661 100644 --- a/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp @@ -23,9 +23,9 @@ #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" #include "llvm/Support/FileSystem.h" @@ -171,10 +171,10 @@ void PlatformAppleTVSimulator::GetStatus(Stream &strm) { strm.PutCString(" SDK Path: error: unable to locate SDK\n"); } -Error PlatformAppleTVSimulator::ResolveExecutable( +Status PlatformAppleTVSimulator::ResolveExecutable( const ModuleSpec &module_spec, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr) { - Error error; + Status error; // Nothing special to do here, just use the actual file and architecture ModuleSpec resolved_module_spec(module_spec); @@ -301,10 +301,10 @@ const char *PlatformAppleTVSimulator::GetSDKDirectoryAsCString() { return NULL; } -Error PlatformAppleTVSimulator::GetSymbolFile(const FileSpec &platform_file, - const UUID *uuid_ptr, - FileSpec &local_file) { - Error error; +Status PlatformAppleTVSimulator::GetSymbolFile(const FileSpec &platform_file, + const UUID *uuid_ptr, + FileSpec &local_file) { + Status error; char platform_file_path[PATH_MAX]; if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path))) { char resolved_path[PATH_MAX]; @@ -333,7 +333,7 @@ Error PlatformAppleTVSimulator::GetSymbolFile(const FileSpec &platform_file, return error; } -Error PlatformAppleTVSimulator::GetSharedModule( +Status PlatformAppleTVSimulator::GetSharedModule( const ModuleSpec &module_spec, lldb_private::Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { @@ -341,7 +341,7 @@ Error PlatformAppleTVSimulator::GetSharedModule( // system. So first we ask for the file in the cached SDK, // then we attempt to get a shared module for the right architecture // with the right UUID. - Error error; + Status error; ModuleSpec platform_module_spec(module_spec); const FileSpec &platform_file = module_spec.GetFileSpec(); error = GetSymbolFile(platform_file, module_spec.GetUUIDPtr(), diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h b/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h index 311ba05d76a22..8cecb4d496ab6 100644 --- a/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h +++ b/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h @@ -51,7 +51,7 @@ public: //------------------------------------------------------------ // lldb_private::Platform functions //------------------------------------------------------------ - lldb_private::Error ResolveExecutable( + lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; @@ -59,12 +59,12 @@ public: void GetStatus(lldb_private::Stream &strm) override; - virtual lldb_private::Error + virtual lldb_private::Status GetSymbolFile(const lldb_private::FileSpec &platform_file, const lldb_private::UUID *uuid_ptr, lldb_private::FileSpec &local_file); - lldb_private::Error + lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp index 1ffdc1ab7c8eb..b9f493294a037 100644 --- a/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp @@ -23,9 +23,9 @@ #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" using namespace lldb; @@ -171,10 +171,10 @@ void PlatformAppleWatchSimulator::GetStatus(Stream &strm) { strm.PutCString(" SDK Path: error: unable to locate SDK\n"); } -Error PlatformAppleWatchSimulator::ResolveExecutable( +Status PlatformAppleWatchSimulator::ResolveExecutable( const ModuleSpec &module_spec, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr) { - Error error; + Status error; // Nothing special to do here, just use the actual file and architecture ModuleSpec resolved_module_spec(module_spec); @@ -301,10 +301,10 @@ const char *PlatformAppleWatchSimulator::GetSDKDirectoryAsCString() { return NULL; } -Error PlatformAppleWatchSimulator::GetSymbolFile(const FileSpec &platform_file, - const UUID *uuid_ptr, - FileSpec &local_file) { - Error error; +Status PlatformAppleWatchSimulator::GetSymbolFile(const FileSpec &platform_file, + const UUID *uuid_ptr, + FileSpec &local_file) { + Status error; char platform_file_path[PATH_MAX]; if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path))) { char resolved_path[PATH_MAX]; @@ -333,7 +333,7 @@ Error PlatformAppleWatchSimulator::GetSymbolFile(const FileSpec &platform_file, return error; } -Error PlatformAppleWatchSimulator::GetSharedModule( +Status PlatformAppleWatchSimulator::GetSharedModule( const ModuleSpec &module_spec, lldb_private::Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { @@ -341,7 +341,7 @@ Error PlatformAppleWatchSimulator::GetSharedModule( // system. So first we ask for the file in the cached SDK, // then we attempt to get a shared module for the right architecture // with the right UUID. - Error error; + Status error; ModuleSpec platform_module_spec(module_spec); const FileSpec &platform_file = module_spec.GetFileSpec(); error = GetSymbolFile(platform_file, module_spec.GetUUIDPtr(), diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h b/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h index 2b15611df47ba..30aa42c964a55 100644 --- a/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h +++ b/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h @@ -51,7 +51,7 @@ public: //------------------------------------------------------------ // lldb_private::Platform functions //------------------------------------------------------------ - lldb_private::Error ResolveExecutable( + lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; @@ -59,12 +59,12 @@ public: void GetStatus(lldb_private::Stream &strm) override; - virtual lldb_private::Error + virtual lldb_private::Status GetSymbolFile(const lldb_private::FileSpec &platform_file, const lldb_private::UUID *uuid_ptr, lldb_private::FileSpec &local_file); - lldb_private::Error + lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 02459045869ad..d69a02e41d514 100644 --- a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -36,8 +36,8 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBufferLLVM.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Threading.h" @@ -195,10 +195,10 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources( return file_list; } -Error PlatformDarwin::ResolveSymbolFile(Target &target, - const ModuleSpec &sym_spec, - FileSpec &sym_file) { - Error error; +Status PlatformDarwin::ResolveSymbolFile(Target &target, + const ModuleSpec &sym_spec, + FileSpec &sym_file) { + Status error; sym_file = sym_spec.GetSymbolFileSpec(); llvm::sys::fs::file_status st; @@ -219,23 +219,23 @@ Error PlatformDarwin::ResolveSymbolFile(Target &target, return error; } -static lldb_private::Error +static lldb_private::Status MakeCacheFolderForFile(const FileSpec &module_cache_spec) { FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent(); return llvm::sys::fs::create_directory(module_cache_folder.GetPath()); } -static lldb_private::Error +static lldb_private::Status BringInRemoteFile(Platform *platform, const lldb_private::ModuleSpec &module_spec, const FileSpec &module_cache_spec) { MakeCacheFolderForFile(module_cache_spec); - Error err = platform->GetFile(module_spec.GetFileSpec(), module_cache_spec); + Status err = platform->GetFile(module_spec.GetFileSpec(), module_cache_spec); return err; } -lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( +lldb_private::Status PlatformDarwin::GetSharedModuleWithLocalCache( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { @@ -252,7 +252,7 @@ lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( module_spec.GetSymbolFileSpec().GetDirectory().AsCString(), module_spec.GetSymbolFileSpec().GetFilename().AsCString()); - Error err; + Status err; err = ModuleList::GetSharedModule(module_spec, module_sp, module_search_paths_ptr, old_module_sp_ptr, @@ -286,7 +286,7 @@ lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( module_spec.GetArchitecture()); module_sp.reset(new Module(local_spec)); module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); - return Error(); + return Status(); } } @@ -300,7 +300,7 @@ lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( uint64_t high_local, high_remote, low_local, low_remote; auto MD5 = llvm::sys::fs::md5_contents(module_cache_spec.GetPath()); if (!MD5) - return Error(MD5.getError()); + return Status(MD5.getError()); std::tie(high_local, low_local) = MD5->words(); m_remote_platform_sp->CalculateMD5(module_spec.GetFileSpec(), @@ -314,7 +314,8 @@ lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( (IsHost() ? "host" : "remote"), module_spec.GetFileSpec().GetDirectory().AsCString(), module_spec.GetFileSpec().GetFilename().AsCString()); - Error err = BringInRemoteFile(this, module_spec, module_cache_spec); + Status err = + BringInRemoteFile(this, module_spec, module_cache_spec); if (err.Fail()) return err; } @@ -329,7 +330,7 @@ lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( (IsHost() ? "host" : "remote"), module_spec.GetFileSpec().GetDirectory().AsCString(), module_spec.GetFileSpec().GetFilename().AsCString()); - return Error(); + return Status(); } // bring in the remote module file @@ -338,7 +339,7 @@ lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( (IsHost() ? "host" : "remote"), module_spec.GetFileSpec().GetDirectory().AsCString(), module_spec.GetFileSpec().GetFilename().AsCString()); - Error err = BringInRemoteFile(this, module_spec, module_cache_spec); + Status err = BringInRemoteFile(this, module_spec, module_cache_spec); if (err.Fail()) return err; if (module_cache_spec.Exists()) { @@ -351,20 +352,20 @@ lldb_private::Error PlatformDarwin::GetSharedModuleWithLocalCache( ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); module_sp.reset(new Module(local_spec)); module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); - return Error(); + return Status(); } else - return Error("unable to obtain valid module file"); + return Status("unable to obtain valid module file"); } else - return Error("no cache path"); + return Status("no cache path"); } else - return Error("unable to resolve module"); + return Status("unable to resolve module"); } -Error PlatformDarwin::GetSharedModule( +Status PlatformDarwin::GetSharedModule( const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { - Error error; + Status error; module_sp.reset(); if (IsRemote()) { @@ -393,7 +394,7 @@ Error PlatformDarwin::GetSharedModule( ModuleSpec new_module_spec(module_spec); new_module_spec.GetFileSpec() = bundle_directory; if (Host::ResolveExecutableInBundle(new_module_spec.GetFileSpec())) { - Error new_error(Platform::GetSharedModule( + Status new_error(Platform::GetSharedModule( new_module_spec, process, module_sp, NULL, old_module_sp_ptr, did_create_ptr)); @@ -420,7 +421,7 @@ Error PlatformDarwin::GetSharedModule( if (new_file_spec.Exists()) { ModuleSpec new_module_spec(module_spec); new_module_spec.GetFileSpec() = new_file_spec; - Error new_error(Platform::GetSharedModule( + Status new_error(Platform::GetSharedModule( new_module_spec, process, module_sp, NULL, old_module_sp_ptr, did_create_ptr)); @@ -1185,7 +1186,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() { int exit_status = -1; int signo = -1; std::string command_output; - Error error = + Status error = Host::RunShellCommand("/usr/bin/xcode-select --print-path", NULL, // current working directory &exit_status, &signo, &command_output, @@ -1361,7 +1362,7 @@ static FileSpec GetXcodeContentsPath() { int signo = 0; std::string output; const char *command = "/usr/bin/xcode-select -p"; - lldb_private::Error error = Host::RunShellCommand( + lldb_private::Status error = Host::RunShellCommand( command, // shell command to run NULL, // current working directory &status, // Put the exit status of the process in here @@ -1739,7 +1740,7 @@ lldb_private::FileSpec PlatformDarwin::LocateExecutable(const char *basename) { return FileSpec(); } -lldb_private::Error +lldb_private::Status PlatformDarwin::LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) { // Starting in Fall 2016 OSes, NSLog messages only get mirrored to stderr // if the OS_ACTIVITY_DT_MODE environment variable is set. (It doesn't diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/source/Plugins/Platform/MacOSX/PlatformDarwin.h index 9430c269c27e5..6495609ac495e 100644 --- a/source/Plugins/Platform/MacOSX/PlatformDarwin.h +++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.h @@ -32,7 +32,7 @@ public: //------------------------------------------------------------ // lldb_private::Platform functions //------------------------------------------------------------ - lldb_private::Error + lldb_private::Status ResolveSymbolFile(lldb_private::Target &target, const lldb_private::ModuleSpec &sym_spec, lldb_private::FileSpec &sym_file) override; @@ -41,7 +41,7 @@ public: lldb_private::Target *target, lldb_private::Module &module, lldb_private::Stream *feedback_stream) override; - lldb_private::Error + lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, @@ -79,7 +79,7 @@ public: lldb_private::FileSpec LocateExecutable(const char *basename) override; - lldb_private::Error + lldb_private::Status LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) override; static std::tuple<uint32_t, uint32_t, uint32_t, llvm::StringRef> @@ -90,7 +90,7 @@ protected: void ReadLibdispatchOffsets(lldb_private::Process *process); - virtual lldb_private::Error GetSharedModuleWithLocalCache( + virtual lldb_private::Status GetSharedModuleWithLocalCache( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr); diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index 08df0565acc87..f168fb6fda5e8 100644 --- a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -31,9 +31,9 @@ #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" #include "llvm/Support/FileSystem.h" @@ -664,11 +664,11 @@ bool PlatformDarwinKernel::KernelHasdSYMSibling(const FileSpec &kernel_binary) { return false; } -Error PlatformDarwinKernel::GetSharedModule( +Status PlatformDarwinKernel::GetSharedModule( const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { - Error error; + Status error; module_sp.reset(); const FileSpec &platform_file = module_spec.GetFileSpec(); @@ -774,10 +774,10 @@ Error PlatformDarwinKernel::GetSharedModule( old_module_sp_ptr, did_create_ptr); } -Error PlatformDarwinKernel::ExamineKextForMatchingUUID( +Status PlatformDarwinKernel::ExamineKextForMatchingUUID( const FileSpec &kext_bundle_path, const lldb_private::UUID &uuid, const ArchSpec &arch, ModuleSP &exe_module_sp) { - Error error; + Status error; FileSpec exe_file = kext_bundle_path; Host::ResolveExecutableInBundle(exe_file); if (exe_file.Exists()) { diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h index 6ee5916e613a7..9b3ec5e0d7179 100644 --- a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h +++ b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h @@ -66,7 +66,7 @@ public: void GetStatus(lldb_private::Stream &strm) override; - lldb_private::Error + lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, @@ -139,7 +139,7 @@ protected: static bool KernelHasdSYMSibling(const lldb_private::FileSpec &kext_bundle_filepath); - lldb_private::Error + lldb_private::Status ExamineKextForMatchingUUID(const lldb_private::FileSpec &kext_bundle_path, const lldb_private::UUID &uuid, const lldb_private::ArchSpec &arch, diff --git a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp index 11d0457a783e4..c08417a80ae42 100644 --- a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -27,9 +27,9 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBufferHeap.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" using namespace lldb; @@ -190,7 +190,7 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) { int signo = 0; std::string output; const char *command = "xcrun -sdk macosx --show-sdk-path"; - lldb_private::Error error = RunShellCommand( + lldb_private::Status error = RunShellCommand( command, // shell command to run NULL, // current working directory &status, // Put the exit status of the process in here @@ -235,9 +235,9 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) { return ConstString(); } -Error PlatformMacOSX::GetSymbolFile(const FileSpec &platform_file, - const UUID *uuid_ptr, - FileSpec &local_file) { +Status PlatformMacOSX::GetSymbolFile(const FileSpec &platform_file, + const UUID *uuid_ptr, + FileSpec &local_file) { if (IsRemote()) { if (m_remote_platform_sp) return m_remote_platform_sp->GetFileWithUUID(platform_file, uuid_ptr, @@ -246,10 +246,10 @@ Error PlatformMacOSX::GetSymbolFile(const FileSpec &platform_file, // Default to the local case local_file = platform_file; - return Error(); + return Status(); } -lldb_private::Error +lldb_private::Status PlatformMacOSX::GetFileWithUUID(const lldb_private::FileSpec &platform_file, const lldb_private::UUID *uuid_ptr, lldb_private::FileSpec &local_file) { @@ -263,7 +263,7 @@ PlatformMacOSX::GetFileWithUUID(const lldb_private::FileSpec &platform_file, if (local_os_build.compare(remote_os_build) == 0) { // same OS version: the local file is good enough local_file = platform_file; - return Error(); + return Status(); } else { // try to find the file in the cache std::string cache_path(GetLocalCacheDirectory()); @@ -272,13 +272,14 @@ PlatformMacOSX::GetFileWithUUID(const lldb_private::FileSpec &platform_file, FileSpec module_cache_spec(cache_path, false); if (module_cache_spec.Exists()) { local_file = module_cache_spec; - return Error(); + return Status(); } // bring in the remote module file FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent(); // try to make the local directory first - Error err(llvm::sys::fs::create_directory(module_cache_folder.GetPath())); + Status err( + llvm::sys::fs::create_directory(module_cache_folder.GetPath())); if (err.Fail()) return err; err = GetFile(platform_file, module_cache_spec); @@ -286,13 +287,13 @@ PlatformMacOSX::GetFileWithUUID(const lldb_private::FileSpec &platform_file, return err; if (module_cache_spec.Exists()) { local_file = module_cache_spec; - return Error(); + return Status(); } else - return Error("unable to obtain valid module file"); + return Status("unable to obtain valid module file"); } } local_file = platform_file; - return Error(); + return Status(); } bool PlatformMacOSX::GetSupportedArchitectureAtIndex(uint32_t idx, @@ -304,12 +305,12 @@ bool PlatformMacOSX::GetSupportedArchitectureAtIndex(uint32_t idx, #endif } -lldb_private::Error PlatformMacOSX::GetSharedModule( +lldb_private::Status PlatformMacOSX::GetSharedModule( const lldb_private::ModuleSpec &module_spec, Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { - Error error = GetSharedModuleWithLocalCache( + Status error = GetSharedModuleWithLocalCache( module_spec, module_sp, module_search_paths_ptr, old_module_sp_ptr, did_create_ptr); @@ -324,7 +325,7 @@ lldb_private::Error PlatformMacOSX::GetSharedModule( lldb::ModuleSP x86_64_module_sp; lldb::ModuleSP old_x86_64_module_sp; bool did_create = false; - Error x86_64_error = GetSharedModuleWithLocalCache( + Status x86_64_error = GetSharedModuleWithLocalCache( module_spec_x86_64, x86_64_module_sp, module_search_paths_ptr, &old_x86_64_module_sp, &did_create); if (x86_64_module_sp && x86_64_module_sp->GetObjectFile()) { diff --git a/source/Plugins/Platform/MacOSX/PlatformMacOSX.h b/source/Plugins/Platform/MacOSX/PlatformMacOSX.h index d5b5d69f1fb3e..d1e609258d4d7 100644 --- a/source/Plugins/Platform/MacOSX/PlatformMacOSX.h +++ b/source/Plugins/Platform/MacOSX/PlatformMacOSX.h @@ -45,7 +45,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - lldb_private::Error + lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, @@ -56,17 +56,18 @@ public: return GetDescriptionStatic(IsHost()); } - lldb_private::Error GetSymbolFile(const lldb_private::FileSpec &platform_file, - const lldb_private::UUID *uuid_ptr, - lldb_private::FileSpec &local_file); + lldb_private::Status + GetSymbolFile(const lldb_private::FileSpec &platform_file, + const lldb_private::UUID *uuid_ptr, + lldb_private::FileSpec &local_file); - lldb_private::Error + lldb_private::Status GetFile(const lldb_private::FileSpec &source, const lldb_private::FileSpec &destination) override { return PlatformDarwin::GetFile(source, destination); } - lldb_private::Error + lldb_private::Status GetFileWithUUID(const lldb_private::FileSpec &platform_file, const lldb_private::UUID *uuid_ptr, lldb_private::FileSpec &local_file) override; diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp index 6fdaa5997b46a..38facc4aa124c 100644 --- a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp @@ -25,9 +25,9 @@ #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" using namespace lldb; diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp index 1869264309730..bbd8f16989370 100644 --- a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp @@ -25,9 +25,9 @@ #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" using namespace lldb; diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp index 0302e7b3aaf80..f7395fb8cf3d2 100644 --- a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp @@ -22,9 +22,9 @@ #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" using namespace lldb; @@ -75,10 +75,10 @@ void PlatformRemoteDarwinDevice::GetStatus(Stream &strm) { } } -Error PlatformRemoteDarwinDevice::ResolveExecutable( +Status PlatformRemoteDarwinDevice::ResolveExecutable( const ModuleSpec &ms, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr) { - Error error; + Status error; // Nothing special to do here, just use the actual file and architecture ModuleSpec resolved_module_spec(ms); @@ -429,11 +429,11 @@ bool PlatformRemoteDarwinDevice::GetFileInSDK(const char *platform_file_path, return false; } -Error PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file, - const UUID *uuid_ptr, - FileSpec &local_file) { +Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file, + const UUID *uuid_ptr, + FileSpec &local_file) { Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); - Error error; + Status error; char platform_file_path[PATH_MAX]; if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path))) { char resolved_path[PATH_MAX]; @@ -489,7 +489,7 @@ Error PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file, return error; } -Error PlatformRemoteDarwinDevice::GetSharedModule( +Status PlatformRemoteDarwinDevice::GetSharedModule( const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { @@ -500,7 +500,7 @@ Error PlatformRemoteDarwinDevice::GetSharedModule( const FileSpec &platform_file = module_spec.GetFileSpec(); Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); - Error error; + Status error; char platform_file_path[PATH_MAX]; if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path))) { @@ -657,7 +657,7 @@ Error PlatformRemoteDarwinDevice::GetSharedModule( if (path_to_try.Exists()) { ModuleSpec new_module_spec(module_spec); new_module_spec.GetFileSpec() = path_to_try; - Error new_error(Platform::GetSharedModule( + Status new_error(Platform::GetSharedModule( new_module_spec, process, module_sp, NULL, old_module_sp_ptr, did_create_ptr)); diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h index 55fb4f920c666..f159e8575d765 100644 --- a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h +++ b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h @@ -30,18 +30,18 @@ public: //------------------------------------------------------------ // lldb_private::Platform functions //------------------------------------------------------------ - lldb_private::Error ResolveExecutable( + lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; void GetStatus(lldb_private::Stream &strm) override; - virtual lldb_private::Error + virtual lldb_private::Status GetSymbolFile(const lldb_private::FileSpec &platform_file, const lldb_private::UUID *uuid_ptr, lldb_private::FileSpec &local_file); - lldb_private::Error + lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index ec1109fb4b44d..c52b636c8496f 100644 --- a/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -22,9 +22,9 @@ #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" using namespace lldb; diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp index 9a082c701f028..3037dd854be70 100644 --- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -24,9 +24,9 @@ #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" #include "llvm/Support/FileSystem.h" @@ -177,10 +177,10 @@ void PlatformiOSSimulator::GetStatus(Stream &strm) { PlatformAppleSimulator::GetStatus(strm); } -Error PlatformiOSSimulator::ResolveExecutable( +Status PlatformiOSSimulator::ResolveExecutable( const ModuleSpec &module_spec, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr) { - Error error; + Status error; // Nothing special to do here, just use the actual file and architecture ModuleSpec resolved_module_spec(module_spec); @@ -306,10 +306,10 @@ const char *PlatformiOSSimulator::GetSDKDirectoryAsCString() { return NULL; } -Error PlatformiOSSimulator::GetSymbolFile(const FileSpec &platform_file, - const UUID *uuid_ptr, - FileSpec &local_file) { - Error error; +Status PlatformiOSSimulator::GetSymbolFile(const FileSpec &platform_file, + const UUID *uuid_ptr, + FileSpec &local_file) { + Status error; char platform_file_path[PATH_MAX]; if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path))) { char resolved_path[PATH_MAX]; @@ -338,7 +338,7 @@ Error PlatformiOSSimulator::GetSymbolFile(const FileSpec &platform_file, return error; } -Error PlatformiOSSimulator::GetSharedModule( +Status PlatformiOSSimulator::GetSharedModule( const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { @@ -346,7 +346,7 @@ Error PlatformiOSSimulator::GetSharedModule( // system. So first we ask for the file in the cached SDK, // then we attempt to get a shared module for the right architecture // with the right UUID. - Error error; + Status error; ModuleSpec platform_module_spec(module_spec); const FileSpec &platform_file = module_spec.GetFileSpec(); error = GetSymbolFile(platform_file, module_spec.GetUUIDPtr(), diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h index c8c7872b530db..2d81d6229f73a 100644 --- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h +++ b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h @@ -51,7 +51,7 @@ public: //------------------------------------------------------------ // lldb_private::Platform functions //------------------------------------------------------------ - lldb_private::Error ResolveExecutable( + lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; @@ -59,12 +59,12 @@ public: void GetStatus(lldb_private::Stream &strm) override; - virtual lldb_private::Error + virtual lldb_private::Status GetSymbolFile(const lldb_private::FileSpec &platform_file, const lldb_private::UUID *uuid_ptr, lldb_private::FileSpec &local_file); - lldb_private::Error + lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h b/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h index 2a2a6f73a0e12..31e11a60e4196 100644 --- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h +++ b/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h @@ -27,7 +27,7 @@ typedef void *id; #include "lldb/Interpreter/Args.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Utility/ConstString.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include "llvm/ADT/Optional.h" @@ -39,17 +39,17 @@ public: explicit operator bool() { return m_pid != LLDB_INVALID_PROCESS_ID; } - lldb_private::Error GetError() { return m_error; } + lldb_private::Status GetError() { return m_error; } private: Process(lldb::pid_t p); - Process(lldb_private::Error error); + Process(lldb_private::Status error); - Process(lldb::pid_t p, lldb_private::Error error); + Process(lldb::pid_t p, lldb_private::Status error); lldb::pid_t m_pid; - lldb_private::Error m_error; + lldb_private::Status m_error; friend class Device; }; @@ -165,9 +165,9 @@ public: State GetState(); - bool Boot(lldb_private::Error &err); + bool Boot(lldb_private::Status &err); - bool Shutdown(lldb_private::Error &err); + bool Shutdown(lldb_private::Status &err); std::string GetUDID() const; diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm b/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm index de92aa0de7aaa..6a49b645c1e17 100644 --- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm +++ b/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm @@ -61,10 +61,10 @@ using namespace lldb_utility; CoreSimulatorSupport::Process::Process(lldb::pid_t p) : m_pid(p), m_error() {} -CoreSimulatorSupport::Process::Process(Error error) +CoreSimulatorSupport::Process::Process(Status error) : m_pid(LLDB_INVALID_PROCESS_ID), m_error(error) {} -CoreSimulatorSupport::Process::Process(lldb::pid_t p, Error error) +CoreSimulatorSupport::Process::Process(lldb::pid_t p, Status error) : m_pid(p), m_error(error) {} CoreSimulatorSupport::DeviceType::DeviceType() @@ -345,7 +345,7 @@ operator!=(const CoreSimulatorSupport::ModelIdentifier &lhs, return false; } -bool CoreSimulatorSupport::Device::Boot(Error &err) { +bool CoreSimulatorSupport::Device::Boot(Status &err) { if (m_dev == nil) { err.SetErrorString("no valid simulator instance"); return false; @@ -371,7 +371,7 @@ bool CoreSimulatorSupport::Device::Boot(Error &err) { } } -bool CoreSimulatorSupport::Device::Shutdown(Error &err) { +bool CoreSimulatorSupport::Device::Shutdown(Status &err) { NSError *nserror; if ([m_dev shutdownWithError:&nserror]) { err.Clear(); @@ -382,10 +382,10 @@ bool CoreSimulatorSupport::Device::Shutdown(Error &err) { } } -static Error HandleFileAction(ProcessLaunchInfo &launch_info, - NSMutableDictionary *options, NSString *key, - const int fd, File &file) { - Error error; +static Status HandleFileAction(ProcessLaunchInfo &launch_info, + NSMutableDictionary *options, NSString *key, + const int fd, File &file) { + Status error; const FileAction *file_action = launch_info.GetFileActionForFD(fd); if (file_action) { switch (file_action->GetAction()) { @@ -426,7 +426,7 @@ static Error HandleFileAction(ProcessLaunchInfo &launch_info, } } } - Error posix_error; + Status posix_error; int created_fd = open(file_spec.GetPath().c_str(), file_action->GetActionArgument(), S_IRUSR | S_IWUSR); @@ -499,7 +499,7 @@ CoreSimulatorSupport::Device::Spawn(ProcessLaunchInfo &launch_info) { [options setObject:env_dict forKey:kSimDeviceSpawnEnvironment]; } - Error error; + Status error; File stdin_file; File stdout_file; File stderr_file; |