Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to attach ndk-gdb to android process
    primarykey
    data
    text
    <p>I have two processes in the Android application- main application process and a remote service process. The native libraries are loaded from the remote service process.</p> <p>I want to debug the native library code. The application is debuggable. The native library was built from Windows command-line using ndk-build. In Android.mk, -g -ggdb flag was used for this library. I am running ndk-gdb from cygwin.</p> <p>Test device: Galaxy Nexus running Android 4.2.2</p> <p>Error line: error while loading shared libraries: ?: cannot open shared object file: No such file or directory</p> <p>In the verbose information, I see that gdbserver is trying to attach to process id of the main application process. Should it matter that the library is loaded from a remote process within this application.</p> <p>Detailed ndk-gdb run information- $ ndk-gdb --verbose --force<br> Android NDK installation path: /cygdrive/c/work/android/ndk/android-ndk-r9-windows-x86/android-ndk-r9<br> Using default adb command: /cygdrive/c/work/android/sdk/android-sdk_r10-windows/android-sdk-windows/platform-tools/adb<br> ADB version found: Android Debug Bridge version 1.0.31<br> Using ADB flags:<br> Using JDB command: /cygdrive/c/program files (x86)/java/jdk1.6.0_25/bin/jdb<br> Using auto-detected project path: .<br> Found package name: [application-pkg-name]<br> ABIs targetted by application: armeabi<br> Device API Level: 17<br> Device CPU ABIs: armeabi-v7a armeabi<br> Compatible device ABI: armeabi<br> Using gdb setup init: ./libs/armeabi/gdb.setup<br> Using toolchain prefix: /cygdrive/c/work/android/ndk/android-ndk-r9-windows-x86/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-<br> Using app out directory: ./obj/local/armeabi<br> Found debuggable flag: true<br> Found device gdbserver: /data/data/[applcation-pkg-name]/lib/gdbserver<br> Found data directory: '/data/data/[applcation-pkg-name]'<br> Found running PID: 17890<br> Launched gdbserver succesfully.<br> Setup network redirection<br> ## COMMAND: adb_cmd shell run-as [applcation-pkg-name] lib/gdbserver +debug-socket --attach 17890<br> ## COMMAND: adb_cmd forward tcp:5039 localfilesystem:/data/data/[applcation-pkg-name]/debug-socket Attached; pid = 17890 [Comment: This pid is for the main application process]<br> Listening on Unix socket debug-socket<br> ## COMMAND: adb_cmd pull /system/bin/app_process obj/local/armeabi/app_process<br> 493 KB/s (9592 bytes in 0.019s)<br> Pulled app_process from device/emulator.<br> ## COMMAND: adb_cmd pull /system/bin/linker obj/local/armeabi/linker<br> 1165 KB/s (63244 bytes in 0.053s)<br> Pulled linker from device/emulator.<br> ## COMMAND: adb_cmd pull /system/lib/libc.so obj/local/armeabi/libc.so<br> 2442 KB/s (297608 bytes in 0.119s)<br> Pulled libc.so from device/emulator.<br> /cygdrive/c/work/android/ndk/android-ndk-r9-windows-x86/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-gdb.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory </p> <p>Couple of side notes that could be helpful-<br> 1) If I run the ndk-gdb command without --force, it gives me error that Another debug session is running. Although the gdb prompt came out during the last run. 2) On Android 4.3, with the same application and setup, I get error that "Could not extract package's data directory"</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload