[Lldb-commits] [lldb] r134872 - /lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Greg Clayton gclayton at apple.com
Sun Jul 10 10:32:34 PDT 2011


Author: gclayton
Date: Sun Jul 10 12:32:33 2011
New Revision: 134872

URL: http://llvm.org/viewvc/llvm-project?rev=134872&view=rev
Log:
Fixed an assertion crasher. We now handle things correclty and 
emit an error to stderr when we see this issue.


Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=134872&r1=134871&r2=134872&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Sun Jul 10 12:32:33 2011
@@ -675,9 +675,15 @@
             {
                 Section *section = m_section_list->FindSectionByID (n_sect).get();
                 m_section_infos[n_sect].section = section;
-                assert (section != NULL);
-                m_section_infos[n_sect].vm_range.SetBaseAddress (section->GetFileAddress());
-                m_section_infos[n_sect].vm_range.SetByteSize (section->GetByteSize());
+                if (section != NULL)
+                {
+                    m_section_infos[n_sect].vm_range.SetBaseAddress (section->GetFileAddress());
+                    m_section_infos[n_sect].vm_range.SetByteSize (section->GetByteSize());
+                }
+                else
+                {
+                    fprintf (stderr, "error: unable to find section for section %u\n", n_sect);
+                }
             }
             if (m_section_infos[n_sect].vm_range.Contains(file_addr))
                 return m_section_infos[n_sect].section;





More information about the lldb-commits mailing list