This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM DS-5 Tutorial For Android

Note: This was originally posted on 5th December 2011 at http://forums.arm.com

Hi,

I've created a step by step blog post for using DS-5 as debugger tool for Android http://kernel.ozandroid.info/?p=83

Hope this is useful for others.

Cheers
Parents
  • Note: This was originally posted on 10th December 2011 at http://forums.arm.com

    Thanks for great tutorials, but I have a problems with it...

    I've followed your tutorial closely, but I'm not able to get it works correctly (not sure where I could make mistake). I've tried it two times, but still no luck :(
    I've tried with HelloNeon example, and also with NativeActivity (which I'm most interested to get debugging work - I don't want to touch any Java code)

    My system is Win7 x64 Pro, and device is Samsung Galaxy S2 (GT-I9100) running 2.3.5 (I91000XXKI4). Eclipse 3.7.1 (32-bit). I've replaced gdbserver in NDK with one found in ARM Extras (as in tutorial), and I can confirm that my 'samples\native-activity\libs\armeabi\gdbserver' is correct one.
    Also I have tried to rebuild NDK app and .apk, after setting debuggable="true" (tutorial tells to run ndk-build first, and then set debugabble="true", but AFIK debugging symbols are generated only if debuggable="tru

    What else information could be useful to diagnose this case?

    Example log from Commands window:

    Connected to unknown platform
    Execution stopped at: 0xAFD0C59C
    0xAFD0C59C   POP      {r4,r7}
    file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process"
    WARNING(IMG53): app_process has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\libc.so"
    Loading library symbols: libc.so
    WARNING(IMG53): libc.so has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\obj\local\armeabi\libnative-activity.so"
    Loading library symbols: libnative-activity.so
    cd "D:\Dev\Android\workspace"
    Working directory "D:\Dev\Android\workspace"
    directory "D:\Dev\Android\android-ndk-r7\samples\native-activity"
    Source directories searched: D:\Dev\Android\android-ndk-r7\samples\native-activity;$cdir;$cwd;$idir
    break -p "D:/Dev/Android/android-ndk-r7/samples/native-activity/jni/main.c":270
    Breakpoint 1 at 0x81302AD8
        on file main.c, line 270
    run
    Starting target with image D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process
    Running from entry point
    ERROR(LUX42): Stopped due to signal 5: SIGTRAP (Trace trap (used by debugger))
    Application terminated due to signal 5


    Sometimes in Commands I get:
    Connected to unknown platform
    Execution stopped at: 0xAFD0C59C
    0xAFD0C59C   POP      {r4,r7}
    file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process"
    WARNING(IMG53): app_process has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\libc.so"
    Loading library symbols: libc.so
    WARNING(IMG53): libc.so has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\obj\local\armeabi\libnative-activity.so"
    Loading library symbols: libnative-activity.so
    cd "D:\Dev\Android\workspace"
    Working directory "D:\Dev\Android\workspace"
    directory "D:\Dev\Android\android-ndk-r7\samples\native-activity"
    Source directories searched: D:\Dev\Android\android-ndk-r7\samples\native-activity;$cdir;$cwd;$idir
    break -d -p "D:\Dev\Android\android-ndk-r7\samples\native-activity\jni\main.c":270
    Breakpoint 1 at 0x81302AD8
        on file main.c, line 270
    condition 1
    break-script 1 ""
    ignore 1 0
    break-stop-on-threads 1
    unsilence 1
    Breakpoint 1 unsilenced
    break -d -p "D:\Dev\Android\android-ndk-r7\samples\native-activity\jni\main.c":237
    Breakpoint 2 at 0x81302A4A
        on file main.c, line 237
    condition 2
    break-script 2 ""
    ignore 2 0
    break-stop-on-threads 2
    unsilence 2
    Breakpoint 2 unsilenced
    enable 2
    Breakpoint 2 enabled
    enable 1
    Breakpoint 1 enabled
    disable 1
    Breakpoint 1 disabled
    enable 1
    Breakpoint 1 enabled
    run
    Starting target with image D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process
    Running from entry point
    Stopped due to signal 19: SIGSTOP (Stop executing (can't be caught or ignored))
    Execution stopped at: 0xAFD0C59C
    0xAFD0C59C   POP      {r4,r7}
    wait
    continue


    Log from App Console window:

    Attached; pid = 10615
    Listening on sockaddr socket debug-socket
    libthread_db:td_ta_new: Probing system for platform bug.
    libthread_db:_get_task_permitted_caps: Found CapPerm of 0 in /proc/10848/task/10848/status
    libthread_db:_get_task_permitted_caps: Found CapPerm of 0 in /proc/10615/task/10615/status
    libthread_db:_get_task_permitted_caps: Found CapPerm of 2097152 in /proc/10615/task/10616/status
    libthread_db:td_ta_new: AAAAAH, Can't debug threads!

    Child terminated with signal = 0x5 (SIGTRAP)


    Very often I get errors like:
    Failed gdbserver configuration:
    Timeout. PID not found!
    Failed gdbserver configuration:
    Timeout. PID not found!


    Is there anyone who can tell me what's wrong? I can add, that I'm trying to get NDK debugging for about half year(!) on SGS2, but with no luck :( I've tried several tutorials (with Sequoyah, Tegra Android Dev, etc.) - non of them worked for me. Now I've tried ARM DS-5, but again - not working.

    Is it something wrong with SGS2 or it's just me?
Reply
  • Note: This was originally posted on 10th December 2011 at http://forums.arm.com

    Thanks for great tutorials, but I have a problems with it...

    I've followed your tutorial closely, but I'm not able to get it works correctly (not sure where I could make mistake). I've tried it two times, but still no luck :(
    I've tried with HelloNeon example, and also with NativeActivity (which I'm most interested to get debugging work - I don't want to touch any Java code)

    My system is Win7 x64 Pro, and device is Samsung Galaxy S2 (GT-I9100) running 2.3.5 (I91000XXKI4). Eclipse 3.7.1 (32-bit). I've replaced gdbserver in NDK with one found in ARM Extras (as in tutorial), and I can confirm that my 'samples\native-activity\libs\armeabi\gdbserver' is correct one.
    Also I have tried to rebuild NDK app and .apk, after setting debuggable="true" (tutorial tells to run ndk-build first, and then set debugabble="true", but AFIK debugging symbols are generated only if debuggable="tru

    What else information could be useful to diagnose this case?

    Example log from Commands window:

    Connected to unknown platform
    Execution stopped at: 0xAFD0C59C
    0xAFD0C59C   POP      {r4,r7}
    file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process"
    WARNING(IMG53): app_process has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\libc.so"
    Loading library symbols: libc.so
    WARNING(IMG53): libc.so has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\obj\local\armeabi\libnative-activity.so"
    Loading library symbols: libnative-activity.so
    cd "D:\Dev\Android\workspace"
    Working directory "D:\Dev\Android\workspace"
    directory "D:\Dev\Android\android-ndk-r7\samples\native-activity"
    Source directories searched: D:\Dev\Android\android-ndk-r7\samples\native-activity;$cdir;$cwd;$idir
    break -p "D:/Dev/Android/android-ndk-r7/samples/native-activity/jni/main.c":270
    Breakpoint 1 at 0x81302AD8
        on file main.c, line 270
    run
    Starting target with image D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process
    Running from entry point
    ERROR(LUX42): Stopped due to signal 5: SIGTRAP (Trace trap (used by debugger))
    Application terminated due to signal 5


    Sometimes in Commands I get:
    Connected to unknown platform
    Execution stopped at: 0xAFD0C59C
    0xAFD0C59C   POP      {r4,r7}
    file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process"
    WARNING(IMG53): app_process has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\libc.so"
    Loading library symbols: libc.so
    WARNING(IMG53): libc.so has no line debug information
    add-symbol-file "D:\Dev\Android\android-ndk-r7\samples\native-activity\obj\local\armeabi\libnative-activity.so"
    Loading library symbols: libnative-activity.so
    cd "D:\Dev\Android\workspace"
    Working directory "D:\Dev\Android\workspace"
    directory "D:\Dev\Android\android-ndk-r7\samples\native-activity"
    Source directories searched: D:\Dev\Android\android-ndk-r7\samples\native-activity;$cdir;$cwd;$idir
    break -d -p "D:\Dev\Android\android-ndk-r7\samples\native-activity\jni\main.c":270
    Breakpoint 1 at 0x81302AD8
        on file main.c, line 270
    condition 1
    break-script 1 ""
    ignore 1 0
    break-stop-on-threads 1
    unsilence 1
    Breakpoint 1 unsilenced
    break -d -p "D:\Dev\Android\android-ndk-r7\samples\native-activity\jni\main.c":237
    Breakpoint 2 at 0x81302A4A
        on file main.c, line 237
    condition 2
    break-script 2 ""
    ignore 2 0
    break-stop-on-threads 2
    unsilence 2
    Breakpoint 2 unsilenced
    enable 2
    Breakpoint 2 enabled
    enable 1
    Breakpoint 1 enabled
    disable 1
    Breakpoint 1 disabled
    enable 1
    Breakpoint 1 enabled
    run
    Starting target with image D:\Dev\Android\android-ndk-r7\samples\native-activity\bin\app_process
    Running from entry point
    Stopped due to signal 19: SIGSTOP (Stop executing (can't be caught or ignored))
    Execution stopped at: 0xAFD0C59C
    0xAFD0C59C   POP      {r4,r7}
    wait
    continue


    Log from App Console window:

    Attached; pid = 10615
    Listening on sockaddr socket debug-socket
    libthread_db:td_ta_new: Probing system for platform bug.
    libthread_db:_get_task_permitted_caps: Found CapPerm of 0 in /proc/10848/task/10848/status
    libthread_db:_get_task_permitted_caps: Found CapPerm of 0 in /proc/10615/task/10615/status
    libthread_db:_get_task_permitted_caps: Found CapPerm of 2097152 in /proc/10615/task/10616/status
    libthread_db:td_ta_new: AAAAAH, Can't debug threads!

    Child terminated with signal = 0x5 (SIGTRAP)


    Very often I get errors like:
    Failed gdbserver configuration:
    Timeout. PID not found!
    Failed gdbserver configuration:
    Timeout. PID not found!


    Is there anyone who can tell me what's wrong? I can add, that I'm trying to get NDK debugging for about half year(!) on SGS2, but with no luck :( I've tried several tutorials (with Sequoyah, Tegra Android Dev, etc.) - non of them worked for me. Now I've tried ARM DS-5, but again - not working.

    Is it something wrong with SGS2 or it's just me?
Children
No data