Low level Android Debugging
Is there a way to trace through function calls at the lowest levels of the Android system? Right now when I debug in Eclipse, it goes through the source files that are located inside the frameworks fo开发者_如何学Pythonlder, but is it possible to go even lower? For example show what functions are being called from the libcore folder. I am also interested to find how it communicates with the linux kernel at the bottom of the layers. Is there a way to do this? Thanks
The lowest level you can go with eclipse debugger if you add all framework source folders is up to JNI calls (the layer that interfaces with native code).
If you want to go lower you need to use gnu gdb debugger, here you will find a guide on how to use it.
http://android.opensourceror.org/2010/01/18/android-source/
Try this :)
In all cases mentioned below, first you need to be root on the mobile phone.
At each process level, you can use "strace" (available from android SDK which u can copy into the phone).
http://tthtlc.wordpress.com/2011/02/06/analysing-the-softkeyboard-in-android/ http://tthtlc.wordpress.com/category/android/page/5/
At the kernel level, depending on the phone's ftrace config flag (but most phone's kernel config followed that of Google ASOP):
http://tthtlc.wordpress.com/2011/12/29/playing-with-ftrace-option-on-my-xperia-arc-s/
I guess the easy way would be compiling your own version of android from https://android.googlesource.com and making it debuggable.
精彩评论