@@ -138,6 +138,25 @@ SwiftLanguage::GetMethodNameVariants(ConstString method_name) const {
138
138
if (method_name.GetMangledCounterpart (counterpart))
139
139
if (SwiftLanguageRuntime::IsSwiftMangledName (counterpart.GetStringRef ()))
140
140
variant_names.emplace_back (counterpart, eFunctionNameTypeFull);
141
+
142
+ // Properties can have multiple accessor blocks. This section of code supports
143
+ // breakpoints on accessor blocks by name.
144
+ //
145
+ // By default, the name `A.B` is treated as a fully qualified name, where `B`
146
+ // is the basename. However, some names can be interpretted in two ways, for
147
+ // example `A.get`. First, it can refer to the name `get` (in module `A`, or
148
+ // in type `A`). Second, it can refer the *getter* block for property `A`.
149
+ // LLDB's baseline behavior handles the first case. The second case is
150
+ // produced here as a variant name.
151
+ for (StringRef suffix : {" .get" , " .set" , " .willSet" , " .didSet" })
152
+ if (method_name.GetStringRef ().ends_with (suffix)) {
153
+ // The method name, complete with suffix, *is* the variant.
154
+ variant_names.emplace_back (method_name, eFunctionNameTypeFull |
155
+ eFunctionNameTypeBase |
156
+ eFunctionNameTypeMethod);
157
+ break ;
158
+ }
159
+
141
160
return variant_names;
142
161
}
143
162
0 commit comments