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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




--
Regards,
Peter Teoh
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux