https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
s

seongsu kim

11/29/2023, 3:14 AM
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

Alexander Shabalin [JB]

11/29/2023, 11:22 AM
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

seongsu kim

11/29/2023, 1:19 PM
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

Alexander Shabalin [JB]

11/29/2023, 1:32 PM
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
3 Views