https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

rrva

04/27/2022, 3:59 PM
Is it possible to set a conditional breakpoint on every String value created in a complex codebase and catch the creation of a specific String? (Regardless of which constructor to java.lang.String is used). I tracked down my specific bug but became curious on how to do it. Or can I get a creation trace via jvm flight recorder?
k

Klitos Kyriacou

04/27/2022, 5:55 PM
Try setting a breakpoint on every (public & package-private) constructor of java.lang.String (I expect Kotlin strings will ultimately be Java Strings) and set a condition on the breakpoint. Be prepared for your app to run very slowly.
4 Views