<rdar://problem/11109570>

The first part of the fix for having LLDB handle LTO debugging when the DWARF is in the .o files. This part separates the object file's modules into a separate cache map that maps unique C strings for the N_OSO path to the ModuleSP since one object file might be mentioned more than once in LTO binaries.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174476 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp
index cd3447c..9ca16d5 100644
--- a/source/Symbol/ObjectFile.cpp
+++ b/source/Symbol/ObjectFile.cpp
@@ -55,7 +55,8 @@
 
                 FileSpec archive_file;
                 ConstString archive_object;
-                if (ObjectFile::SplitArchivePathWithObject (path_with_object, archive_file, archive_object))
+                const bool must_exist = true;
+                if (ObjectFile::SplitArchivePathWithObject (path_with_object, archive_file, archive_object, must_exist))
                 {
                     file_size = archive_file.GetByteSize();
                     if (file_size > 0)
@@ -449,7 +450,7 @@
 
 
 bool
-ObjectFile::SplitArchivePathWithObject (const char *path_with_object, FileSpec &archive_file, ConstString &archive_object)
+ObjectFile::SplitArchivePathWithObject (const char *path_with_object, FileSpec &archive_file, ConstString &archive_object, bool must_exist)
 {
     RegularExpression g_object_regex("(.*)\\(([^\\)]+)\\)$");
     if (g_object_regex.Execute (path_with_object, 2))
@@ -461,6 +462,8 @@
         {
             archive_file.SetFile (path.c_str(), false);
             archive_object.SetCString(obj.c_str());
+            if (must_exist && !archive_file.Exists())
+                return false;
             return true;
         }
     }