lldb] Re-enable TestSymbolFileJSON on non Darwin platforms
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 9 Mar 2023 06:11:23 +0000 (22:11 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 9 Mar 2023 06:12:34 +0000 (22:12 -0800)
Fix the crash in SymbolVendorELF and re-enable the test.

lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
lldb/test/API/macosx/symbols/TestSymbolFileJSON.py

index 61e06cd..3595966 100644 (file)
@@ -111,6 +111,9 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
   SectionList *module_section_list = module_sp->GetSectionList();
   SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList();
 
+  if (!module_section_list || !!objfile_section_list)
+    return nullptr;
+
   static const SectionType g_sections[] = {
       eSectionTypeDWARFDebugAbbrev,     eSectionTypeDWARFDebugAddr,
       eSectionTypeDWARFDebugAranges,    eSectionTypeDWARFDebugCuIndex,
index 2e6d05a..31814ba 100644 (file)
@@ -12,7 +12,6 @@ class TargetSymbolsFileJSON(TestBase):
         self.source = 'main.c'
 
     @no_debug_info_test
-    @skipUnlessDarwin
     def test_symbol_file_json_address(self):
         """Test that 'target symbols add' can load the symbols from a JSON file using file addresses."""