Debugging native code (C ++) using gdb on Android with Eclipse. Is it possible?

I have a piece of code that uses JNI. I can debug code written in Java directly in Eclipse (using ADT). I even have a script that help me debug my own code with gdb. However, this is not very convenient for this.

Is it possible to configure Eclipse to use gdb (I think gdbserver) to debbuging native Android applications? Do you know where I can find a description of this?

+3
source share
2 answers

according to the release notes from Android 2.2 NDK - now you can debug your own device code. refer to the NDK docs since I myself have not tried this.

+2
source

It depends on whether you want to debug the JNI code you wrote using the NDK apis and native code in AOSP applications.

In the first case, use the NDK debugging tools. For the latter, you need the correct version of gdbserver and gdb. The session must be configured using the gdb script to find characters for AOSP libs. Please check Debugging AOSP Native Applications for a walkthrough.

+1
source

Source: https://habr.com/ru/post/1746824/


All Articles