Development environment:
NDK: r7
SDK and tools: r15
AVD: GB2.3.3, API level 10
I wrote a test application in which a thread will run in native. I saved a breakpoint in the stream. (In fact, when I tried to use the Galaxy S2, I received the error message: βStream debugging is not supported on this platform.β Therefore, I created AVD 2.3.3 Level 10).
After that I got an error like this
#0 0xafd0c51c in epoll_wait () from /Volumes/SecureCode/webos/rta/android/obj/local/armeabi/libc.so
I googled and found this Solution (link here).
I followed the guide lines there
$ adb pull /system/lib lib $ ndk-gdb ... (gdb) set solib-search-path lib
But after that also I canβt get to the breakpoint. I am still obsessed with this poll_wait () and not moving forward.
D:\EclipseTestWorkspace\CallbackJava>sh sh-4.1$ ndk-gdb --force --start --verbose Android NDK installation path: /cygdrive/c/Android/android-ndk Using default adb command: /cygdrive/c/Android/android-sdk-windows/platform-tools/adb ADB version found: Android Debug Bridge version 1.0.29 Using final ADB command: '/cygdrive/c/Android/android-sdk-windows/platform-tools/adb' Using auto-detected project path: . Found package name: com.callback ABIs targetted by application: armeabi Device API Level: 10 Device CPU ABI: armeabi Compatible device ABI: armeabi Found debuggable flag: true Found device gdbserver: /data/data/com.callback/lib/gdbserver Using gdb setup init: ./libs/armeabi/gdb.setup Using toolchain prefix: /cygdrive/c/Android/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi- Using app out directory: ./obj/local/armeabi Found data directory: '/data/data/com.callback' Found first launchable activity: .CallbackJavaActivity Launching activity: com.callback/.CallbackJavaActivity
Who would like to focus on the main part of how
(gdb) file ./libs/armeabi/libcallbacks.so A program is being debugged already. Are you sure you want to change the file? (y or n) y Reading symbols from D:\EclipseTestWorkspace\CallbackJava/./libs/armeabi/libcallbacks.so...(no debugging symbols found)...done. (gdb) file ./obj/local/armeabi/libcallbacks.so A program is being debugged already. Are you sure you want to change the file? (y or n) y Reading symbols from D:\EclipseTestWorkspace\CallbackJava/./obj/local/armeabi/libcallbacks.so...done. (gdb) break callbacks_java.cpp:appcallback_register Breakpoint 1 at 0x1a64: file D:/EclipseTestWorkspace/CallbackJava/jni/callbacks_java.cpp, line 419. (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x00001a64 in appcallback_register at D:/EclipseTestWorkspace/CallbackJava/jni/callbacks_java.cpp:419 (gdb) where
So, from the last error, I understand that it takes into account the absolute address 0x1a64. It does not take into account the relative address (run-time address), so it cannot get to the breakpoint. as well as getting stuck in epoll_wait () without moving further.
Someone please help me, how can I proceed further?
Thanks and respect,
SSuman185