NDK debug in eclipse from Windows

211 views
Skip to first unread message

Sergey Solozhentsev

unread,
Aug 27, 2014, 4:36:11 AM8/27/14
to andro...@googlegroups.com
I cannot debug even simple application with latest ndk, ADT, eclipse
I setup ndk and code works fine. However when I try to debug as native application I have in log

warning: Could not load shared library symbols for 92 libraries, e.g. /system/bin/linker.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Unable to find dynamic linker breakpoint function.
GDB will retry eventurally.  Meanwhile, it is likely
that GDB is unable to debug shared library initializers
or resolve pending breakpoints after dlopen().

I googled a lot about this issue and nothing helps me. I installed cygwin. And it also does not help. 

What should I do make it debuggable?
my1.zip

Fudge Mutator

unread,
Aug 29, 2014, 4:17:44 PM8/29/14
to andro...@googlegroups.com

The adt plugin has miserable c++ debugging support in my experience. To make it work, do the following:
- Use the NDK_DEBUG=1 flag when you build with ndk-build. 
- Some say you need to set android:debuggable="true" on the application tag in your AndroidManifest.xml file. Not sure that this is true but it cant hurt.
- if you have an Application.mk file, make sure it has APP_OPTIM := debug, not release.
- Make sure eclipse knows where your ndk is: Windows->Preferences->Android->NDK and enter the root directory.
- Create a new debug configuration in eclipse by clicking on the arrow next to the bug icon --> debug configurations --> new config.  Select your project and the rest of the defaults should be fine. Debug using this config when you debug.

The above steps makes it work but its pretty slow.  I find using gdb directly works better.

Let me know if you have any issues.

-Jim

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.

Ray Donnelly

unread,
Aug 29, 2014, 4:20:48 PM8/29/14
to andro...@googlegroups.com
On Fri, Aug 29, 2014 at 9:16 PM, Fudge Mutator <fudgem...@gmail.com> wrote:
> The adt plugin has miserable c++ debugging support in my experience. To make
> it work, do the following:
> - Use the NDK_DEBUG=1 flag when you build with ndk-build.
> - Some say you need to set android:debuggable="true" on the application tag
> in your AndroidManifest.xml file. Not sure that this is true but it cant
> hurt.
> - if you have an Application.mk file, make sure it has APP_OPTIM := debug,
> not release.
> - Make sure eclipse knows where your ndk is:
> Windows->Preferences->Android->NDK and enter the root directory.
> - Create a new debug configuration in eclipse by clicking on the arrow next
> to the bug icon --> debug configurations --> new config. Select your
> project and the rest of the defaults should be fine. Debug using this config
> when you debug.
>
> The above steps makes it work but its pretty slow. I find using gdb
> directly works better.
>
> Let me know if you have any issues.
>

I'd recommend you try Qt Creator for C++ debugging on Android. You
don't need to build Qt projects with it if you don't want to.
Reply all
Reply to author
Forward
0 new messages