Is it possible to debug kotlin-native runtime (mem...
# kotlin-native
s
Is it possible to debug kotlin-native runtime (memory manager) in iOS application
https://github.com/JetBrains/kotlin/blob/master/kotlin-native/HACKING.md#developing-kotlinnative-runtime-in-clion > Unfortunately, this feature works quite unstable because of using several llvm versions simultaneously, so it’s need to be additionally enabled while compiling application with
-Xbinary=stripDebugInfoFromNativeLibs=false
compiler flag or corresponding setting in gradle build script. After doing this, Kotlin/Native runtime in application is debuggable in CLion, with Attach to process tool. I have checked HACKING.md documents above
👍 1
Please help me. What should I do?
a
Do you mean, whether it's possible to attach a debugger so that the K/N runtime code would be debuggable (i.e. display sources, locals, etc.)? If so, then the answer is likely "no". But what's the problem you're trying to solve?
s
Thank you for your help! I’m curious about K/N runtime. To understand what is happening in K/N runtime, I will use this code snippet (https://github.com/JetBrains/kotlin/blob/35cf9cb0c41b3e4c6311e427eeb5d03c13d0f430/kotlin-native/runtime/src/main/cpp/Logging.hpp#L155-L163 )
👍 1
a
Just in case you want to track what the GC is doing, you can do so via
-Xruntime-logs=gc=info
(or
-Xruntime-logs=gc=debug
). It does use
Logging.hpp
under the hood.
👍 1