I have a project that compiles, loads and runs in the android device nicely. When I call the gdb server it also works fine. Then, when I call the gdb client to run through with breakpoints is when the message appears:
Error while mapping shared library sections:
/system/bin/linker: No such file or directory.
libandroid.so: No such file or directory.
liblog.so: No such file or directory.
libEGL.so: No such file or directory.
libOpenSLES.so: No such file or directory.
libGLESv2.so: No such file or directory.
libGLESv2_POWERVR_SGX540_120.so: No such file or directory.
...
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code
warning: shared library handler failed to enable breakpoint
This is my current Android.mk file, for the case some additional setup might be missing:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LS_CPP=$(subst $(1)/,,$(wildcard $(1)/*.cpp))
APP_MODULES := callbacks
APP_PLATFORM := android-14
APP_OPTIM:= debug
LOCAL_CFLAGS := -DRAPIDXML_NO_EXCEPTIONS
LOCAL_CFLAGS += -g
LOCAL_CFLAGS += -ggdb
LOCAL_CFLAGS += -O1
LOCAL_MODULE:=app3D
LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH))
LOCAL_LDLIBS := -landroid -llog -lEGL -lOpenSLES -lGLESv2
LOCAL_STATIC_LIBRARIES := android_native_app_glue png
LOCAL_STATIC_LIBRARIES += /jni
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
$(call import-module,libpng)
Any suggestion about what is the reason for such weird error and how to get rid of it?
All comments and hints are deeply appreciated and welcome.
Use ndk-gdb
instead of standard gdb
. Launch it from your project root directory. Consider using --verbose
option if you'd like to see what ndk-gdb
is doing.
You must add this line to your AndroidManifest.xml
also:
android:debuggable="true"
For instance, mine looks like:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:debuggable="true" >
your application.mk should define
APP_OPTIM := debug
With this you don't have to add -g
to your compiler flags, ndk-build will do so automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With