diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/Host/linux/LibcGlue.cpp | 8 | ||||
-rw-r--r-- | source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 77 | ||||
-rw-r--r-- | source/Plugins/Platform/MacOSX/PlatformDarwin.h | 8 | ||||
-rw-r--r-- | source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp | 4 | ||||
-rw-r--r-- | source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp | 68 | ||||
-rw-r--r-- | source/Symbol/ClangASTContext.cpp | 5 |
6 files changed, 102 insertions, 68 deletions
diff --git a/source/Host/linux/LibcGlue.cpp b/source/Host/linux/LibcGlue.cpp index c036bb28a9bc8..93d2a41d2eb10 100644 --- a/source/Host/linux/LibcGlue.cpp +++ b/source/Host/linux/LibcGlue.cpp @@ -14,13 +14,13 @@ #include <sys/syscall.h> #include <unistd.h> -#ifndef HAVE_PROCESS_VM_READV // If the syscall wrapper is not available, - // provide one. +#if !HAVE_PROCESS_VM_READV +// If the syscall wrapper is not available, provide one. ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov, unsigned long liovcnt, const struct iovec *remote_iov, unsigned long riovcnt, unsigned long flags) { -#ifdef HAVE_NR_PROCESS_VM_READV // If we have the syscall number, we can issue - // the syscall ourselves. +#if HAVE_NR_PROCESS_VM_READV + // If we have the syscall number, we can issue the syscall ourselves. return syscall(__NR_process_vm_readv, pid, local_iov, liovcnt, remote_iov, riovcnt, flags); #else // If not, let's pretend the syscall is not present. diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index d69a02e41d514..a29cc9e1ed868 100644 --- a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -33,6 +33,7 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/SymbolVendor.h" +#include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBufferLLVM.h" @@ -1763,3 +1764,79 @@ PlatformDarwin::LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) { // Let our parent class do the real launching. return PlatformPOSIX::LaunchProcess(launch_info); } + +lldb_private::Status +PlatformDarwin::FindBundleBinaryInExecSearchPaths (const ModuleSpec &module_spec, Process *process, + ModuleSP &module_sp, + const FileSpecList *module_search_paths_ptr, + ModuleSP *old_module_sp_ptr, bool *did_create_ptr) +{ + const FileSpec &platform_file = module_spec.GetFileSpec(); + // See if the file is present in any of the module_search_paths_ptr directories. + if (!module_sp && module_search_paths_ptr && platform_file) { + // create a vector of all the file / directory names in platform_file + // e.g. this might be + // /System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation + // + // We'll need to look in the module_search_paths_ptr directories for + // both "UIFoundation" and "UIFoundation.framework" -- most likely the + // latter will be the one we find there. + + FileSpec platform_pull_apart(platform_file); + std::vector<std::string> path_parts; + ConstString unix_root_dir("/"); + while (true) { + ConstString part = platform_pull_apart.GetLastPathComponent(); + platform_pull_apart.RemoveLastPathComponent(); + if (part.IsEmpty() || part == unix_root_dir) + break; + path_parts.push_back(part.AsCString()); + } + const size_t path_parts_size = path_parts.size(); + + size_t num_module_search_paths = module_search_paths_ptr->GetSize(); + for (size_t i = 0; i < num_module_search_paths; ++i) { + Log *log_verbose = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); + if (log_verbose) + log_verbose->Printf ("PlatformRemoteDarwinDevice::GetSharedModule searching for binary in search-path %s", module_search_paths_ptr->GetFileSpecAtIndex(i).GetPath().c_str()); + // Create a new FileSpec with this module_search_paths_ptr + // plus just the filename ("UIFoundation"), then the parent + // dir plus filename ("UIFoundation.framework/UIFoundation") + // etc - up to four names (to handle "Foo.framework/Contents/MacOS/Foo") + + for (size_t j = 0; j < 4 && j < path_parts_size - 1; ++j) { + FileSpec path_to_try(module_search_paths_ptr->GetFileSpecAtIndex(i)); + + // Add the components backwards. For + // .../PrivateFrameworks/UIFoundation.framework/UIFoundation + // path_parts is + // [0] UIFoundation + // [1] UIFoundation.framework + // [2] PrivateFrameworks + // + // and if 'j' is 2, we want to append path_parts[1] and then + // path_parts[0], aka + // 'UIFoundation.framework/UIFoundation', to the module_search_paths_ptr + // path. + + for (int k = j; k >= 0; --k) { + path_to_try.AppendPathComponent(path_parts[k]); + } + + if (path_to_try.Exists()) { + ModuleSpec new_module_spec(module_spec); + new_module_spec.GetFileSpec() = path_to_try; + Status new_error(Platform::GetSharedModule( + new_module_spec, process, module_sp, NULL, old_module_sp_ptr, + did_create_ptr)); + + if (module_sp) { + module_sp->SetPlatformFileSpec(path_to_try); + return new_error; + } + } + } + } + } + return Status(); +} diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/source/Plugins/Platform/MacOSX/PlatformDarwin.h index 6495609ac495e..c04318e98cae0 100644 --- a/source/Plugins/Platform/MacOSX/PlatformDarwin.h +++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.h @@ -128,9 +128,15 @@ protected: std::vector<std::string> &options, SDKType sdk_type); + const char *GetDeveloperDirectory(); + + lldb_private::Status + FindBundleBinaryInExecSearchPaths (const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, + lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, + lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr); + std::string m_developer_directory; - const char *GetDeveloperDirectory(); private: DISALLOW_COPY_AND_ASSIGN(PlatformDarwin); diff --git a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp index c08417a80ae42..43f4d8bbf0235 100644 --- a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -339,5 +339,9 @@ lldb_private::Status PlatformMacOSX::GetSharedModule( } } } + + if (!module_sp) { + error = FindBundleBinaryInExecSearchPaths (module_spec, process, module_sp, module_search_paths_ptr, old_module_sp_ptr, did_create_ptr); + } return error; } diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp index f7395fb8cf3d2..ea44714a916e4 100644 --- a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp @@ -605,70 +605,12 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( // See if the file is present in any of the module_search_paths_ptr // directories. - if (!module_sp && module_search_paths_ptr && platform_file) { - // create a vector of all the file / directory names in platform_file - // e.g. this might be - // /System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation - // - // We'll need to look in the module_search_paths_ptr directories for - // both "UIFoundation" and "UIFoundation.framework" -- most likely the - // latter will be the one we find there. - - FileSpec platform_pull_apart(platform_file); - std::vector<std::string> path_parts; - ConstString unix_root_dir("/"); - while (true) { - ConstString part = platform_pull_apart.GetLastPathComponent(); - platform_pull_apart.RemoveLastPathComponent(); - if (part.IsEmpty() || part == unix_root_dir) - break; - path_parts.push_back(part.AsCString()); - } - const size_t path_parts_size = path_parts.size(); - - size_t num_module_search_paths = module_search_paths_ptr->GetSize(); - for (size_t i = 0; i < num_module_search_paths; ++i) { - LLDB_LOGV(log, "searching for binary in search-path {0}", - module_search_paths_ptr->GetFileSpecAtIndex(i)); - // Create a new FileSpec with this module_search_paths_ptr - // plus just the filename ("UIFoundation"), then the parent - // dir plus filename ("UIFoundation.framework/UIFoundation") - // etc - up to four names (to handle "Foo.framework/Contents/MacOS/Foo") - - for (size_t j = 0; j < 4 && j < path_parts_size - 1; ++j) { - FileSpec path_to_try(module_search_paths_ptr->GetFileSpecAtIndex(i)); - - // Add the components backwards. For - // .../PrivateFrameworks/UIFoundation.framework/UIFoundation - // path_parts is - // [0] UIFoundation - // [1] UIFoundation.framework - // [2] PrivateFrameworks - // - // and if 'j' is 2, we want to append path_parts[1] and then - // path_parts[0], aka - // 'UIFoundation.framework/UIFoundation', to the module_search_paths_ptr - // path. - - for (int k = j; k >= 0; --k) { - path_to_try.AppendPathComponent(path_parts[k]); - } - - if (path_to_try.Exists()) { - ModuleSpec new_module_spec(module_spec); - new_module_spec.GetFileSpec() = path_to_try; - Status new_error(Platform::GetSharedModule( - new_module_spec, process, module_sp, NULL, old_module_sp_ptr, - did_create_ptr)); + if (!module_sp) + error = PlatformDarwin::FindBundleBinaryInExecSearchPaths (module_spec, process, module_sp, + module_search_paths_ptr, old_module_sp_ptr, did_create_ptr); - if (module_sp) { - module_sp->SetPlatformFileSpec(path_to_try); - return new_error; - } - } - } - } - } + if (error.Success()) + return error; const bool always_create = false; error = ModuleList::GetSharedModule( diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp index 94c91fe335a75..c8738e6e55026 100644 --- a/source/Symbol/ClangASTContext.cpp +++ b/source/Symbol/ClangASTContext.cpp @@ -3938,6 +3938,11 @@ ClangASTContext::GetTypeInfo(lldb::opaque_compiler_type_t type, const clang::Type::TypeClass type_class = qual_type->getTypeClass(); switch (type_class) { + case clang::Type::Attributed: + return GetTypeInfo( + qual_type->getAs<clang::AttributedType>() + ->getModifiedType().getAsOpaquePtr(), + pointee_or_element_clang_type); case clang::Type::Builtin: { const clang::BuiltinType *builtin_type = llvm::dyn_cast<clang::BuiltinType>( qual_type->getCanonicalTypeInternal()); |