Question

I modified the libwebcore.so in my Android rootfs and now I want to debug it but the browser crashes instantly if I start with

am start -n com.android.browser/.BrowserActivity

If I'm trying to start with -D switch it hangs and says:

Application Browser (process com.android.browser) is waiting for the debugger to attach

But when I attach the gdbserver to the browser pid nothing happens.

So is there a way to debug the browser if it crashes after you start it?

Était-ce utile?

La solution

  1. Place an infinite loop at the earliest possible point inside libwebcore.so (or at least early enough that you know the point-of-crash will not have executed yet.)
  2. Attach gdbserver to PID
  3. Use GDB to break the infinite loop
  4. Debug

Autres conseils

NDK developers can use ndk scripts to debug apps easily. When it comes to debugging AOSP native code, you are on your own.

As the app you are trying to debug is Android Java app, you can use app_process as target executable and attach to running app using gdbserver. Please check Debugging native libs of Android Java apps for step by step tutorial.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top