15.8 C
Saturday, May 18, 2024

ios – Debugging Kotlin IOSMain code utilizing Xcode

I’ve the newest xcode-kotlin plugin set up on my XCODE model 15.4. (By the best way, the newest model of the xcode-kotlin plugin put in on XCODE 15.4 utilizing brew with no extra set up workarounds wanted as described within the set up process!) Utilizing the Xcode-kotlin plugin is definitely a giant massive assist. Setting breakpoints and stepping via the code works nice. The issue is that I am not capable of view the contents of body variables saved in iosMain. For instance, in my iosMain, I’ve the next variable outlined within the implementation of iOS precise class:

 var pathUrl: NSURL?

The variable is about within the constructor for that class:

     precise constructor(pathname: String) {
         pathUrl = NSURL.URLWithString(pathname)

I will step via the code and break at that line. The issue is that I can not view the worth of “pathURL.path” from lldb. From the lldb console, I can do the next:

 (lldb) body variable _this->pathUrl
 (ObjHeader *) _this->pathUrl = []

That is advantageous and dandy, however I need to see the worth of the trail for that variable. I’ve tried quite a few methods coerce that variable to be a (NSURL *), however I’ve not discovered anyway to efficiently do this. On this context, NSURL is from Kotlin “platform.Basis”. My understanding is that it is a Kotlin wrapper class for Apples NSURL class. I’ve no downside seeing variables equivalent to “pathname” which come from the stack. Please word that I clearly know what I am setting the trail to; I am simply utilizing this for instance and my actual downside is that I can not seem to see the worth of body variables contained within the shared “iosMain” if that body variable is a “platform.Basis” class. Additionally word, I attempted to view pathUrl.path after its worth was set within the constructor. I additionally couldn’t view the contents of pathUrl later in one other technique by which I used to be referencing pathUrl.

Right now, I feel that this is because of a limitation of the Xcode-kotlin plugin as a result of it would not have sufficient details about the “platform.Basis” symbols. So the elemental query I am asking boils right down to this:

 1.) Is there a means for me to view the contents of this body variable utilizing lldb?, or
 2.) Is there a means for me to let Xcode-kotlin plugin find out about "platform.Basis" symbols?

Latest news
Related news


Please enter your comment!
Please enter your name here