Why can't debug native code on x86 instruction set Android Emulator?

Viewed 178

I'm trying to debug a android project's native code ( .so files )

Here's what I've done :

  • setup a X86 Android Emulator using Android Studio
  • push gdbserver into Android Emulator inside ndk installation folder
  • running gdbserver, execute adb forward tcp:xxx tcp:xxx
  • using my gdb and connect to gdbserver

So far everything works just fine. I can pause the process and resume.
But once I set a breakpoint, and resume the execution. And when it hit the breakpoint and then resume the execution, it received a lot of SIGSEGV.


Now I thought it was a bug caused by gdbserver and gdb.

And then I turn to use IDA 7.5, and push android_x86_server into Android Emulator, setup everything and connect to it.

Same thing happens, before I set a breakpoint, everything works fine, but once I set a breakpoint and wait till execution to hit the breakpoint and then resume execution, It keeps received SIGSEGV at the same position ( causing by a instruction trying to access memory of 0x00 )


Another wired thing is even if I don't set a breakpoint, just randomly click pause and resume, I found that the EIP always stop at the same position whenever I click pause.


0 Answers
Related