<div dir="ltr">yes, exactly - what u are describing is called "kdb". don't mixed up with "kgdb". <div><br></div><div><br></div><div style>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.</div>
<div style><br></div><div style>(NOTE: i played with this almost like 8 or 9 years ago, and it seemed now kdb is not updated any more.)</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>diff between the two is explained here:</div><div style><br></div><div style><a href="https://www.kernel.org/pub/linux/kernel/people/jwessel/kdb/CompileKDB.html">https://www.kernel.org/pub/linux/kernel/people/jwessel/kdb/CompileKDB.html</a><br>
</div><div style><br></div><div style>and setup are here (mainly for kgdb):</div><div style><br></div><div style><div><a href="http://elinux.org/KDB">http://elinux.org/KDB</a><br></div><div><a href="http://allmybrain.com/2010/04/29/debugging-linux-kernel-modules-with-virtualbox-and-kgdb/">http://allmybrain.com/2010/04/29/debugging-linux-kernel-modules-with-virtualbox-and-kgdb/</a></div>
<div><a href="http://www.linuxforu.com/2011/03/kgdb-with-virtualbox-debug-live-kernel/">http://www.linuxforu.com/2011/03/kgdb-with-virtualbox-debug-live-kernel/</a><br></div><div><br></div><div style>have fun.</div><div><br>
</div></div><div style> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 3, 2013 at 8:35 PM, 乃宏周 <span dir="ltr"><<a href="mailto:naive231@gmail.com" target="_blank">naive231@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">For debugging purpose, I want something like 'getchar()' that can pause execution in the module code. Do any candidates I can choose?</div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh
</div>