How can I 'getchar()' in module code?

Peter Teoh htmldeveloper at gmail.com
Wed Dec 4 20:34:18 EST 2013


yes, exactly - what u are describing is called "kdb".   don't mixed up with
"kgdb".


kdb:   this is debugging on the same computer - so no serial ports
connection are needed.   once exception occurred, you will be popped into a
special debugger screen.   problem is that now this debugger is running in
kernel mode, inside the same computer that have the kernel module crashing,
and so everything stop running, only kdb is running.

(NOTE:   i played with this almost like 8 or 9 years ago, and it seemed now
kdb is not updated any more.)

kgdb:   this always require TWO computer:   host + debuggee.   kgdb is
running inside the debuggee whose kernel has crashed, and gdb is running in
host.   normally connected via serial port.   normally the preferred way is
to run the kernel to be debugged inside the VirtualBox, or VMWare, and then
gdb host is the virtual machine host.

diff between the two is explained here:

https://www.kernel.org/pub/linux/kernel/people/jwessel/kdb/CompileKDB.html

and setup are here (mainly for kgdb):

http://elinux.org/KDB
http://allmybrain.com/2010/04/29/debugging-linux-kernel-modules-with-virtualbox-and-kgdb/
http://www.linuxforu.com/2011/03/kgdb-with-virtualbox-debug-live-kernel/

have fun.




On Tue, Dec 3, 2013 at 8:35 PM, 乃宏周 <naive231 at gmail.com> wrote:

> For debugging purpose, I want something like 'getchar()' that can pause
> execution in the module code. Do any candidates I can choose?
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131205/9c63bf88/attachment.html 


More information about the Kernelnewbies mailing list