[Lldb-commits] [lldb] 12f709d - lldb] Re-enable TestSymbolFileJSON on non Darwin platforms

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 8 22:12:39 PST 2023


Author: Jonas Devlieghere
Date: 2023-03-08T22:12:34-08:00
New Revision: 12f709db0d0e7e8145175e12965c4e3db592143a

URL: https://github.com/llvm/llvm-project/commit/12f709db0d0e7e8145175e12965c4e3db592143a
DIFF: https://github.com/llvm/llvm-project/commit/12f709db0d0e7e8145175e12965c4e3db592143a.diff

LOG: lldb] Re-enable TestSymbolFileJSON on non Darwin platforms

Fix the crash in SymbolVendorELF and re-enable the test.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index 61e06cdfa02df..3595966b42e46 100644
--- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -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,

diff  --git a/lldb/test/API/macosx/symbols/TestSymbolFileJSON.py b/lldb/test/API/macosx/symbols/TestSymbolFileJSON.py
index 2e6d05ac6306e..31814ba5c85e2 100644
--- a/lldb/test/API/macosx/symbols/TestSymbolFileJSON.py
+++ b/lldb/test/API/macosx/symbols/TestSymbolFileJSON.py
@@ -12,7 +12,6 @@ def setUp(self):
         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."""
 


        


More information about the lldb-commits mailing list