Skip to content

Commit 4f89c41

Browse files
Merge pull request #9720 from swiftlang/dl/lldb-Update-Swift-String-summary-formatter-for-new-bridged-case
[lldb] Update Swift String summary formatter for new bridged case
2 parents b230b2c + fbe703c commit 4f89c41

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lldb/source/Plugins/Language/Swift/SwiftFormatters.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ static bool makeStringGutsSummary(
257257
│ Immortal, Small ║ 1 │ASCII│ 1 │ 0 │
258258
├─────────────────────╫─────┼─────┼─────┼─────┤
259259
│ Immortal, Large ║ 1 │ 0 │ 0 │ 0 │
260+
├─────────────────────╫─────┼─────┼─────┼─────┤
261+
│ Immortal, Bridged ║ 1 │ 1 │ 0 │ 0 │
260262
╞═════════════════════╬═════╪═════╪═════╪═════╡
261263
│ Native ║ 0 │ 0 │ 0 │ 0 │
262264
├─────────────────────╫─────┼─────┼─────┼─────┤
@@ -373,7 +375,7 @@ static bool makeStringGutsSummary(
373375
if ((discriminator & 0b0111'0000) == 0)
374376
return error("unexpected discriminator");
375377

376-
if ((discriminator & 0b1110'0000) == 0b0100'0000) { // 010xxxxx: Bridged
378+
if ((discriminator & 0b0110'0000) == 0b0100'0000) { // x10xxxxx: Bridged
377379
TypeSystemClangSP clang_ts_sp =
378380
ScratchTypeSystemClang::GetForTarget(process->GetTarget());
379381
if (!clang_ts_sp)

lldb/test/API/lang/swift/variables/bridged_string/TestSwiftBridgedStringVariables.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ def test_swift_bridged_string_variables(self):
3737
s4 = self.frame().FindVariable("s4")
3838
s5 = self.frame().FindVariable("s5")
3939
s6 = self.frame().FindVariable("s6")
40+
s7 = self.frame().FindVariable("s7")
4041

4142
lldbutil.check_variable(self, s1, summary='"Hello world"')
4243
lldbutil.check_variable(self, s2, summary='"ΞΕΛΛΘ"')
4344
lldbutil.check_variable(self, s3, summary='"Hello world"')
4445
lldbutil.check_variable(self, s4, summary='"ΞΕΛΛΘ"')
4546
lldbutil.check_variable(self, s5, use_dynamic=True, summary='"abc"')
4647
lldbutil.check_variable(self, s6, summary='"abc"')
48+
lldbutil.check_variable(self, s7, summary='"kCFRunLoopDefaultMode"')
4749

lldb/test/API/lang/swift/variables/bridged_string/main.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func main()
1919
let s4 = s2 as NSString
2020
let s5 = "abc" as NSString
2121
let s6 = String(s5)
22+
let s7 = CFRunLoopMode.defaultMode!.rawValue as String
2223
print(s1) // Set breakpoint here
2324
withExtendedLifetime((s2, s3, s4, s5, s6)) {}
2425
}

0 commit comments

Comments
 (0)