<div dir="ltr"><div class="gmail_quote">Thanks your replies! I found the target.</div><div class="gmail_quote"><br></div><div class="gmail_quote">2013/12/5 ¤W¤È9:34 ©ó "Peter Teoh" <<a href="mailto:htmldeveloper@gmail.com" target="_blank">htmldeveloper@gmail.com</a>> ¼g¹D¡G<br>
</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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>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><br></div><div>(NOTE: i played with this almost like 8 or 9 years ago, and it seemed now kdb is not updated any more.)</div><div><br></div><div>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><br></div><div>diff between the two is explained here:</div><div><br></div><div><a href="https://www.kernel.org/pub/linux/kernel/people/jwessel/kdb/CompileKDB.html" target="_blank">https://www.kernel.org/pub/linux/kernel/people/jwessel/kdb/CompileKDB.html</a><br>
</div><div><br></div><div>and setup are here (mainly for kgdb):</div><div><br></div><div><div><a href="http://elinux.org/KDB" target="_blank">http://elinux.org/KDB</a><br></div><div><a href="http://allmybrain.com/2010/04/29/debugging-linux-kernel-modules-with-virtualbox-and-kgdb/" target="_blank">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/" target="_blank">http://www.linuxforu.com/2011/03/kgdb-with-virtualbox-debug-live-kernel/</a><br></div><div><br></div><div>have fun.</div>
<div><br>
</div></div><div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 3, 2013 at 8:35 PM, ¤D§»©P <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" target="_blank">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><div>-- <br></div>Regards,<br>Peter Teoh
</div>
</blockquote></div>
</div>