[Lldb-commits] [lldb] r155850 - in /lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX: PlatformRemoteiOS.cpp PlatformRemoteiOS.h

Johnny Chen johnny.chen at apple.com
Mon Apr 30 15:30:06 PDT 2012


Author: johnny
Date: Mon Apr 30 17:30:05 2012
New Revision: 155850

URL: http://llvm.org/viewvc/llvm-project?rev=155850&view=rev
Log:
PlatformRemoteiOS can inherit from PlatformDarwin::ResolveExecutable().  The method impl in PlatformRemoteiOS looks stale.

Modified:
    lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h

Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=155850&r1=155849&r2=155850&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Mon Apr 30 17:30:05 2012
@@ -176,90 +176,6 @@
 }
 
 
-Error
-PlatformRemoteiOS::ResolveExecutable (const FileSpec &exe_file,
-                                      const ArchSpec &exe_arch,
-                                      lldb::ModuleSP &exe_module_sp,
-                                      const FileSpecList *module_search_paths_ptr)
-{
-    Error error;
-    // Nothing special to do here, just use the actual file and architecture
-
-    FileSpec resolved_exe_file (exe_file);
-    
-    // If we have "ls" as the exe_file, resolve the executable loation based on
-    // the current path variables
-    // TODO: resolve bare executables in the Platform SDK
-//    if (!resolved_exe_file.Exists())
-//        resolved_exe_file.ResolveExecutableLocation ();
-
-    // Resolve any executable within a bundle on MacOSX
-    // TODO: verify that this handles shallow bundles, if not then implement one ourselves
-    Host::ResolveExecutableInBundle (resolved_exe_file);
-
-    if (resolved_exe_file.Exists())
-    {
-        if (exe_arch.IsValid())
-        {
-            ModuleSpec module_spec (resolved_exe_file, exe_arch);
-            error = ModuleList::GetSharedModule (module_spec,
-                                                 exe_module_sp, 
-                                                 NULL,
-                                                 NULL, 
-                                                 NULL);
-        
-            if (exe_module_sp && exe_module_sp->GetObjectFile())
-                return error;
-            exe_module_sp.reset();
-        }
-        // No valid architecture was specified or the exact ARM slice wasn't
-        // found so ask the platform for the architectures that we should be
-        // using (in the correct order) and see if we can find a match that way
-        StreamString arch_names;
-        ArchSpec platform_arch;
-        for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, platform_arch); ++idx)
-        {
-            ModuleSpec module_spec (resolved_exe_file, platform_arch);
-            error = ModuleList::GetSharedModule (module_spec, 
-                                                 exe_module_sp, 
-                                                 NULL,
-                                                 NULL, 
-                                                 NULL);
-            // Did we find an executable using one of the 
-            if (error.Success())
-            {
-                if (exe_module_sp && exe_module_sp->GetObjectFile())
-                    break;
-                else
-                    error.SetErrorToGenericError();
-            }
-            
-            if (idx > 0)
-                arch_names.PutCString (", ");
-            arch_names.PutCString (platform_arch.GetArchitectureName());
-        }
-        
-        if (error.Fail() || !exe_module_sp)
-        {
-            error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain any '%s' platform architectures: %s",
-                                            exe_file.GetDirectory().AsCString(""),
-                                            exe_file.GetDirectory() ? "/" : "",
-                                            exe_file.GetFilename().AsCString(""),
-                                            GetShortPluginName(),
-                                            arch_names.GetString().c_str());
-        }
-    }
-    else
-    {
-        error.SetErrorStringWithFormat ("'%s%s%s' does not exist",
-                                        exe_file.GetDirectory().AsCString(""),
-                                        exe_file.GetDirectory() ? "/" : "",
-                                        exe_file.GetFilename().AsCString(""));
-    }
-
-    return error;
-}
-
 FileSpec::EnumerateDirectoryResult 
 PlatformRemoteiOS::GetContainedFilesIntoVectorOfStringsCallback (void *baton,
                                                                  FileSpec::FileType file_type,

Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h?rev=155850&r1=155849&r2=155850&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h Mon Apr 30 17:30:05 2012
@@ -75,12 +75,6 @@
     //------------------------------------------------------------
     // lldb_private::Platform functions
     //------------------------------------------------------------
-    virtual lldb_private::Error
-    ResolveExecutable (const lldb_private::FileSpec &exe_file,
-                       const lldb_private::ArchSpec &arch,
-                       lldb::ModuleSP &module_sp,
-                       const lldb_private::FileSpecList *module_search_paths_ptr);
-
     virtual const char *
     GetDescription ()
     {





More information about the lldb-commits mailing list