[lldb][NativePDB] Introduce PdbAstBuilderSwift#12317
[lldb][NativePDB] Introduce PdbAstBuilderSwift#12317speednoisemovement wants to merge 4 commits intoswiftlang:stable/21.xfrom
Conversation
This brings support for printing locals when using the NativePDB backend. See the tests for some known-working types. Generics are blocked by swiftlang/swift#87093 and let constants are forthcoming.
| @@ -0,0 +1,65 @@ | |||
| //===------------------------------------------------------------*- C++ -*-===// | |||
There was a problem hiding this comment.
The LLVM coding style recently abandoned the emacs language markers -*- C++ -*-
| return false; | ||
| ClassRecord cr; | ||
| llvm::cantFail(TypeDeserializer::deserializeAs<ClassRecord>(cvt, cr)); | ||
| return cr.hasUniqueName() && cr.UniqueName.starts_with("$s"); |
There was a problem hiding this comment.
Swift types can start with a number of mangling prefixes (_T, $s, $e). Can you check if we have a helper for this already, either in Mangled or in LanguageRuntimeSwiftNames.cpp, and if we really don't, create one?
There was a problem hiding this comment.
Perfect, thanks! Done
| @@ -0,0 +1,90 @@ | |||
| #include "PdbAstBuilderSwift.h" | |||
| CompilerType ct; | ||
| if (best_type.index != type.index) | ||
| ct = GetOrCreateType(best_type); | ||
| else | ||
| ct = CreateType(type, index.tpi()); |
|
|
||
| # RUN: split-file %s %t | ||
| # RUN: %target-swiftc -v -g -debug-info-format=codeview %t/main.swift -o %t.exe -Xlinker -debug -use-ld=lld | ||
| # RUN: %lldb -x -b -s %t/commands.input %t.exe -o exit 2>&1 | FileCheck %s |
There was a problem hiding this comment.
This kind of Shell test makes sense for narrow testing of specific parser behavior.
Going forward we need to find a way to run the entire LLDB API test suite in PDB mode. My thinking is that we probably should introduce a category at the same level as the dwarf/dsym/dwo debug info formats and sue that to automatically generate PDB variants of all tests.
This does not have to happen in this PR, but we should get started on that soon so we have a better idea of what works and what doesn't.
There was a problem hiding this comment.
Ack. I'll start paging this in
| # Pre-emptively skipping since it won't pass until the following | ||
| # is fixed: | ||
| # https://github.com/swiftlang/llvm-project/issues/12289 | ||
| skip lldb-shell :: SymbolFile/NativePDB/swift-frame-var.test |
There was a problem hiding this comment.
Should we mark the test as XFAIL instead in lldb/test/Shell/SymbolFile/NativePDB/swift-frame-var.test ?
AFAIK, windows-swift-llvm-lit-test-overrides.txt is for upstream tests which fail downstream.
Introduces a Swift-specific
PdbAstBuilder,PdbAstBuilderSwiftand wires it up toTypeSystemSwift.This brings support for printing locals when using the NativePDB backend. See the tests for some known-working types.
Generics are blocked by swiftlang/swift#87093 and let constants are forthcoming.