diff options
| author | Adrian Prantl <aprantl@apple.com> | 2017-07-23 17:59:07 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2017-07-23 17:59:07 +0000 |
| commit | 651166c2d2d8569cd8d0c62ed15f0647fc09c167 (patch) | |
| tree | 7a5770b4cf035aabae8e3fc1d3cf04ae5b9d40bf | |
| parent | 9b2b4c961aa80b83ce78e1d6c65522fc02584fe3 (diff) | |
| download | bcm5719-llvm-651166c2d2d8569cd8d0c62ed15f0647fc09c167.tar.gz bcm5719-llvm-651166c2d2d8569cd8d0c62ed15f0647fc09c167.zip | |
Fix PR33875 by distinguishing between DWO and clang modules
The DWO handling code can get confused by clang modules which also use
skeleton CUs to point to the object file with the full debug
info. This patch detects whether an object is a "real" DWO or a clang
module and prevents LLDB from interpreting clang modules as DWO. This
fixes the regression in TestWithModuleDebugging.
http://llvm.org/bugs/show_bug.cgi?id=33875
Differential Revision: https://reviews.llvm.org/D35740
llvm-svn: 308850
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py | 2 | ||||
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py index 2871f69aea7..dcc9206867b 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py @@ -9,8 +9,6 @@ class TestWithGmodulesDebugInfo(TestBase): mydir = TestBase.compute_mydir(__file__) - @expectedFailureAll(bugnumber="llvm.org/pr33875", oslist=["linux"], - compiler="clang", compiler_version=[">", "6.0"]) @add_test_categories(["gmodules"]) def test_specialized_typedef_from_pch(self): self.build() diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp index c14ebd1628b..14ba35c7c98 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp @@ -61,6 +61,12 @@ SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit *dwarf_cu, } DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() { + // A clang module is found via a skeleton CU, but is not a proper DWO. + // Clang modules have a .debug_info section instead of the *_dwo variant. + if (auto *section_list = m_obj_file->GetSectionList(false)) + if (section_list->FindSectionByType(eSectionTypeDWARFDebugInfo, true)) + return nullptr; + // Only dwo files with 1 compile unit is supported if (GetNumCompileUnits() == 1) return DebugInfo()->GetCompileUnitAtIndex(0); |

