How to debug clean native code on Android?

I built a binary code that can be read from pure C ++ code, and it asks for a temporary error when working on an Android device.

How can I debug clean native code for Android? It seems that existing methods are not for clean code.

+5
source share
2 answers

Step 1: Put gdbserver and your own unstripped native executable (suppose it's called testexec) on the Android emulator. For instance. you can put it in the / data / data / test folder. And use the chmod command to add rights to them.

2: gdb. :

2.1: gdb , -:

 adb shell /data/data/test/gdbserver 10.0.2.2:1234 /data/data/test/testexec 

1234.

2.2. gdb gdbserver :

telnet localhost 5554 

:

Android Console: "help"

OK

:

redir add tcp:1234:1234

,

exit

2.3: gdb . :

arm-linux-androideabi-gdb.exe YOUR_ EXECUTABLE_PATH_ON_LOCAL_MACHINE\testexec

target remote localhost:1234

gdbserver.

, !

+3

Android GDB. , , "pure ++" , Java , ( ). . NDK.

-1

All Articles