forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply [lldb][DWARF] Delay struct/class/union definition DIE search…
…ing when parsing declaration DIEs. (llvm#92328) This reapplies llvm@9a7262c (llvm#90663) and added llvm#91808 as a fix. It was causing tests on macos to fail because `SymbolFileDWARF::GetForwardDeclCompilerTypeToDIE` returned the map owned by this symol file. When there were two symbol files, two different maps were created for caching from compiler type to DIE even if they are for the same module. The solution is to do the same as `SymbolFileDWARF::GetUniqueDWARFASTTypeMap`: inquery SymbolFileDWARFDebugMap first to get the shared underlying SymbolFile so the map is shared among multiple SymbolFileDWARF.
- Loading branch information
Showing
12 changed files
with
467 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
397 changes: 218 additions & 179 deletions
397
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
197 changes: 88 additions & 109 deletions
197
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
lldb/test/Shell/SymbolFile/DWARF/delayed-definition-die-searching.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Test definition DIE searching is delayed until complete type is required. | ||
|
||
# UNSUPPORTED: system-windows | ||
|
||
# RUN: split-file %s %t | ||
# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -gdwarf -o %t.out | ||
# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s | ||
|
||
# CHECK: (lldb) p v1 | ||
# CHECK: DWARFASTParserClang::ParseTypeFromDWARF{{.*}}DW_TAG_structure_type (DW_TAG_structure_type) name = 't2<t1>' | ||
# CHECK: DWARFASTParserClang::ParseTypeFromDWARF{{.*}}DW_TAG_structure_type (DW_TAG_structure_type) name = 't1' | ||
# CHECK: DW_TAG_structure_type (DW_TAG_structure_type) 't2<t1>' resolving forward declaration... | ||
# CHECK: (t2<t1>) {} | ||
# CHECK: (lldb) p v2 | ||
# CHECK: DWARFASTParserClang::ParseTypeFromDWARF{{.*}}DW_TAG_structure_type (DW_TAG_structure_type) name = 't1' | ||
# CHECK: DW_TAG_structure_type (DW_TAG_structure_type) 't1' resolving forward declaration... | ||
|
||
#--- lldb.cmd | ||
log enable dwarf comp | ||
p v1 | ||
p v2 | ||
|
||
#--- main.cpp | ||
template<typename T> | ||
struct t2 { | ||
}; | ||
struct t1; | ||
t2<t1> v1; // this CU doesn't have definition DIE for t1, but only declaration DIE for it. | ||
int main() { | ||
} | ||
|
||
#--- t1_def.cpp | ||
struct t1 { // this CU contains definition DIE for t1. | ||
int x; | ||
}; | ||
t1 v2; |