Android Kernel Debugging

后端 未结 3 797
耶瑟儿~
耶瑟儿~ 2020-12-24 04:44

I have been experimenting with getting kgdb to work the Nexus One.

I have pulled the kernel from https://android.googlesource.com and enabled everything

3条回答
  •  我在风中等你
    2020-12-24 05:15

    I have got no experience with Android hardware, but I have done kgdb-compiled kernel running as VirtualBox client, and from the host connect into the guest via virtual serial port, and using gdb (with standard "target remote" command) I can step through the entire bootup of the virtual guest kernel - with the help of kgdbwait. Without this, I can write a kernel module that does nothing except to implement an inline assembly that called "int 13", which is 0xcc. Once loaded, a breakpoint will appear at the host-side of the serial connection, and then I can set breakpoint and continue excution of the kernel. This works because kgdb handle the exception "int 13". If u explicitly create other kind of exception like "*p = 0", and p is pointing to NULL, u will still get a breakpoint, but I doubt if u can continue execution.

提交回复
热议问题