Is there a way, in Android Studios, to configure the debugger so that pausing a Kotlin app at a suspended function call, and stepping into, or over, keeps the debugger in the same thread?
I’ve never managed to get this working. When I do set a breakpoint at a suspended function call, and attempt to step over it, the application continues without the debugger stopping.
I’ve find myself needing to set successive breakpoints to work around this limitation. However, the statement just after the suspended call is usually another suspended call, which means more breakpoints that need to be set. When the number of breakpoints get too high, the cognitive load of remembering why each one was set becomes too much and I find myself forgetting why that particular breakpoint was set in the first place.
I understand that Kotlin co-routines are an abstraction layered atop the JVM, and that all the language facilities may not be in place to offer full support for these in the debugger. I only hope that someone is working on this though. Kotlin co-routines are pretty nice to work with, but with limitations in the tooling like this, the leaks are easy to spot.