PSN
PSN

Reputation: 2516

How can I view the stack traces of a native compiled C program in android?

I have compiled a c program for arm v7 using arm-linux-gnueabi-gcc -static -fno-stack-protector -fno-pie -march=armv7-a hello.c -o hello and pushed the binary to /data/local/hello inside the root of android device. I'm able to run the program using adb shell. But my question is how can I debug the program i.e., how can I see the Program Counter and such info?

Upvotes: 1

Views: 52

Answers (1)

Anton Malyshev
Anton Malyshev

Reputation: 8861

Try to use gdb in remote mode: https://source.android.com/devices/tech/debug/gdb probably it works already (had problems with it in past).

Also you can try to use Google Breakpad: https://github.com/google/breakpad/blob/master/README.ANDROID it works sometimes :)

Upvotes: 1

Related Questions