Android gdb debugging and androidgdb debugging
[1]. Set the terminal directory to: proj. android
[2] add-g-ststabs + to the compilation option of the. make file.
[3]. Execute the compilation Script: sh./build_native.sh NDK_DEBUG = 1
[4]. push the generated gdbserver to the mobile phone and find a writable directory: adb push./libs/armeabi/gdbserver data/tmp
[5]. Start the app
[6]. Terminal: adb shell
[7]. Terminal: su
[8]. Terminal: cd data/tmp (to the directory where gdbserver is stored)
[9]. Obtain the app process number: ps com. fun. funm
[10]. Terminal:./gdbserver: 1080 [port]-attach 6280 [process number]
[11]. Switch to the proj. android Terminal
[12]. Terminal: adb forward tcp: 1080 tcp: 1080
[13]. Boot: ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gdb
[14]. Terminal: target remote: 1080 [15]. Open./lib/armeabi/gdb. setup and paste the two commands into the terminal for execution.