Note that there are some explanatory texts on larger screens.

plurals
  1. POcannot access memory at address 0X1 after setting up gdb and eclipse to debug shared library from Android Application
    primarykey
    data
    text
    <p>I have two Android Projects: one is a library and the other a regular application using this library. My aim is to debug the shared library from the android application. I followed this guide: </p> <p><a href="http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-debugging/" rel="noreferrer">http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-debugging/</a></p> <p>And I commented out the the last line</p> <pre><code>##$GDBCLIENT -x `native_path $GDBSETUP` </code></pre> <p>But the following line </p> <pre><code>##cp -f $GDBSETUP_INIT $GDBSETUP </code></pre> <p>complains with the message:</p> <p><code>it cannot stat ./libs/armeabi-v7a/gdb.setup</code> </p> <p>so I commented it out since I think Eclipse will uploaded it for me. Besides that I made sure that:</p> <ul> <li><p>In both Android.mk I put LOCAL_CFLAGS := -Wall –g </p></li> <li><p>I am getting the .so in the libs library of the application </p></li> <li><p>I made debuggable true in the application </p></li> <li><p>The gdb2.setup path modified in order to refer both to the .so using solib-search-path ./libs/armeabi-v7a/ and the source is get referenced using directory </p></li> </ul> <p>After stepping in the System.LoadLibrary instruction I executed the ndk-build-eclipse and no errors were produced and when I started debugging natively I got:</p> <blockquote> <p>Cannot access memory at address 0x1</p> </blockquote> <p>and on Cygwin I got:</p> <blockquote> <p>Remote debugging from host 0.0.0.0</p> </blockquote> <p>Here's the output of running the ndk-gdb-eclipse command:</p> <pre><code>$ ./ndk-gdb-eclipse --adb=/cygdrive/c/Utilities/adt-bundle-windows/adt-bundle-windows/sdk/platform-tools/adb --project=/cygdrive/c/Projects/IDSmart/IDSmartApp/IDSmart --force --port=5039 --verbose Android NDK installation path: /cygdrive/c/Utilities/android-ndk-r8c-windows/android-ndk-r8c/. Using specific adb command: /cygdrive/c/Utilities/adt-bundle-windows/adt-bundle-windows/sdk/platform-tools/adb ADB version found: Android Debug Bridge version 1.0.31 Using ADB flags: Using specified project path: /cygdrive/c/Projects/IDSmart/IDSmartApp/IDSmart Found package name: uk.co.idscan.idsmart ABIs targetted by application: armeabi-v7a Device API Level: 15 Device CPU ABIs: armeabi-v7a armeabi Compatible device ABI: armeabi-v7a Using gdb setup init: ./libs/armeabi-v7a/gdb.setup Using toolchain prefix: /cygdrive/c/Utilities/android-ndk-r8c-windows/android-ndk-r8c/./toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi- Using app out directory: ./obj/local/armeabi-v7a Found debuggable flag: true Found device gdbserver: /data/data/uk.co.idscan.idsmart/lib/gdbserver Found data directory: '/data/data/uk.co.idscan.idsmart' Found running PID: 7922 7922 Killing existing debugging session ## COMMAND: adb_cmd shell kill -9 7864 /system/bin/sh: kill: 7864: Operation not permitted Launched gdbserver succesfully. Setup network redirection ## COMMAND: adb_cmd shell run-as uk.co.idscan.idsmart lib/gdbserver +debug-socket --attach 7922 ## COMMAND: adb_cmd forward tcp:5039 localfilesystem:/data/data/uk.co.idscan.idsmart/debug-socket Attached; pid = 7922 Listening on Unix socket debug-socket ## COMMAND: adb_cmd pull /system/bin/app_process obj/local/armeabi-v7a/app_process 1373 KB/s (9848 bytes in 0.007s) Pulled app_process from device/emulator. ## COMMAND: adb_cmd pull /system/bin/linker obj/local/armeabi-v7a/linker 2147 KB/s (39592 bytes in 0.018s) Pulled linker from device/emulator. ## COMMAND: adb_cmd pull /system/lib/libc.so obj/local/armeabi-v7a/libc.so 2576 KB/s (282316 bytes in 0.107s) Pulled libc.so from device/emulator. </code></pre>
    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.
 

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