Skip to content

Commit 57186c9

Browse files
committed
[lldb] Support CoreFoundation as a module for CGFloat (#5412)
A type summary is registered for `Foundation.CGFloat` and `CoreGraphics.CGFloat`, but currently `CGFloat` is reported as `CoreFoundation.CGFloat`. This change adds the same summary for `CoreFoundation.CGFloat`. I would think `CoreGraphics.CGFloat` would be the expected type, but it seems this can change over the course of internal reorganizations, re-exports, etc. rdar://100789061 (cherry picked from commit 1b4132b)
1 parent 1a65d3f commit 57186c9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ static void LoadSwiftFormatters(lldb::TypeCategoryImplSP swift_category_sp) {
553553
ConstString("CoreGraphics.CGFloat"), summary_flags);
554554
AddStringSummary(swift_category_sp, "${var.native}",
555555
ConstString("Foundation.CGFloat"), summary_flags);
556+
AddStringSummary(swift_category_sp, "${var.native}",
557+
ConstString("CoreFoundation.CGFloat"), summary_flags);
556558
}
557559

558560
static void

lldb/test/API/lang/swift/variables/cgtypes/TestCGTypes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def do_test(self):
4040
lldbutil.run_to_source_breakpoint(
4141
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
4242

43-
self.expect('frame variable f', substrs=[' = 1'])
44-
self.expect('frame variable p', substrs=[' = (x = 1, y = 1)'])
43+
self.expect('frame variable f', substrs=[' f = 1'])
44+
self.expect('frame variable p', substrs=[' p = (x = 1, y = 1)'])
4545
self.expect('frame variable r', substrs=[
46-
' = (origin = (x = 0, y = 0), size = (width = 0, height = 0))'])
46+
' r = (origin = (x = 0, y = 0), size = (width = 0, height = 0))'])
4747

4848
self.expect('expr f', substrs=[' = 1'])
4949
self.expect('expr p', substrs=[' = (x = 1, y = 1)'])

0 commit comments

Comments
 (0)