# Linux Kernel Module Cheat

#### 3.4.2. GDB module_init

TODO find a more convenient method. We have working methods, but they are not ideal.

This is not very easy, since by the time the module finishes loading, and `lx-symbols` can work properly, `module_init` has already finished running!

Possibly asked at:

- https://stackoverflow.com/questions/37059320/debug-a-kernel-module-being-loaded

- https://stackoverflow.com/questions/11888412/debug-the-init-module-call-of-a-linux-kernel-module

- GDB module_init step into it

- GDB module_init calculate entry address

- GDB module_init break at the end of sys_init_module

- GDB module_init add trap instruction