I get "unresolved breakpoint" for any breakpoint in native code.
I've been successfully debugging my native library for a good while, but yesterday I had to reset Eclipse settings and workspace, so I've lost my debugging configuration and have to start over. Now I can't get it working. I use the "C/C++ application" debugging configuration; Android Native Application has never worked for me.
Algorithm for starting debugging - same as always, same as 3 years ago when I started developing for Android: 1. Set Java breakpoint right after loading the native library. 2. Run Java debug, wait for it to hit the breakpoint. 3. Run ndk-gdb --force from the Cygwin terminal. 4. Run the C++ debugging configuration.
There always have been some warnings in the console after launching the C++ debug config, unfortunately, I didn't pay attention to them as everything worked. Now I have warnings, too, and I don't know which of them are the new ones. Anyway, here's what I get:
Reading symbols from C:\Development\app\obj\local\armeabi-v7a\app_process...(no debugging symbols found)...done.
warning: .dynamic section for "libcrypto.so" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "libnative.so" is not at the expected address (wrong library or version mismatch?)
warning: Could not load shared library symbols for 95 libraries, e.g. libm.so.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
"No debugging symbols" in app_process seems suspicious, as well as "wrong library or version mismatch". But again, I can't remember if I had the same warnings when it worked fine or not. What I do remember for sure, though, is that there used to be one more line, the last one, saying something like "address 0xsomething adjusted to 0xsomething-1". it is now absent. That line is probably related to ".dynamic section for is not at the expected address", and my probably my breakpoints are unresolved for the same reason the address was not adjusted. But that doesn't help me find out what this reason is and how to fix the problem.
Note this is on Windows.
Here's what my C++ config looks like. I've tried "use full paths" both ways, no avail.
And this is my Application.mk:
APP_OPTIM := debug
APP_CFLAGS := -O0 -g -gdwarf-2
APP_STL := gnustl_static
APP_CPPFLAGS += -fexceptions -frtti -std=c++11 -rdynamic -funwind-tables
APP_CFLAGS += -Wno-psabi -Wno-deprecated-declarations -rdynamic -funwind-tables
GLOBAL_ARM_MODE := arm
APP_ABI := armeabi-v7a
APP_PLATFORM := android-12
NDK_TOOLCHAIN_VERSION := 4.9
APP_GNUSTL_FORCE_CPP_FEATURES := exceptions rtti
#Position-independent executable
APP_PIE := true
APP_MODULES := native
I also have debuggable=true
in manifest, and NDK_DEBUG=1
as an argument to ndk-build (although I believe I didn't have it previously and everything worked still).
I've tried all the suggestions from here to no avail: Why does Eclipse CDT ignore breakpoints?