Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ LLDBMemoryReader::resolvePointerAsSymbol(swift::remote::RemoteAddress address) {
}

if (auto *symbol = addr.CalculateSymbolContextSymbol()) {
// Require `addr` to point to the beginning of the symbol since the
// COFF export table is sparse and we can inadvertently misattribute
// private symbols to the preceding public symbol.
// See https://github.com/swiftlang/llvm-project/issues/12891
if (triple.isOSWindows() &&
addr.GetFileAddress() != symbol->GetAddressRef().GetFileAddress())
return {};
auto mangledName = symbol->GetMangled().GetMangledName().GetStringRef();
// MemoryReader requires this to be a Swift symbol. LLDB can also be
// aware of local symbols, so avoid returning those.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class TestSwiftObservation(TestBase):
NO_DEBUG_INFO_TESTCASE = True

@swiftTest
@expectedFailureWindows
def test(self):
"""Test that types with private discriminators read from the file cache work"""
self.build()
Expand Down
2 changes: 0 additions & 2 deletions lldb/test/API/lang/swift/regex/TestSwiftRegex.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def setUp(self):

@swiftTest
@skipIf(macos_version=["<", "13"])
@expectedFailureWindows
def test_swift_regex_frame_var(self):
"""Test frame variable support for Swift regexes."""
self.build()
Expand Down Expand Up @@ -63,7 +62,6 @@ def test_swift_regex_frame_var_desc(self):

@swiftTest
@skipIf(macos_version=["<", "13"])
@expectedFailureWindows
def test_swift_regex_expr(self):
"""Test expression support for Swift regexes."""
self.build()
Expand Down
8 changes: 6 additions & 2 deletions lldb/test/Shell/SymbolFile/NativePDB/swift-frame-var.test
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,23 @@ func main() {
var myResult: Result<Int, Error> = .success(42)
var myBox: Box<Int32> = Box(value: 99)
var myPair: Pair<Int, String> = .first(7)
var myDictionary: [Int: String] = [1: "one", 2: "two"]
var mySet: Set<Int32> = [1, 2, 3]
let constInt: Int = 100
let constInt8: Int8 = -42
let constUInt16: UInt16 = 1000
let constBool: Bool = false
let constString: String = "world"
print(myInt32, myBool, myUInt64, myFloat, myDouble,
myString, myPoint, myDirection, myOptional, myNestedOptional, myArray,
myOptionalArray, myResult, myBox, myPair,
myOptionalArray, myResult, myBox, myPair, myDictionary, mySet,
constInt, constInt8, constUInt16, constBool, constString)
}

main()

#--- commands.input
b main.swift:41
b main.swift:43
run
frame variable

Expand All @@ -78,6 +80,8 @@ frame variable
# CHECK: (Result<Int, Error>) myResult = success
# CHECK: (main.Box<Int32>) myBox = (value = 99)
# CHECK: (main.Pair<Int, String>) myPair = first
# CHECK: ([Int : String]) myDictionary = 2 key/value pairs
# CHECK: (Set<Int32>) mySet = 3 values
# Local constants
# CHECK: (Int) constInt = 100
# CHECK: (Int8) constInt8 = -42
Expand Down