-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging process for the creators of custom libraries based on serialisation-core #1888
Comments
@akuleshov7 That Generated decoders basically will first start to decode the (inline) structure, and inside loop to read the index of the next item to decode, if it is not DECODE_DONE it will then, based upon the actual index, call an appropriate decode... method on the decoder (setting a local variable with the value), once finish, close the struct and construct and return the parsed object. |
@pdvrieze I know how the process works, I learnt it while we were making ktoml :) The problem is that we are not able to debug it properly in case of such corner cases. That’s why I am asking, if there is any convenient way of how to debug such problems easily. How do new people, who do not understand how the core framework works, debug it? |
It is the problem that core library authors also experience :) Indeed, you can only navigate to the code that actually exists (pay attention this includes code from core runtime library, like AbstractDecoder, Decoder, etc — if you can't do that, check that you've correctly attached library sources. ) It is currently impossible to view or navigate to plugin-generated code automatically; and I can't promise that things will be changed in the nearest future (maybe this problem would be solved as a part of public plugin API). It is currently possible to 'decompile to Java' as was suggested above; the most easy way is to do this in IDEA: Find compiled class in You can also check out guide to custom composite serializers — layout of generated code is very similar to them. |
@sandwwraith Lenya, you are the best, thank you for your answer. I actually missed the moment when there appeared "Decompile Kotlin to Java" functionality. This works pretty good, I can easily understand what is going on under the hood 😄 That helped, at least in my simple cases. But actually, anyway I suppose that debugger team should make the support of navigation through the code generated by compiler plugins. Sounds good for JetBrains-research, isn't it? 😃 |
I am working with ktoml - custom serializer for TOML format.
Our contributors sometimes need to debug our library and to see a full call stack of methods (including the stack to the core framework).
For example, we have an internal issue and would like to debug the following test to understand which core method calls our methods in the library:
Right now we are not able to see the stack to the serialization-core. Debugger only points to
@Serializable
annotation without any stack to real methods provided by serialization library.We only know that "something" (generated code) calls methods from our library:
=====================
Could you please help and propose any method for debugging that could help us to understand the call chain in serialisation-core? Also it would be very helpful for the community if there would be a small documentation for creators of serialization library (with such things like debugging, call chains, etc).
The text was updated successfully, but these errors were encountered: