-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[LLDB][NativePDB] Resolve declaration for tag types #152579
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
7 commits
Select commit
Hold shift + click to select a range
2f4c134
[LLDB][NativePDB] Resolve declaration for tag types
Nerixyz e7c51c5
fix: use std::once_flag
Nerixyz 4066478
fix: use llvm::Expected
Nerixyz 2f0c1dc
feat: handle `LF_UDT_SRC_LINE` as well
Nerixyz 4391dd6
test: add test for rustc's `<unknown>`
Nerixyz 934f575
fix: use native path style
Nerixyz bd4bb25
Apply suggestions from code review
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
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,56 @@ | ||
| ; Test that the declaration for UDTs won't be "<unknown>" or "\<unknown>". | ||
| ; Rustc sets the location of some builtin types to this string. | ||
|
|
||
| ; REQUIRES: system-windows | ||
| ; RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s | ||
| ; RUN: lldb-test symbols %t.exe | FileCheck %s | ||
|
|
||
| ; there shouldn't be a declaration (would be between size and compiler_type) | ||
| ; CHECK: Type{{.*}} , name = "Foo", size = 1, compiler_type = {{.*}} struct Foo { | ||
|
|
||
| ; This is edited output from clang simulates rustc behavior (see !17) | ||
| ; Source: | ||
| ; struct Foo {}; | ||
| ; | ||
| ; int main() { Foo f; } | ||
|
|
||
|
|
||
| ; ModuleID = 'main.cpp' | ||
| source_filename = "main.cpp" | ||
| target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" | ||
| target triple = "x86_64-pc-windows-msvc19.44.35207" | ||
|
|
||
| %struct.Foo = type { i8 } | ||
|
|
||
| ; Function Attrs: mustprogress noinline norecurse nounwind optnone uwtable | ||
| define dso_local noundef i32 @main() #0 !dbg !9 { | ||
| %1 = alloca %struct.Foo, align 1 | ||
| #dbg_declare(ptr %1, !14, !DIExpression(), !16) | ||
| ret i32 0, !dbg !16 | ||
| } | ||
|
|
||
| attributes #0 = { mustprogress noinline norecurse nounwind optnone uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } | ||
|
|
||
| !llvm.dbg.cu = !{!0} | ||
| !llvm.module.flags = !{!2, !3, !4, !5, !6, !7} | ||
| !llvm.ident = !{!8} | ||
|
|
||
| !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 20.1.6", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) | ||
| !1 = !DIFile(filename: "main.cpp", directory: "F:\\Dev\\rust-dbg-test", checksumkind: CSK_MD5, checksum: "b8942260dadf9ec35328889f05afb954") | ||
| !2 = !{i32 2, !"CodeView", i32 1} | ||
| !3 = !{i32 2, !"Debug Info Version", i32 3} | ||
| !4 = !{i32 1, !"wchar_size", i32 2} | ||
| !5 = !{i32 8, !"PIC Level", i32 2} | ||
| !6 = !{i32 7, !"uwtable", i32 2} | ||
| !7 = !{i32 1, !"MaxTLSAlign", i32 65536} | ||
| !8 = !{!"clang version 20.1.6"} | ||
| !9 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 3, type: !10, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !13) | ||
| !10 = !DISubroutineType(types: !11) | ||
| !11 = !{!12} | ||
| !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) | ||
| !13 = !{} | ||
| !14 = !DILocalVariable(name: "f", scope: !9, file: !1, line: 3, type: !15) | ||
| !15 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !17, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !13, identifier: ".?AUFoo@@") | ||
| !16 = !DILocation(line: 3, scope: !9) | ||
| ; This is how rustc emits some types | ||
| !17 = !DIFile(filename: "<unknown>", directory: "") |
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
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.
I find it a bit awkward that we have NativePDB tests running outside of the
SymbolFile/NativePDBtest directory. Can we just put this test into theNativePDBdirectory too?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.
Forgot to reply to this...
My concern was that this would now duplicate the test input and the expected output. We do the mixed tests in
Shell/SymbolFile/PDBa few times.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.
Hmmm ok, lets just make sure we don't lose this coverage when we remove the DIA PDB plugin