[Lldb-commits] [lldb] r124803 - /lldb/trunk/source/Target/Target.cpp

Greg Clayton gclayton at apple.com
Thu Feb 3 09:47:47 PST 2011


Author: gclayton
Date: Thu Feb  3 11:47:47 2011
New Revision: 124803

URL: http://llvm.org/viewvc/llvm-project?rev=124803&view=rev
Log:
Removed a memory map loading of a file where the mmap contents were just
being read directly into a string. The use of memory mapping here was useless.


Modified:
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=124803&r1=124802&r2=124803&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Thu Feb  3 11:47:47 2011
@@ -1174,18 +1174,17 @@
                     return;
                 }
                 
-                DataBufferMemoryMap buf;
+                DataBufferSP data_sp (file_spec.ReadFileContents());
                 
-                if (!buf.MemoryMapFromFileSpec(&file_spec) &&
-                    buf.GetError().Fail())
+                if (!data_sp && data_sp->GetByteSize() == 0)
                 {
                     err.SetErrorToGenericError ();
-                    err.SetErrorStringWithFormat ("Couldn't read from %s: %s\n", value, buf.GetError().AsCString());
+                    err.SetErrorStringWithFormat ("Couldn't read from %s\n", value);
                     return;
                 }
                 
                 m_expr_prefix_path = value;
-                m_expr_prefix_contents.assign(reinterpret_cast<const char *>(buf.GetBytes()), buf.GetByteSize());
+                m_expr_prefix_contents.assign(reinterpret_cast<const char *>(data_sp->GetBytes()), data_sp->GetByteSize());
             }
             return;
         case lldb::eVarSetOperationAppend:





More information about the lldb-commits mailing list