2
votes

I have two projects on Eclipse, one produce so and the other is an Android application which use it. I am trying to debug the native code in the so.

Using the guide Using Eclipse for Android C/C++ Debugging after starting my project and running NDK, I am getting the following error.

cannot stat `./libs/armeabi-v7a/gdb.setup': No such file or directory when running ndk-gdb

How can I fix it?

2

2 Answers

2
votes

You didn't give much info, so I have to make assumptions.

That tutorial is set up for 'armeabi' but your error contains armeabi-v7a, so you probably have an ABI mismatch.

Your Application.mk is probably missing the following:

APP_ABI := armeabi-v7a

See this post if you're using a custom Application.mk via NDK_APPLICATION_MK: Android NDK debugging: armeabi-v7a not working

Also, your error contains gdb.setup whereas the tutorial uses gdb2.setup. Make sure you're using the file that ndk-gdb-eclipse generates.

On a side note, I don't recommend using gdb2.setup as this just confuses things. Your ndk-gdb-eclipse should output gdb.setup with line 704 commented out in ndk-gdb-eclipse (as of NDK r8c)

#echo "target remove :$DEBUG_PORT" >> $GDBSETUP
0
votes

If ndk-gdb says it can't find "./libs/armeabi-v7a/gdb.setup", first try to check if this file exists. From the same location in which you run ndk-gdb, can you see this file? If not you may be running from the wrong location.