ZequanWu wrote:
It actually still crashes at the same place even without this PR using the
following command, you can try it on trunk:
```
$ rm -rf lldb/test/API/commands/expression/import-std-module/lldb-api/*
$ out/cmake/bin/lldb-dotest
ZequanWu wrote:
I had a fix to this: Let `SymbolFileDWARF::GetForwardDeclCompilerTypeToDIE` do
the same as `SymbolFileDWARF::GetUniqueDWARFASTTypeMap`: inquery
SymbolFileDWARFDebugMap first to get the shared underlying SymbolFile so the
map is shared among multiple SymbolFileDWARF. It's
adrian-prantl wrote:
> Thanks. Can you provide instructions to repro the failure locally?
The bot log should have the cmake line and all the commands that were run there.
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
jimingham wrote:
Thanks!
Jim
> On May 13, 2024, at 6:39 PM, Zequan Wu ***@***.***> wrote:
>
>
> Can you take care of cleaning this up, this seems like a slightly complex
> patch and not in an area I'm familiar with.
>
> Yes, will do. Sorry for the mess without reverting it earlier.
>
> —
jimingham wrote:
Can you take care of cleaning this up, this seems like a slightly complex patch
and not in an area I'm familiar with.
Thanks!
Jim
> On May 13, 2024, at 6:35 PM, Zequan Wu ***@***.***> wrote:
>
>
> Reverting those two commits seems to have caused this build failure on
ZequanWu wrote:
> Reverting those two commits seems to have caused this build failure on Ubuntu:
You forgot the delete the newly added test
SymbolFile/DWARF/delayed-definition-die-searching.test in the reverting:
jimingham wrote:
Reverting those two commits seems to have caused this build failure on Ubuntu:
Step 4 (build) warnings: build (warnings)
../llvm-project/clang/lib/Lex/PPDirectives.cpp:548:28: warning: comparison of
integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
1
ZequanWu wrote:
> your commit deleted that file I think, I added it back when I did the revert
> (possibly a mistake)... It passes on my macOS system but is failing on
> Ubuntu after the revert. I think I'll just disable it for now.
This change adds the new test, so deleting it as part of
jimingham wrote:
BTW, do you know what's up with this test:
SymbolFile/DWARF/delayed-definition-die-searching.test
your commit deleted that file I think, I added it back when I did the revert
(possibly a mistake)... It passes on my macOS system but is failing on Ubuntu
after the revert. I
jimingham wrote:
> On May 13, 2024, at 6:04 PM, Zequan Wu ***@***.***> wrote:
>
>
> I was able to reproduce the failure of these three:
>
> lldb-api :: lang/c/forward/TestForwardDeclaration.py
> lldb-api :: lang/cpp/unique-types3/TestUniqueTypes3.py
> lldb-api :: types/TestRecursiveTypes.py
ZequanWu wrote:
> I was able to reproduce the failure of these three:
>
> lldb-api :: lang/c/forward/TestForwardDeclaration.py
> lldb-api :: lang/cpp/unique-types3/TestUniqueTypes3.py
> lldb-api :: types/TestRecursiveTypes.py
>
> locally. Reverting this patch and
>
adrian-prantl wrote:
@ZequanWu in the future, if one of your commits break a bot, make sure to
revert it immediately, you can always re-land it later with a fix or an
explanation why it wasn't your commit that broke the bots. Reverting a commit
is cheap, red bots are expensive :-)
jimingham wrote:
I was able to reproduce the failure of these three:
lldb-api :: lang/c/forward/TestForwardDeclaration.py
lldb-api :: lang/cpp/unique-types3/TestUniqueTypes3.py
lldb-api :: types/TestRecursiveTypes.py
locally. Reverting this patch and
jimingham wrote:
I'm trying to reproduce locally as well. It's pretty clear that this patch is
implicated in the failure. The first failure we saw both on the incremental
bots and the first failure on the sanitized bots both had this patch, and no
other really relevant ones, in the commit
ZequanWu wrote:
> > Could this commit have broken the bots?
> > https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/1897/
>
> Looks like so, but I cannot repro the test failure locally.
The error message is different in current latest build
ZequanWu wrote:
> Could this commit have broken the bots?
> https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/1897/
Looks like so, but I cannot repro the test failure locally.
https://github.com/llvm/llvm-project/pull/90663
___
adrian-prantl wrote:
Could this commit have broken the bots?
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/1897/
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
felipepiovezan wrote:
AFAICT we never added new entries -- definitely not forward declarations -- to
the table when doing the idx_parent work. Either they were already there, or
the entry would have no parent. Would be nice to have an example to see this in
action.
ZequanWu wrote:
I sent an alternative fix at https://github.com/llvm/llvm-project/pull/91799.
> The .debug_names spec states that only entries with definitions should be in
> the .debug_names table...
Do it mean the .debug_names is implemented incorrectly?
clayborg wrote:
See the `/// <<< newly added for fix` comments for the new lines
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
clayborg wrote:
Ok, I found the issue. `.debug_names` tables with `DW_IDX_parent` entries,
might contain tons of entries for forward declared classes because in my
example `std::ios_base` is the parent declaration context for `seekdir`,
`openmode`, and `iostate` so `.debug_names` entries for
ZequanWu wrote:
> The issue might arise from having a .debug_names table that has DW_IDX_parent
> entries that means that there might be forward declarations included in the
> DWARF index.
Do you mean that the searching in the type index returns a declaration DIE (but
I expected it to always
ZequanWu wrote:
> So this DIE is just a declaration. Shouldn't this code have tried to find a
> non declaration DIE for "std::ios_base"?
Yes, I suppose `SymbolFileDWARF::CompleteType` will try to find the definition
DIE for it before calling `DWARFASTParserClang::CompleteTypeFromDWARF`. If
clayborg wrote:
Is `SymbolFileDWARF::CompleteType(...)` responsible for trying to find a
non-declaration DIE first? The issue might arise from having a .debug_names
table that has `DW_IDX_parent` entries that means that there might be forward
declarations included in the DWARF index.
clayborg wrote:
This is causing a clang assertion due:
```
(lldb) type lookup std::ios_base
Assertion failed: (DD && "queried property of class with no definition"),
function data, file DeclCXX.h, line 464.
bt
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program
https://github.com/ZequanWu closed
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -0,0 +1,40 @@
+# Test definition DIE searching is delayed until complete type is required.
+
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -g -gsimple-template-names -o
%t.out
+# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s
+
+# CHECK:
@@ -24,13 +24,16 @@ class UniqueDWARFASTType {
UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration() {}
UniqueDWARFASTType(lldb::TypeSP _sp, const DWARFDIE ,
- const Declaration , int32_t byte_size)
+ const Declaration ,
@@ -24,13 +24,16 @@ class UniqueDWARFASTType {
UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration() {}
UniqueDWARFASTType(lldb::TypeSP _sp, const DWARFDIE ,
- const Declaration , int32_t byte_size)
+ const Declaration ,
@@ -0,0 +1,40 @@
+# Test definition DIE searching is delayed until complete type is required.
+
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -g -gsimple-template-names -o
%t.out
+# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s
+
+# CHECK:
@@ -0,0 +1,40 @@
+# Test definition DIE searching is delayed until complete type is required.
+
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -g -gsimple-template-names -o
%t.out
+# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s
+
+# CHECK:
@@ -0,0 +1,40 @@
+# Test definition DIE searching is delayed until complete type is required.
+
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -g -gsimple-template-names -o
%t.out
+# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s
+
+# CHECK:
@@ -24,13 +24,16 @@ class UniqueDWARFASTType {
UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration() {}
UniqueDWARFASTType(lldb::TypeSP _sp, const DWARFDIE ,
- const Declaration , int32_t byte_size)
+ const Declaration ,
https://github.com/ZequanWu updated
https://github.com/llvm/llvm-project/pull/90663
>From 4e83099b593e66f12dc21be5fbac5279e03e Mon Sep 17 00:00:00 2001
From: Zequan Wu
Date: Tue, 30 Apr 2024 16:23:11 -0400
Subject: [PATCH 1/8] [lldb][DWARF] Delay struct/class/union definition DIE
@@ -24,13 +24,16 @@ class UniqueDWARFASTType {
UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration() {}
UniqueDWARFASTType(lldb::TypeSP _sp, const DWARFDIE ,
- const Declaration , int32_t byte_size)
+ const Declaration ,
@@ -1632,27 +1632,34 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return true;
}
- DWARFDIE dwarf_die = GetDIE(die_it->getSecond());
- if (dwarf_die) {
-// Once we start resolving this type, remove it from the forward
-// declaration map in
@@ -0,0 +1,40 @@
+# Test definition DIE searching is delayed until complete type is required.
+
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -g -gsimple-template-names -o
%t.out
+# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s
+
+# CHECK:
@@ -16,61 +16,66 @@ using namespace lldb_private::plugin::dwarf;
bool UniqueDWARFASTTypeList::Find(const DWARFDIE ,
const lldb_private::Declaration ,
const int32_t byte_size,
+
ZequanWu wrote:
Will leave it open for few days in case anyone has more comments.
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ZequanWu edited
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -0,0 +1,40 @@
+# Test definition DIE searching is delayed until complete type is required.
+
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -g -gsimple-template-names -o
%t.out
+# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s
+
+# CHECK:
https://github.com/ZequanWu updated
https://github.com/llvm/llvm-project/pull/90663
>From 4e83099b593e66f12dc21be5fbac5279e03e Mon Sep 17 00:00:00 2001
From: Zequan Wu
Date: Tue, 30 Apr 2024 16:23:11 -0400
Subject: [PATCH 1/7] [lldb][DWARF] Delay struct/class/union definition DIE
@@ -0,0 +1,40 @@
+# Test definition DIE searching is delayed until complete type is required.
+
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/main.cpp %t/t1_def.cpp -g -gsimple-template-names -o
%t.out
+# RUN: %lldb -b %t.out -s %t/lldb.cmd | FileCheck %s
+
+# CHECK:
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/labath approved this pull request.
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
ZequanWu wrote:
> You could enable logging and check for specific logging after steps. In the
> test I described above if you just print the "Foo *foo" variable, it won't
> need to complete the definition, you could check for logging, and then if you
> print "*foo", then it should complete
@@ -1667,13 +1791,40 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
}
if (dwarf->GetUniqueDWARFASTTypeMap().Find(
-unique_typename, die, unique_decl, attrs.byte_size.value_or(-1),
-*unique_ast_entry_up)) {
+
https://github.com/ZequanWu updated
https://github.com/llvm/llvm-project/pull/90663
>From 4e83099b593e66f12dc21be5fbac5279e03e Mon Sep 17 00:00:00 2001
From: Zequan Wu
Date: Tue, 30 Apr 2024 16:23:11 -0400
Subject: [PATCH 1/6] [lldb][DWARF] Delay struct/class/union definition DIE
@@ -1667,13 +1791,40 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
}
if (dwarf->GetUniqueDWARFASTTypeMap().Find(
-unique_typename, die, unique_decl, attrs.byte_size.value_or(-1),
-*unique_ast_entry_up)) {
+
@@ -154,6 +154,27 @@ static bool TagIsRecordType(dw_tag_t tag) {
}
}
+static bool
+IsForwardDeclaration(const lldb_private::plugin::dwarf::DWARFDIE ,
labath wrote:
This shouldn't be necessary here, as this file has `using namespace
clayborg wrote:
> The tests your described testing this change doesn't break things by delaying
> definition DIE searching, which I think is already covered by existing tests
> (created for other purposes, but also covers this case). I was thinking about
> testing the definition DIE searching
https://github.com/ZequanWu updated
https://github.com/llvm/llvm-project/pull/90663
>From 4e83099b593e66f12dc21be5fbac5279e03e Mon Sep 17 00:00:00 2001
From: Zequan Wu
Date: Tue, 30 Apr 2024 16:23:11 -0400
Subject: [PATCH 1/5] [lldb][DWARF] Delay struct/class/union definition DIE
ZequanWu wrote:
> > > > > Is any of it testable?
> > > >
> > > >
> > > > Good question. Though this is mostly meant to be "NFC" (with very large
> > > > quotes), I can imagine us doing something like forcing the parsing of a
> > > > specific type (`type lookup ` ?), and then checking that
clayborg wrote:
> > > > Is any of it testable?
> > >
> > >
> > > Good question. Though this is mostly meant to be "NFC" (with very large
> > > quotes), I can imagine us doing something like forcing the parsing of a
> > > specific type (`type lookup ` ?), and then checking that the
> > >
@@ -154,6 +154,27 @@ static bool TagIsRecordType(dw_tag_t tag) {
}
}
+static bool
+IsForwardDeclaration(const lldb_private::plugin::dwarf::DWARFDIE ,
+ const ParsedDWARFTypeAttributes ,
+ LanguageType cu_language) {
+ if
https://github.com/clayborg commented:
Looks pretty good to me as long as the test suite is happy.
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
@@ -1631,27 +1631,34 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return true;
}
- DWARFDIE dwarf_die = GetDIE(die_it->getSecond());
- if (dwarf_die) {
-// Once we start resolving this type, remove it from the forward
-// declaration map in
https://github.com/clayborg edited
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
ZequanWu wrote:
> > > Is any of it testable?
> >
> >
> > Good question. Though this is mostly meant to be "NFC" (with very large
> > quotes), I can imagine us doing something like forcing the parsing of a
> > specific type (`type lookup ` ?), and then checking that the
> > module ast
https://github.com/ZequanWu edited
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ZequanWu edited
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -1664,13 +1793,40 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
}
if (dwarf->GetUniqueDWARFASTTypeMap().Find(
-unique_typename, die, unique_decl, attrs.byte_size.value_or(-1),
-*unique_ast_entry_up)) {
+
@@ -1921,38 +1970,33 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
GetClangASTImporter().SetRecordLayout(record_decl, layout);
}
}
-} else if (clang_type_was_created) {
- // Start the definition if the class is not
https://github.com/ZequanWu commented:
> Though this is mostly meant to be "NFC" (with very large quotes)
Yeah, this is mostly "NFC". A noticeable difference is we now set the type
created from declaration with `TypeSystemClang::SetHasExternalStorage` without
knowing if there's a definition
@@ -108,6 +108,9 @@ class DWARFASTParserClang : public
lldb_private::plugin::dwarf::DWARFASTParser {
lldb_private::ConstString GetDIEClassTemplateParams(
const lldb_private::plugin::dwarf::DWARFDIE ) override;
ZequanWu wrote:
Done.
@@ -1921,38 +1970,33 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
GetClangASTImporter().SetRecordLayout(record_decl, layout);
}
}
-} else if (clang_type_was_created) {
- // Start the definition if the class is not
@@ -60,6 +60,12 @@ class DWARFASTParser {
virtual ConstString GetDIEClassTemplateParams(const DWARFDIE ) = 0;
+ // Return true if we found the definition DIE for it. is_forward_declaration
+ // is set to true if the parameter die is a declaration.
+ virtual bool
+
@@ -1632,6 +1669,96 @@ DWARFASTParserClang::GetCPlusPlusQualifiedName(const
DWARFDIE ) {
return qualified_name;
}
ZequanWu wrote:
Yes, it does more than finding the DIE. Updated to return `Type*` and renamed
to `FindDefinitionTypeForDIE`.
@@ -16,60 +16,65 @@ using namespace lldb_private::plugin::dwarf;
bool UniqueDWARFASTTypeList::Find(const DWARFDIE ,
const lldb_private::Declaration ,
const int32_t byte_size,
+
@@ -1632,6 +1669,96 @@ DWARFASTParserClang::GetCPlusPlusQualifiedName(const
DWARFDIE ) {
return qualified_name;
}
+bool DWARFASTParserClang::FindDefinitionDIE(const DWARFDIE ,
+bool _forward_declaration) {
@@ -249,11 +270,10 @@ static void ForcefullyCompleteType(CompilerType type) {
/// This function serves a similar purpose as RequireCompleteType above, but it
/// avoids completing the type if it is not immediately necessary. It only
/// ensures we _can_ complete the type
https://github.com/ZequanWu edited
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ZequanWu updated
https://github.com/llvm/llvm-project/pull/90663
>From 4e83099b593e66f12dc21be5fbac5279e03e Mon Sep 17 00:00:00 2001
From: Zequan Wu
Date: Tue, 30 Apr 2024 16:23:11 -0400
Subject: [PATCH 1/4] [lldb][DWARF] Delay struct/class/union definition DIE
Michael137 wrote:
> > Is any of it testable?
>
> Good question. Though this is mostly meant to be "NFC" (with very large
> quotes), I can imagine us doing something like forcing the parsing of a
> specific type (`type lookup ` ?), and then checking that the
> module ast (`image dump ast`)
https://github.com/Michael137 edited
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
labath wrote:
> Is any of it testable?
Good question. Though this is mostly meant to be "NFC" (with very large
quotes), I can imagine us doing something like forcing the parsing of a
specific type (`type lookup ` ?), and then checking that the module
ast (`image dump ast`) does *not* contain
@@ -16,60 +16,65 @@ using namespace lldb_private::plugin::dwarf;
bool UniqueDWARFASTTypeList::Find(const DWARFDIE ,
const lldb_private::Declaration ,
const int32_t byte_size,
+
https://github.com/Michael137 commented:
The idea makes sense and I like that we could factor things out of
`ParseStructureLikeDIE`, so generally LGTM (module Pavel's comments). Is any of
it testable?
https://github.com/llvm/llvm-project/pull/90663
https://github.com/Michael137 edited
https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -1664,13 +1793,40 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
}
if (dwarf->GetUniqueDWARFASTTypeMap().Find(
-unique_typename, die, unique_decl, attrs.byte_size.value_or(-1),
-*unique_ast_entry_up)) {
+
@@ -60,6 +60,12 @@ class DWARFASTParser {
virtual ConstString GetDIEClassTemplateParams(const DWARFDIE ) = 0;
+ // Return true if we found the definition DIE for it. is_forward_declaration
+ // is set to true if the parameter die is a declaration.
+ virtual bool
+
@@ -1921,38 +1970,33 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
GetClangASTImporter().SetRecordLayout(record_decl, layout);
}
}
-} else if (clang_type_was_created) {
- // Start the definition if the class is not
@@ -108,6 +108,9 @@ class DWARFASTParserClang : public
lldb_private::plugin::dwarf::DWARFASTParser {
lldb_private::ConstString GetDIEClassTemplateParams(
const lldb_private::plugin::dwarf::DWARFDIE ) override;
labath wrote:
delete
@@ -1921,38 +1970,33 @@ DWARFASTParserClang::ParseStructureLikeDIE(const
SymbolContext ,
GetClangASTImporter().SetRecordLayout(record_decl, layout);
}
}
-} else if (clang_type_was_created) {
- // Start the definition if the class is not
@@ -1632,6 +1669,96 @@ DWARFASTParserClang::GetCPlusPlusQualifiedName(const
DWARFDIE ) {
return qualified_name;
}
+bool DWARFASTParserClang::FindDefinitionDIE(const DWARFDIE ,
+bool _forward_declaration) {
labath
https://github.com/labath commented:
Modulo comments, this makes sense to me (as much as that can ever be said about
this code), but it could definitely use a second (third?) pair of eyes.
Michael, what do you make of this?
https://github.com/llvm/llvm-project/pull/90663
@@ -249,11 +270,10 @@ static void ForcefullyCompleteType(CompilerType type) {
/// This function serves a similar purpose as RequireCompleteType above, but it
/// avoids completing the type if it is not immediately necessary. It only
/// ensures we _can_ complete the type
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/90663
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -1632,6 +1669,96 @@ DWARFASTParserClang::GetCPlusPlusQualifiedName(const
DWARFDIE ) {
return qualified_name;
}
labath wrote:
I am bothered by this name. I would expect that something called
`FindDefinitionDIE` returns a DWARFDIE (or something along
@@ -1631,13 +1631,19 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return true;
}
- DWARFDIE dwarf_die = GetDIE(die_it->getSecond());
+ DWARFDIE dwarf_die = FindDefinitionDIE(GetDIE(die_it->getSecond()));
if (dwarf_die) {
// Once we start
@@ -1654,6 +1660,99 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return false;
}
+DWARFDIE SymbolFileDWARF::FindDefinitionDIE(const DWARFDIE ) {
+ auto def_die_it = GetDeclarationDIEToDefinitionDIE().find(die.GetDIE());
+ if (def_die_it !=
@@ -533,9 +540,16 @@ class SymbolFileDWARF : public SymbolFileCommon {
NameToOffsetMap m_function_scope_qualified_name_map;
std::unique_ptr m_ranges;
UniqueDWARFASTTypeMap m_unique_ast_type_map;
+ // A map from DIE to lldb_private::Type. For record type, the key might
https://github.com/ZequanWu updated
https://github.com/llvm/llvm-project/pull/90663
>From 4e83099b593e66f12dc21be5fbac5279e03e Mon Sep 17 00:00:00 2001
From: Zequan Wu
Date: Tue, 30 Apr 2024 16:23:11 -0400
Subject: [PATCH 1/3] [lldb][DWARF] Delay struct/class/union definition DIE
@@ -1654,6 +1660,99 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return false;
}
+DWARFDIE SymbolFileDWARF::FindDefinitionDIE(const DWARFDIE ) {
+ auto def_die_it = GetDeclarationDIEToDefinitionDIE().find(die.GetDIE());
+ if (def_die_it !=
@@ -1654,6 +1660,99 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return false;
}
+DWARFDIE SymbolFileDWARF::FindDefinitionDIE(const DWARFDIE ) {
+ auto def_die_it = GetDeclarationDIEToDefinitionDIE().find(die.GetDIE());
+ if (def_die_it !=
@@ -1654,6 +1660,99 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return false;
}
+DWARFDIE SymbolFileDWARF::FindDefinitionDIE(const DWARFDIE ) {
+ auto def_die_it = GetDeclarationDIEToDefinitionDIE().find(die.GetDIE());
+ if (def_die_it !=
@@ -533,9 +540,16 @@ class SymbolFileDWARF : public SymbolFileCommon {
NameToOffsetMap m_function_scope_qualified_name_map;
std::unique_ptr m_ranges;
UniqueDWARFASTTypeMap m_unique_ast_type_map;
+ // A map from DIE to lldb_private::Type. For record type, the key might
@@ -533,9 +540,16 @@ class SymbolFileDWARF : public SymbolFileCommon {
NameToOffsetMap m_function_scope_qualified_name_map;
std::unique_ptr m_ranges;
UniqueDWARFASTTypeMap m_unique_ast_type_map;
+ // A map from DIE to lldb_private::Type. For record type, the key might
@@ -1654,6 +1660,99 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return false;
}
+DWARFDIE SymbolFileDWARF::FindDefinitionDIE(const DWARFDIE ) {
+ auto def_die_it = GetDeclarationDIEToDefinitionDIE().find(die.GetDIE());
+ if (def_die_it !=
@@ -1631,13 +1631,19 @@ bool SymbolFileDWARF::CompleteType(CompilerType
_type) {
return true;
}
- DWARFDIE dwarf_die = GetDIE(die_it->getSecond());
+ DWARFDIE dwarf_die = FindDefinitionDIE(GetDIE(die_it->getSecond()));
if (dwarf_die) {
// Once we start
1 - 100 of 109 matches
Mail list logo