summaryrefslogtreecommitdiff
path: root/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp')
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index c6439a30c8a3..944be9633e00 100644
--- a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -15,7 +15,6 @@
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
-#include "lldb/Core/State.h"
#include "lldb/Expression/DiagnosticManager.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Symbol/ClangASTContext.h"
@@ -32,6 +31,7 @@
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
+#include "lldb/Utility/State.h"
//#define ENABLE_DEBUG_PRINTF // COMMENT THIS LINE OUT PRIOR TO CHECKIN
#ifdef ENABLE_DEBUG_PRINTF
@@ -115,7 +115,7 @@ ModuleSP DynamicLoaderDarwin::FindTargetModuleForImageInfo(
// No UUID, we must rely upon the cached module modification time and the
// modification time of the file on disk
if (module_sp->GetModificationTime() !=
- FileSystem::GetModificationTime(module_sp->GetFileSpec()))
+ FileSystem::Instance().GetModificationTime(module_sp->GetFileSpec()))
module_sp.reset();
}
@@ -359,22 +359,24 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
if (image_sp.get() == nullptr || image_sp->GetAsDictionary() == nullptr)
return false;
StructuredData::Dictionary *image = image_sp->GetAsDictionary();
- if (image->HasKey("load_address") == false ||
- image->HasKey("pathname") == false ||
- image->HasKey("mod_date") == false ||
- image->HasKey("mach_header") == false ||
+ // clang-format off
+ if (!image->HasKey("load_address") ||
+ !image->HasKey("pathname") ||
+ !image->HasKey("mod_date") ||
+ !image->HasKey("mach_header") ||
image->GetValueForKey("mach_header")->GetAsDictionary() == nullptr ||
- image->HasKey("segments") == false ||
+ !image->HasKey("segments") ||
image->GetValueForKey("segments")->GetAsArray() == nullptr ||
- image->HasKey("uuid") == false) {
+ !image->HasKey("uuid")) {
return false;
}
+ // clang-format on
image_infos[i].address =
image->GetValueForKey("load_address")->GetAsInteger()->GetValue();
image_infos[i].mod_date =
image->GetValueForKey("mod_date")->GetAsInteger()->GetValue();
image_infos[i].file_spec.SetFile(
- image->GetValueForKey("pathname")->GetAsString()->GetValue(), false,
+ image->GetValueForKey("pathname")->GetAsString()->GetValue(),
FileSpec::Style::native);
StructuredData::Dictionary *mh =
@@ -400,6 +402,8 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
image_infos[i].os_type = llvm::Triple::TvOS;
else if (os_name == "watchos")
image_infos[i].os_type = llvm::Triple::WatchOS;
+ // NEED_BRIDGEOS_TRIPLE else if (os_name == "bridgeos")
+ // NEED_BRIDGEOS_TRIPLE image_infos[i].os_type = llvm::Triple::BridgeOS;
}
if (image->HasKey("min_version_os_sdk")) {
image_infos[i].min_version_os_sdk =
@@ -513,11 +517,12 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
const size_t image_infos_size = image_infos.size();
for (size_t i = 0; i < image_infos_size; i++) {
if (image_infos[i].header.filetype == llvm::MachO::MH_DYLINKER) {
- // In a "simulator" process (an x86 process that is ios/tvos/watchos) we
- // will have two dyld modules -- a "dyld" that we want to keep track of,
- // and a "dyld_sim" which we don't need to keep track of here. If the
- // target is an x86 system and the OS of the dyld binary is
- // ios/tvos/watchos, then we are looking at dyld_sym.
+ // In a "simulator" process (an x86 process that is
+ // ios/tvos/watchos/bridgeos) we will have two dyld modules --
+ // a "dyld" that we want to keep track of, and a "dyld_sim" which
+ // we don't need to keep track of here. If the target is an x86
+ // system and the OS of the dyld binary is ios/tvos/watchos/bridgeos,
+ // then we are looking at dyld_sym.
// debugserver has only recently (late 2016) started sending up the os
// type for each binary it sees -- so if we don't have an os type, use a
@@ -531,6 +536,7 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
if (image_infos[i].os_type != llvm::Triple::OSType::IOS &&
image_infos[i].os_type != llvm::Triple::TvOS &&
image_infos[i].os_type != llvm::Triple::WatchOS) {
+ // NEED_BRIDGEOS_TRIPLE image_infos[i].os_type != llvm::Triple::BridgeOS) {
dyld_idx = i;
}
}
@@ -555,8 +561,7 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
target.GetImages().AppendIfNeeded(exe_module_sp);
UpdateImageLoadAddress(exe_module_sp.get(), image_infos[exe_idx]);
if (exe_module_sp.get() != target.GetExecutableModulePointer()) {
- const bool get_dependent_images = false;
- target.SetExecutableModule(exe_module_sp, get_dependent_images);
+ target.SetExecutableModule(exe_module_sp, eLoadDependentsNo);
}
}
}
@@ -709,11 +714,7 @@ bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) {
return false;
ObjCLanguageRuntime *objc_runtime = m_process->GetObjCLanguageRuntime();
- if (objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp)) {
- return true;
- }
-
- return false;
+ return objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp);
}
//----------------------------------------------------------------------
@@ -1124,6 +1125,10 @@ bool DynamicLoaderDarwin::UseDYLDSPI(Process *process) {
// watchOS 3 and newer
if (os_type == llvm::Triple::WatchOS && version >= llvm::VersionTuple(3))
use_new_spi_interface = true;
+
+ // NEED_BRIDGEOS_TRIPLE // Any BridgeOS
+ // NEED_BRIDGEOS_TRIPLE if (os_type == llvm::Triple::BridgeOS)
+ // NEED_BRIDGEOS_TRIPLE use_new_spi_interface = true;
}
if (log) {