[Lldb-commits] [lldb] r136980 - in /lldb/trunk: include/lldb/API/SBType.h source/API/SBType.cpp source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp source/Symbol/ClangASTContext.cpp

Greg Clayton gclayton at apple.com
Fri Aug 5 13:48:30 PDT 2011


Author: gclayton
Date: Fri Aug  5 15:48:30 2011
New Revision: 136980

URL: http://llvm.org/viewvc/llvm-project?rev=136980&view=rev
Log:
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.


Modified:
    lldb/trunk/include/lldb/API/SBType.h
    lldb/trunk/source/API/SBType.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/include/lldb/API/SBType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBType.h?rev=136980&r1=136979&r2=136980&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBType.h (original)
+++ lldb/trunk/include/lldb/API/SBType.h Fri Aug  5 15:48:30 2011
@@ -71,6 +71,10 @@
         
     const char*
     GetName();
+    
+    // DEPRECATED: but needed for Xcode right now
+    static bool
+    IsPointerType (void * clang_type);
         
 protected:
     lldb::TypeImplSP m_opaque_sp;

Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=136980&r1=136979&r2=136980&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Fri Aug  5 15:48:30 2011
@@ -356,4 +356,17 @@
 
 SBTypeList::~SBTypeList()
 {
-}
\ No newline at end of file
+}
+
+bool
+SBType::IsPointerType (void *opaque_type)
+{
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    
+    bool ret_value = ClangASTContext::IsPointerType (opaque_type);
+    
+    if (log)
+        log->Printf ("SBType::IsPointerType (opaque_type=%p) ==> '%s'", opaque_type, (ret_value ? "true" : "false"));
+    
+    return ret_value;
+}

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=136980&r1=136979&r2=136980&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Fri Aug  5 15:48:30 2011
@@ -929,38 +929,39 @@
 
     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
+        {
+            if (!AddModulesUsingImageInfosAddress (m_dyld_all_image_infos.dylib_info_addr, 
+                                                   m_dyld_all_image_infos.dylib_info_count))
             {
-                // 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))
-                {
-                    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 @@
         
         if (not_loaded_modules.GetSize() != 0)
         {
-            target->ModulesDidUnload(not_loaded_modules);
+            target.ModulesDidUnload(not_loaded_modules);
         }
-        
+
         return true;
     }
     else
@@ -1182,7 +1183,8 @@
 
     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 @@
             {
                 // 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);
             }

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=136980&r1=136979&r2=136980&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Fri Aug  5 15:48:30 2011
@@ -441,8 +441,13 @@
     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 @@
                                              old_module_sp_ptr,
                                              did_create_ptr,
                                              always_create);
+
     }
     if (module_sp)
         module_sp->SetPlatformFileSpec(platform_file);

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=136980&r1=136979&r2=136980&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Aug  5 15:48:30 2011
@@ -413,12 +413,6 @@
 {
     Clear();
     m_target_triple.assign(target_triple);
-    if (m_target_triple.find("armv7s") == 0)
-        m_target_triple.erase(5,1);
-    else if (m_target_triple.find("armv7f") == 0)
-        m_target_triple.erase(5,1);
-    else if (m_target_triple.find("armv7k") == 0)
-        m_target_triple.erase(5,1);
 }
 
 void





More information about the lldb-commits mailing list