[Lldb-commits] [lldb] r221197 - Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).

Greg Clayton gclayton at apple.com
Mon Nov 3 15:02:08 PST 2014


Author: gclayton
Date: Mon Nov  3 17:02:08 2014
New Revision: 221197

URL: http://llvm.org/viewvc/llvm-project?rev=221197&view=rev
Log:
Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).


Modified:
    lldb/trunk/test/python_api/section/TestSectionAPI.py

Modified: lldb/trunk/test/python_api/section/TestSectionAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/section/TestSectionAPI.py?rev=221197&r1=221196&r2=221197&view=diff
==============================================================================
--- lldb/trunk/test/python_api/section/TestSectionAPI.py (original)
+++ lldb/trunk/test/python_api/section/TestSectionAPI.py Mon Nov  3 17:02:08 2014
@@ -46,12 +46,21 @@ class SectionAPITestCase(TestBase):
         mod = target.GetModuleAtIndex(0)
         data_section = None
         for s in mod.sections:
-            if ".data" == s.name:
+            sect_type = s.GetSectionType()
+            if sect_type == lldb.eSectionTypeData:
                 data_section = s
                 break
+            elif sect_type == lldb.eSectionTypeContainer:
+                for i in range(s.GetNumSubSections()):
+                    ss = s.GetSubSectionAtIndex(i)
+                    sect_type = ss.GetSectionType()
+                    if sect_type == lldb.eSectionTypeData:
+                        data_section = ss
+                        break                    
 
         self.assertIsNotNone(data_section)
         return data_section
+
         
 if __name__ == '__main__':
     import atexit





More information about the lldb-commits mailing list