JetBrains/kotlin-native

static library has no debug info?

acc110789 opened this issue · 9 comments

I have a demo mpp project, its ios target produce a framework.
My ios project use this framework.
I found that when the framework is static library , i can not set kotlin breakpoint.

when the framework is not static as follows:

dynamic_configure

I can set kotlin breakpoints with lldb as follows:
dynamic_lib_result

But , when the framework is static as follows:
static_configure

I can not set kotlin breakpoints with lldb as follows:
static_lib_result
as you can see, it says: Unable to resolve breakpoint to any actual locations.

We want our mpp project to produce static library framework , but how can we enable kotlin debugging. Is there something wrong? Do you have any suggestion?

Hello! A static framework does contain a debug information so probably it was stripped by some other tool. Could you please share your project?

Hello! A static framework does contain a debug information so probably it was stripped by some other tool. Could you please share your project?

hello, https://github.com/acc110789/TestIOSFramework
this is my demo mpp project.
clone this repo.

and execute: "gradlew :kn_rocket:linkDebugFrameworkIos"
then "kn_rocket/build/bin/ios/debugFramework/kn_rocket.framework" are generated.

then create a empty ios project and add the generated framework to this ios project.

then invoke IOSInitializers.getHelloWorld() as follows:

example

break to NSLog(@"hello from kotlin %@", [[KNIOSInitializers iOSInitializers] getHelloWorld]);

then try set kotlin breakpoint with b IOSInitializers.kt:14 in lldb terminal

and then you will find you fail to set this kotlin breakpoint.

If you need my ios project , i can also upload my ios project to github, it is just an empty ios project

Actually , I just want the produced static library framewok debuggable.

Hello! A static framework does contain a debug information so probably it was stripped by some other tool. Could you please share your project?

hello,Is there any problem?

Hello, thank you for provided project. We're able to reproduce the issue. What we see that both binaries static framework and result application have debug information. We're investigating at the moment why lldb can't resolve breakpoint.

Hello,
you can do following:

  1. go to the folder where your application is built
  2. run dsymutil on binary, e.g. dsymutil StatBr.app/StatBr
  3. now AppCode or Xcode can set breakpoints in static framework for you.

thx

the workoaround isn't required anymore after 1.4-rc. for more details please take a look at https://youtrack.jetbrains.com/issue/KT-40566