1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 6. kgdb and kdb interoperability</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Using kgdb, kdb and the kernel debugger internals"><link rel="up" href="index.html" title="Using kgdb, kdb and the kernel debugger internals"><link rel="prev" href="EnableKGDB.html" title="Chapter 5. Using kgdb / gdb"><link rel="next" href="ch06s02.html" title="Running kdb commands from gdb"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. kgdb and kdb interoperability</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="EnableKGDB.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch06s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="switchKdbKgdb"></a>Chapter 6. kgdb and kdb interoperability</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="switchKdbKgdb.html#idp1114241012">Switching between kdb and kgdb</a></span></dt><dd><dl><dt><span class="sect2"><a href="switchKdbKgdb.html#idp1114241372">Switching from kgdb to kdb</a></span></dt><dt><span class="sect2"><a href="switchKdbKgdb.html#idp1114244412">Change from kdb to kgdb</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch06s02.html">Running kdb commands from gdb</a></span></dt></dl></div><p>It is possible to transition between kdb and kgdb dynamically. 2 The debug core will remember which you used the last time and 3 automatically start in the same mode.</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1114241012"></a>Switching between kdb and kgdb</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="switchKdbKgdb.html#idp1114241372">Switching from kgdb to kdb</a></span></dt><dt><span class="sect2"><a href="switchKdbKgdb.html#idp1114244412">Change from kdb to kgdb</a></span></dt></dl></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1114241372"></a>Switching from kgdb to kdb</h3></div></div></div><p> 4 There are two ways to switch from kgdb to kdb: you can use gdb to 5 issue a maintenance packet, or you can blindly type the command $3#33. 6 Whenever the kernel debugger stops in kgdb mode it will print the 7 message <code class="constant">KGDB or $3#33 for KDB</code>. It is important 8 to note that you have to type the sequence correctly in one pass. 9 You cannot type a backspace or delete because kgdb will interpret 10 that as part of the debug stream. 11 </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Change from kgdb to kdb by blindly typing:</p><p><code class="constant">$3#33</code></p></li><li class="listitem"><p>Change from kgdb to kdb with gdb</p><p><code class="constant">maintenance packet 3</code></p><p>NOTE: Now you must kill gdb. Typically you press control-z and 12 issue the command: kill -9 %</p></li></ol></div><p> 13 </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1114244412"></a>Change from kdb to kgdb</h3></div></div></div><p>There are two ways you can change from kdb to kgdb. You can 14 manually enter kgdb mode by issuing the kgdb command from the kdb 15 shell prompt, or you can connect gdb while the kdb shell prompt is 16 active. The kdb shell looks for the typical first commands that gdb 17 would issue with the gdb remote protocol and if it sees one of those 18 commands it automatically changes into kgdb mode.</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>From kdb issue the command:</p><p><code class="constant">kgdb</code></p><p>Now disconnect your terminal program and connect gdb in its place</p></li><li class="listitem"><p>At the kdb prompt, disconnect the terminal program and connect gdb in its place.</p></li></ol></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="EnableKGDB.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch06s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. Using kgdb / gdb </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Running kdb commands from gdb</td></tr></table></div></body></html> 19