Skip to content

Commit 3581efc

Browse files
committed
Fix LLDB Swift data formatters breaking Swift code debugging
Because the data formatter for the compiler internals was registering itself as swift, it was hiding the default data formatters for swift code. rdar://125114526
1 parent e5bf933 commit 3581efc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

utils/lldb/lldbSwiftDataFormatters.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
"""
22
LLDB Formatters for LLVM data types for use in the swift project.
33
4-
Load into LLDB with 'command script import /path/to/lldbDataFormatters.py'
4+
Load into LLDB with 'command script import /path/to/lldbSwiftDataFormatters.py'
55
"""
66

77
import sys
88
from enum import Enum
99

1010

1111
def __lldb_init_module(debugger, internal_dict):
12-
debugger.HandleCommand('type category define -e swift -l c++')
12+
category = 'swift-compiler-internals'
13+
debugger.HandleCommand(f'type category define -e {category} -l c++')
1314

1415
tName = 'lldbSwiftDataFormatters.SmallBitVectorSummaryProvider'
1516
debugger.HandleCommand('type summary add -w llvm '
16-
'-F %s -x "^llvm::SmallBitVector$"' % tName)
17-
debugger.HandleCommand('type summary add --expand --skip-references -w swift '
17+
f'-F {tName} -x "^llvm::SmallBitVector$"')
18+
debugger.HandleCommand(f'type summary add --expand --skip-references -w {category} '
1819
'-F lldbSwiftDataFormatters.DemangleNodeSummaryProvider '
1920
'-x "^swift::Demangle::Node$"')
20-
debugger.HandleCommand('type synthetic add --skip-references -w swift '
21+
debugger.HandleCommand(f'type synthetic add --skip-references -w {category} '
2122
'-l lldbSwiftDataFormatters.DemangleNodeSynthProvider '
2223
'-x "^swift::Demangle::Node$"')
23-
debugger.HandleCommand('type summary add -w swift '
24+
debugger.HandleCommand(f'type summary add -w {category} '
2425
'-s "${var.Pointer%S}" '
2526
'swift::Identifier')
2627

0 commit comments

Comments
 (0)