Keil Logo

DS-5: WHAT SETUP IS REQUIRED FOR ANDROID DEBUG


Information in this knowledgebase article applies to:

  • ARM Development Studio 5

QUESTION

What setup is needed to use DS-5 for debugging Android native (C/C++) applications and libraries?

ANSWER

You can use DS-5 with the Android Software Development Kit (SDK) and Native Development Kit (NDK).

To install the Android SDK and NDK please refer to http://developer.android.com/index.html. Both development kits contain examples on how to get started.

Once you have your Android application running on a device, you can attach gdbserver to the process and start to debug native code with DS-5 Debugger.

To debug with DS-5 Debugger you need to:

  1. Install the Android SDK and NDK.
  2. Build the native code you want to debug with debug symbols.
  3. Start debugging your Java application on the device.
  4. Upload a copy of /system/bin/app_process from the target on to the computer that the debugger runs on. This file is needed by the debugger later on in order to find out which shared libraries are loaded by the target system. You can use the adb tool provided inside the Android SDK to transfer the file.
  5. Open a shell to the device (again this can be done with adb) and determine the process ID of the application you want to debug.
  6. Attach gdbserver to the process i.e. gdbserver --attach :port pid
  7. Setup a DS-5 debug connection to load the symbols for app_process, set the shared library search path (location of the library on the host containing debug symbols) and configure the debugger to connect only.
  8. Connect DS-5 Debugger to gdbserver. (On the android emulator you can forward the port to debug over using the adb tool. In this case connect the debugger to IP address localhost.)
  9. Now you'll have two debug connections, one Java debug connection and one DS-5 connection attached to the same process.

Note that gdbserver 6.6, which is currently supplied in the default Android file system, has insufficient support to debug applications with multiple threads. You will need to upgrade to a later version of gdbserver if your application contains multiple threads.

SEE ALSO

Last Reviewed: Saturday, June 26, 2010


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.