Closed sean-howard closed 1 year ago
We had discussed this internally but holidays, etc. Anyway, the "plugin" uses lldb, and relies on Xcode to set breakpoints based on file line numbers. All of that is handled by lldb and whatever the Kotlin compiler writes out for lldb. That's a long way to say, if some breakpoints work and others don't, reinstalling the plugin won't do much. When you update Xcode, you need to refresh the uuid, but if some breakpoints are working, that shouldn't be an issue.
It looks like you're using Xcode 14.2 and judging by the date, I assume you're on Kotlin 1.7.x. 1.7.x only supports Xcode 13.x. We've run into issues with cinterop and Xcode 14.x on Kotlin 1.7.20. I don't know if that's contributing, but installing 13.4.1 and clean building everything (including the kotlin build dir) would be something to try. The Kotlin compiler uses the Xcode build tools, so it's important to stay with supported versions.
Outside of that, it looks like all of your code is built locally, but that's another potential cause of this. lldb writes absolute paths of source files in debug binaries, so if your binary is built on CI, or built locally but you're pointing to source in a different folder for some reason, breakpoints won't work. That's not a Kotlin-specific issue. Swift, etc, same.
Outside of those, there's not much we can do without a repro. As you've stated, this works for KaMP Kit and other projects we use it for.
Ah okay thanks for detailed response @kpgalligan! Looks like this issue has coincided with an upgrade to Xcode 14.2 then. Sadly we're unable to revert to an older version of Xcode right now due to some Swift 5.7 language features we're leveraging.
Is it safe to assume that upgrading to Kotlin 1.8 would play friendly with Xcode 14.x?
Well, "officially" 14.1, but I'm guessing it'll be generally OK with 14.2.
Source: https://kotlinlang.org/docs/whatsnew18.html#kotlin-native
Closing until I'm able to test using Kotlin 1.8, thanks for the information!
I have encountered the same problem, Xcode 14.2,mac M1,koltion 1.8.21, there is further progress on this problem, has it been solved? If possible, could you share your experience? Thanks a million
Hey folks, My team has been using this plugin reliably for a year or so but recently we've found when we set breakpoints in our shared Kotlin code and press run the breakpoints turn to the dotted blue outline state indicating that the code is never executed/compiled - it definitely is getting executed!
We've tried uninstalling and reinstalling the plugin through the CLI as well as reinstalling with Homebrew but with no luck. We've also reimported the folder references to the shared code in our Xcode project too.
Interestingly the KaMPKit sample project breakpoints perfectly fine. Any ideas on how to resolve?
Details
xcode-kotlin info
In addition we've also made sure our preprocessor macros for debug is set to:
DEBUG=1
.Expected result
Breakpoints get triggered when code is executed.
Current state
Xcode is indicating that the code is never executed.
Screenshots