Add a new Section::SetFileAddress method to change a Section's file
address.

When loading a dSYM, and the file addresses of the dSYM Sections are
different than the executable binary Sections' file addresses, the
debug info won't be remapped to the actual load addresses correctly.
This only happens with binaries on the in-memory shared cache binaries
where their File addresses have been set to their actual load address
(outside an offset value) whereas the original executable and dSYM
have 0-based File addresses.

I think this patch will not be activated for other cases -- this is
the only case we know of where the dSYM and the executable's File
addresses differ -- but if this causes other problems we can restrict
it more carefully.

<rdar://problem/12335086> 

llvm-svn: 188532
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index 492abec..e2a084c 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -98,6 +98,24 @@
     return m_file_addr;
 }
 
+bool
+Section::SetFileAddress (lldb::addr_t file_addr)
+{
+    SectionSP parent_sp (GetParent ());
+    if (parent_sp)
+    {
+        if (m_file_addr >= file_addr)
+            return parent_sp->SetFileAddress (m_file_addr - file_addr);
+        return false;
+    }
+    else
+    {
+        // This section has no parent, so m_file_addr is the file base address
+        m_file_addr = file_addr;
+        return true;
+    }
+}
+
 lldb::addr_t
 Section::GetOffset () const
 {