ARM Technical Support Knowledge Articles

DS-5 is showing gdbserver errors when I try to debug my Android native library

Applies to: DS-5

Scenario

If you are attempting to debug an Android native library, and encountering error message similar to the following errors in DS-5, then this Knowledge Article applies to you.

Error #1

Popup window:

Problem Occurred
'Connecting to Target' has encountered a problem.
Failed to communicate with gdbserver at localhost on port 5000. No data received.

App Console:

run-as: exec failed for lib/gdbserver Error:No such file or directory

Error #2

Popup window:

Failed to attach gdbserver to <Android application name>. Unable to locate gdbserver in </data/data/<Android application name>/lib/>. Rebuild the application with NDK_DEBUG=1

Answer

DS-5 relies on gdbserver being present within an Android application's .apk file.  If gdbserver is not present within the .apk file, DS-5 will be unable to launch gdbserver on the target device. You can ensure that the generated .apk has gdbserver by building within the NDK environment with the NDK_DEBUG option set (NDK_DEBUG=1). Furthermore, if you are using TCP over USB, you would need to do some port forwarding to ensure port 5000 is accessible by gdb debugging (please see the following link as an example of port forwarding).

Please make sure you are using the latest version of DS-5.

How do I use the Android adb to forward Gator data over USB?

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential