-
Notifications
You must be signed in to change notification settings - Fork 136
kotlin improvements: debugger and compilation #349
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
Conversation
…eference debug information)
…to have Dwarf* prefix. Just to make difference with all kinds of debug information
…find offset from method start)
- for each instruction variable slice is generated (list of visible variables at this instruction) - variables are being resolved not by line number of call stack but by PC - for this special table of pc to method start is generated which point to variables visible at specific PC
…ns in debug mode) for case when type of local doesn't match debug information. its kotlin case
* debug locations that were throwing exceptions removed * cleanup
… added. as debug version of llvm has assertion that checks for array type and will crash
…lving variables. As kotlin reuses arguments slots and this made mess. Now only relies on debug information provided in class file
…first instruction of line, not before last. othervise complex expressions will be half solved when BP reaches.
btw, RoboVM cache has to be wiped. |
… different symbols: one for saving offset and second for emitting it. otherwise it crashes on assert due symbol was used reason in debug builds
@dkimitsa should we merge this now, since the release is done? |
@florianf yes, snapshot will give better feed back. |
Are there any plans when this feature will be finished? Thanks! |
@Tom-Ski I merged the upstream changes in the soot repo, can you release a new version to sonatype? |
Heads up: this is not forgotten, still waiting for @Tom-Ski to push a new soot release. |
2.3.7-SNAPSHOT Idea plugin with recent fixes is available for testing |
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.2</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkimitsa, why so ancient maven-compiler-plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is lot of deprecated code, we hadn't touch it yet as long as it keep working
After I ran in some issues related to #220 and #349, I luckily got some help from @dkimitsa who provided the 2.3.7 Snapshot. So I want to give some testing feedback:
the plugin solves: 1. error compiling kotlin coroutines (#220)(https://gist.github.com/Franjoo/bfe600ae7e776a32d62919b98b7a7bef) 2. can not save and run roboVM on iOS simulator due to missing / unsafed run configurationnotes: 1. in libgdx projects it is needed to remove android module since there seems to be issues with facet configurations in workspace.xml2. Got compilation error when using 'implementation' instead of 'compile' using robovm in build.gradle3. Debugger was tested and works well4. plugin was tested in large(r) libgdx project and works as expected (cocoutines, ios simulator run configuration, debugger). |
hi @Franjoo, thank you for providing feedback. |
It seems there are quite a few critical fixes in this PR. |
have merged with master and re-build snapshot (link if first comment) |
NOTE: this PR is intended for 2.3.7-SNAPSHOT as introduces changes in compilation pipeline.
currently created for wide testing
This PR changes following:
reworked method resolution of variables for Debugger
post in blog
Problem: Soot splits variables slot on assignment for type resolution and not always it able to pack them back. As result during method flow variable can be located in different locals (memory addresses). This affects both Java and Kotlin.
Before: it was supposed that variable will be located at single memory address. that causes cases when variable was not resolved for debugger (as was resolved to multiple locals/memory location);
Now: for each instruction visible variable scope is resolved. As result variable debugger can handle splitter variable case. This variable scope index is saved in debug information in Column index (altogether with line number);
Changes for this:
Problems: some kotlin libraries has broken debug information as result some variables will not be resolved. post about this
added SMAP support for debugger
details in blog
Kotlin injects inline function in class files that messes line numbers information. But it also provides SMAP to allow get original line numbers. Support for SMAP was added
allowing soot to split slots dedicated for parameters
details in blog
Kolin re-uses parameter slots for local and this was not expected by RoboVM code. As result soot was not able to resolve local type constraints and crashed. Changes were done in Soot but also reflects debugger plugin.
This fixes #220
build instructions for MobiVM team
pre-build Idea plugin
rebuild IntelliJ Idea plugin (2.3.8-SNAPSHOT) is available for testing