How to restrict breakpoint for swift variable setter in file?

While debugging the Signals application (chapter 4), I wanted to use this expression to create a breakpoint for the swift (and obj-c bridged) setter for the name variable:B

rbreak name\.setter -f SwiftTestClass.swift

But this doesn’t resolve the breakpoint to any locations; I don’t understand why.

This expression does create breakpoint with several locations, including two for name.setter:

rbreak name -f SwiftTestClass.swift

This expression without the filename also creates a breakpoint that includes the name.setter locations:

rbreak name\.setter

So, what’s wrong with my name\.setter -f SwiftTestClass.swift breakpoint-creating attempt?

1 Like

@brki great question.

This appears to be a bug in LLDB. I would strongly encourage you to file a rdar to the LLDB team as this seems like a lot of people could benefit from using a regex query filtered on a file.

Oddly enough this works: rbreak name.set.* -f SwiftTestClass.swift,
but not this: rbreak name.sett.* -f SwiftTestClass.swift.

For now, you can get around this by rearranging your query. You know that Swift umangled functions will have the class name prepended to it so a ho-hum solution for now would be to rewrite w/ the following:

rb SwiftTestClass.name.setter

File that rdar, I’d use these two flags all the time if they are functional :]

1 Like

Thanks for the reply. I’ve filed a bug report with Apple, and created an entry on openradar too: http://www.openradar.me/radar?id=4940289571553280 .

2 Likes