Anamorphosee / stacktrace-decoroutinator

Small lib for recovering stack trace in exceptions thrown in Kotlin coroutines
Apache License 2.0
158 stars 4 forks source link

Make getDebugMetadataInfo robust against extra instructions at the start of a method #19

Closed p4654545 closed 1 year ago

p4654545 commented 1 year ago

Jacoco (and other instrumenters) may add instructions at the start of a method. Jacoco typically adds a call to $jacocoInit.

This PR changes the getDebugMetadataInfo logic such that it finds the first occurrence of the required instruction pair.

I made sure that Jacoco only instruments the new class JacocoInstrumentedMethodTest in runtime-test-jvm.kt.

p4654545 commented 1 year ago

I assume you can somehow squash the commits into one.