0

Debugging a Native app, using ndk-gdb. I get the following, when I step through the code.

(gdb) n
Single stepping until exit from function my_current_function_name,
which has no line number information.

So, I'm unable to debug the app. The debugger directly steps until it finds a function with line-number information.

Our project is structured with all the core application code, in a separate project, which will be first compiled into a shared-library (.so file). Then, we build the project, which links the shared library and generates the APK file. The code in the JNI folder has been built with the line-number info. But, the code in the separate project, which is compiled using androideabi-gcc, into a .so file, doesn't have the line-number info.

Edit: Forgot to mention that "-g -ggdb" flags are already there in the Makefile. This issue is seen in-spite of these flags.

Rakesh Gopal
  • 580
  • 5
  • 11
  • You kind of answer your own question: the separate .so (LOCAL_PREBUILT_SHARED_LIBARIES?) does not have line-number info. You can change the build flags for this .so, can't you? You can even compile it as a static library, to make debugging a bit easier (assuming that the problem you are trying to solve with `gdb` is not specific to multi-so nature of the app). – Alex Cohn Jul 02 '14 at 20:43
  • @AlexCohn I've already added the -g and -ggdb flags (they were there in the Makefile, before itself, added by my colleague, long ago). But still, I'm still unable to debug using ndk-gdb. What flags exactly am I supposed to add, to get the line-number info? Thanks for the response. – Rakesh Gopal Jul 03 '14 at 06:50
  • 1
    Maybe, the debug info was stripped away. Try the "fat" copy of the .so file from `SeparateProject/obj/local/armeabi`, not from `SeparateProject/libs/armeabi`. – Alex Cohn Jul 03 '14 at 11:23
  • @AlexCohn That was a good thing to look for. I tried it just now. Looks like the obj doesn't support GDB. It's not even able to set break-points, if I use the .so files in obj directory. Let-alone stepping through the code. – Rakesh Gopal Jul 03 '14 at 13:55
  • You mean - the `lib` copy is "more debuggable"? – Alex Cohn Jul 03 '14 at 15:50
  • I don't know if it's more debuggable. But, this is what I'm seeing. – Rakesh Gopal Jul 03 '14 at 16:15

0 Answers0