summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-08-05 20:48:30 +0000
committerGreg Clayton <gclayton@apple.com>2011-08-05 20:48:30 +0000
commita17ec9d84d06fcce9dc3746052c704d7f2682056 (patch)
tree888bf4835271a0433786b5b5ed55e6e19df15d0a /lldb/source/Plugins
parent9b97f1c3e624917d86b188c37b937a597cc807b3 (diff)
downloadbcm5719-llvm-a17ec9d84d06fcce9dc3746052c704d7f2682056.tar.gz
bcm5719-llvm-a17ec9d84d06fcce9dc3746052c704d7f2682056.zip
Fixed issues for iOS debugging where if a device has
a native architecture that doesn't match the universal slice that is being used for all executables, we weren't correctly descending through the platform architectures and resolving the binaries. llvm-svn: 136980
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp48
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp8
2 files changed, 32 insertions, 24 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 4eec4c866ef..f735e4fa274 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -929,38 +929,39 @@ DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos ()
if (ReadAllImageInfosStructure ())
{
- if (m_dyld_all_image_infos.dylib_info_count > 0)
+ // Nothing to load or unload?
+ if (m_dyld_all_image_infos.dylib_info_count == 0)
+ return true;
+
+ if (m_dyld_all_image_infos.dylib_info_addr == 0)
{
- if (m_dyld_all_image_infos.dylib_info_addr == 0)
- {
- // DYLD is updating the images now. So we should say we have no images, and then we'll
- // figure it out when we hit the added breakpoint.
- return false;
- }
- else
+ // DYLD is updating the images now. So we should say we have no images, and then we'll
+ // figure it out when we hit the added breakpoint.
+ return false;
+ }
+ else
+ {
+ if (!AddModulesUsingImageInfosAddress (m_dyld_all_image_infos.dylib_info_addr,
+ m_dyld_all_image_infos.dylib_info_count))
{
- if (!AddModulesUsingImageInfosAddress (m_dyld_all_image_infos.dylib_info_addr,
- m_dyld_all_image_infos.dylib_info_count))
- {
- DEBUG_PRINTF( "unable to read all data for all_dylib_infos.");
- m_dyld_image_infos.clear();
- }
+ DEBUG_PRINTF( "unable to read all data for all_dylib_infos.");
+ m_dyld_image_infos.clear();
}
}
-
+
// Now we have one more bit of business. If there is a library left in the images for our target that
// doesn't have a load address, then it must be something that we were expecting to load (for instance we
// read a load command for it) but it didn't in fact load - probably because DYLD_*_PATH pointed
// to an equivalent version. We don't want it to stay in the target's module list or it will confuse
// us, so unload it here.
- Target *target = m_process->CalculateTarget();
- ModuleList &modules = target->GetImages();
+ Target &target = m_process->GetTarget();
+ ModuleList &modules = target.GetImages();
ModuleList not_loaded_modules;
size_t num_modules = modules.GetSize();
- for (size_t i = 0; i < num_modules; i++)
+ for (size_t i = 1; i < num_modules; i++)
{
ModuleSP module_sp = modules.GetModuleAtIndex(i);
- if (!module_sp->IsLoadedInTarget (target))
+ if (!module_sp->IsLoadedInTarget (&target))
{
if (log)
{
@@ -974,9 +975,9 @@ DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos ()
if (not_loaded_modules.GetSize() != 0)
{
- target->ModulesDidUnload(not_loaded_modules);
+ target.ModulesDidUnload(not_loaded_modules);
}
-
+
return true;
}
else
@@ -1182,7 +1183,8 @@ DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(DYLDImageInfo::co
if (exe_idx < image_infos.size())
{
- ModuleSP exe_module_sp (FindTargetModuleForDYLDImageInfo (image_infos[exe_idx], false, NULL));
+ const bool can_create = true;
+ ModuleSP exe_module_sp (FindTargetModuleForDYLDImageInfo (image_infos[exe_idx], can_create, NULL));
if (!exe_module_sp)
{
@@ -1198,7 +1200,7 @@ DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(DYLDImageInfo::co
{
// Don't load dependent images since we are in dyld where we will know
// and find out about all images that are loaded
- bool get_dependent_images = false;
+ const bool get_dependent_images = false;
m_process->GetTarget().SetExecutableModule (exe_module_sp,
get_dependent_images);
}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
index 1bcbbddb9f4..2b83156e759 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
@@ -441,8 +441,13 @@ PlatformRemoteiOS::GetSharedModule (const FileSpec &platform_file,
error = GetFile (platform_file, uuid_ptr, local_file);
if (error.Success())
{
+
+ error = ResolveExecutable (local_file, arch, module_sp);
+ }
+ else
+ {
const bool always_create = false;
- error = ModuleList::GetSharedModule (local_file,
+ error = ModuleList::GetSharedModule (platform_file,
arch,
uuid_ptr,
object_name_ptr,
@@ -451,6 +456,7 @@ PlatformRemoteiOS::GetSharedModule (const FileSpec &platform_file,
old_module_sp_ptr,
did_create_ptr,
always_create);
+
}
if (module_sp)
module_sp->SetPlatformFileSpec(platform_file);
OpenPOWER on IntegriCloud