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).

llvm-svn: 221196
This commit is contained in:
Greg Clayton 2014-11-03 22:58:38 +00:00
parent 7acb67607b
commit c91d49b505
1 changed files with 9 additions and 1 deletions

View File

@ -252,9 +252,17 @@ class TargetAPITestCase(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