-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[LLDB][NativePDB] Complete array member types in AST builder #156370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
967d345
[LLDB] Complete constant array member types in class members
Nerixyz 4a08289
fix: return if complete
Nerixyz d978d59
fix: require element type when creating array type
Nerixyz 28ee7f4
fix: remove unused type
Nerixyz f90ce9a
Revert "fix: remove unused type"
Nerixyz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -13,3 +13,8 @@ struct E { | |
| E(); | ||
| }; | ||
| E::E() = default; | ||
|
|
||
| struct I { | ||
| I(); | ||
| }; | ||
| I::I() = default; | ||
45 changes: 0 additions & 45 deletions
45
lldb/test/Shell/SymbolFile/NativePDB/incomplete-tag-type.cpp
This file was deleted.
Oops, something went wrong.
109 changes: 109 additions & 0 deletions
109
lldb/test/Shell/SymbolFile/NativePDB/incomplete-tag-type.test
This file contains hidden or 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,109 @@ | ||
| # REQUIRES: lld, x86 | ||
|
|
||
| # RUN: split-file %s %t | ||
|
|
||
| # RUN: %clang_cl --target=x86_64-windows-msvc -c /Fo%t1.obj -- %p/Inputs/incomplete-tag-type.cpp | ||
| # RUN: %clang_cl --target=x86_64-windows-msvc /O1 /Z7 -c /Fo%t2.obj -- %t/main.cpp | ||
| # RUN: lld-link /debug:full /nodefaultlib /entry:main %t1.obj %t2.obj /out:%t.exe /pdb:%t.pdb | ||
|
|
||
| # RUN: %lldb -f %t.exe -s %t/target-var.input 2>&1 | FileCheck %s --check-prefix=TARGET-VAR | ||
| # RUN: %lldb -f %t.exe -s %t/expr.input 2>&1 | FileCheck %s --check-prefix=EXPR | ||
|
|
||
| #--- main.cpp | ||
|
|
||
| // Complete base class. | ||
| struct A { int x; A(); }; | ||
| struct B : A {}; | ||
| B b; | ||
|
|
||
| // Complete data member. | ||
| struct C { | ||
| C(); | ||
| }; | ||
|
|
||
| struct D { | ||
| C c; | ||
| }; | ||
| D d; | ||
|
|
||
| // Incomplete static data member should return error. | ||
| struct E { | ||
| E(); | ||
| }; | ||
|
|
||
| struct F { | ||
| static E static_e; | ||
| }; | ||
|
|
||
| E F::static_e = E(); | ||
| E& static_e_ref = F::static_e; | ||
|
|
||
| struct G { | ||
| int foo = 1; | ||
| }; | ||
| struct H { | ||
| G g[2]; | ||
| }; | ||
| H h; | ||
|
|
||
| struct I { | ||
| I(); | ||
| }; | ||
| struct J { | ||
| I i[2]; | ||
| }; | ||
| J j; | ||
|
|
||
|
|
||
| int main(){} | ||
|
|
||
| #--- target-var.input | ||
|
|
||
| target variable b | ||
| target variable d | ||
| target variable h | ||
| target variable j | ||
| target variable static_e_ref | ||
| exit | ||
|
|
||
| #--- expr.input | ||
|
|
||
| settings set interpreter.stop-command-source-on-error false | ||
| expression b | ||
| expression d | ||
| expression h | ||
| expression j | ||
| expression static_e_ref | ||
| exit | ||
|
|
||
| # TARGET-VAR: (lldb) target variable b | ||
| # TARGET-VAR-NEXT: (B) b = (A = <incomplete type>) | ||
| # TARGET-VAR-NEXT: (lldb) target variable d | ||
| # TARGET-VAR-NEXT: (D) d = {} | ||
| # TARGET-VAR-NEXT: (lldb) target variable h | ||
| # TARGET-VAR-NEXT: (H) h = { | ||
| # TARGET-VAR-NEXT: g = { | ||
| # TARGET-VAR-NEXT: [0] = (foo = 1) | ||
| # TARGET-VAR-NEXT: [1] = (foo = 1) | ||
| # TARGET-VAR-NEXT: } | ||
| # TARGET-VAR-NEXT: } | ||
| # TARGET-VAR-NEXT: (lldb) target variable j | ||
| # TARGET-VAR-NEXT: (J) j = {} | ||
| # TARGET-VAR-NEXT: (lldb) target variable static_e_ref | ||
| # TARGET-VAR-NEXT: (E &) static_e_ref = 0x{{.*}} <incomplete type "E"> | ||
|
|
||
| # EXPR: (lldb) expression b | ||
| # EXPR-NEXT: (B) $0 = {} | ||
| # EXPR-NEXT: (lldb) expression d | ||
| # EXPR-NEXT: (D) $1 = {} | ||
| # EXPR-NEXT: (lldb) expression h | ||
| # EXPR-NEXT: (H) $2 = { | ||
| # EXPR-NEXT: g = { | ||
| # EXPR-NEXT: [0] = (foo = 1) | ||
| # EXPR-NEXT: [1] = (foo = 1) | ||
| # EXPR-NEXT: } | ||
| # EXPR-NEXT: } | ||
| # EXPR-NEXT: (lldb) expression j | ||
| # EXPR-NEXT: (J) $3 = {} | ||
| # EXPR-NEXT: (lldb) expression static_e_ref | ||
| # EXPR: error:{{.*}}incomplete type 'E' where a complete type is required |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this used for?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, was testing something unrelated...It wasn't unrelated (I undid that locally).
It's to test that arrays of forward declared types work. I had to add a new type there to make ensure there was no attempt to complete it from the previous
target variablecalls that don't go through arrays.