<br><br><div class="gmail_quote">On Tue, May 5, 2009 at 5:28 PM, Jason Wessel <span dir="ltr">&lt;<a href="mailto:jason.wessel@windriver.com">jason.wessel@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">srikanth krishnakar wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; Target : PowerPC, Virtex-440 Generic<br>
&gt; Serial port : Xilinx 16550 Uart ( depends on OF_PLATFORM)<br>
&gt;<br>
&gt; Further investigation of KGDBOC on PowerPC shows that kgdboc hangs at :<br>
&gt;<br>
&gt; In file : arch/powerpc/include/asm/kgdb.h<br>
&gt;<br>
&gt; *static inline void* arch_kgdb_breakpoint(*void*)<br>
&gt; {<br>
&gt;         *asm*(*&quot;.long 0x7d821008&quot;*); /* *twge r2, r2 **/     * &lt;&lt; ----<br>
&gt; KGDBOC Hangs here* * &lt;&lt; ---*<br>
&gt;<br>
&gt;<br>
&gt; -----------------------------------------<br>
&gt; Debug Log:<br>
&gt;<br>
&gt; root@10.1.2.55:~# echo g &gt;<br>
&gt; /proc/sysrq-trigger<br>
&gt; SysRq :<br>
&gt; GDB<br>
&gt;<br>
&gt; 1------------------------&gt;sysrq_handle_gdb<br>
&gt;<br>
&gt; Entering KGDB<br>
&gt; 1-1-----------------------&gt;kgdb_breakpoint<br>
&gt; 1-2-----------------------&gt;kgdb_breakpoint<br>
&gt; 1-3-----------------------&gt;kgdb_breakpoint<br>
&gt; 1-1-----------------------&gt;arch_kgdb_breakpoint<br>
&gt;<br>
&gt; ---------------------------------------------<br>
&gt;<br>
&gt;<br>
&gt; Any comments or suggestions ????<br>
&gt;<br>
<br>
</div>I had used the 2.6.30-rc3 kernel with the PowerPC 604 system I have and<br>
it was working fine, but the 4xx archs are a bit different.<br>
<br>
What happens next after you execute the inline assembly is that an<br>
exception occurs, and that is the point that the kgdb entry will<br>
actually execute.  IE:<br>
<br>
arch/powerpc/kernel/traps.c<br>
<br>
program_check_exception()<br>
<br>
>From there kgdb should be entered and the I/O driver gets activated.<br>
You could put another printk in kgdb_handle_exception() in kernel/kgdb.c<br>
to make sure it actually gets there.<br>
<br>
Generally when the system hangs hard on an initial entry to kgdb it<br>
means there is a problem with the I/O polling driver or there is<br>
something else eating the kgdb exception and the kgdb exception handler<br>
was never fired in the first place.<br>
<font color="#888888"><br>
Jason.<br>
</font></blockquote></div><br>Hi Jason,<br><br>Re attempted with inserting a printk in kernel/kgdb.c kgdb_handle_exception() function but seems the kgdb exception has never occurred !!<br><br>------------------<br><span style="background-color: rgb(204, 204, 204);">Debug Log:</span><br>
<br><font size="1">root@10.1.2.55:~# echo g &gt; /proc/sysrq-trigger<br>SysRq : GDB<br>1------------------------&gt;sysrq_handle_gdb<br>Entering KGDB<br>1-1-----------------------&gt;kgdb_breakpoint<br>1-2-----------------------&gt;kgdb_breakpoint<br>
1-3-----------------------&gt;kgdb_breakpoint<br>1-1-----------------------&gt;arch_kgdb_breakpoint<br><br><br>(gdb) target remote /dev/ttyS0<br>Remote debugging using /dev/ttyS0<br>Ignoring packet error, continuing...<br>
warning: unrecognized item &quot;timeout&quot; in &quot;qSupported&quot; response<br>Ignoring packet error, continuing...<br>Ignoring packet error, continuing...</font><br><br>-------------------<br><br><span style="background-color: rgb(204, 204, 204);">Inserted printk&#39;s in kernel kgdb.c  :</span><br>
<font size="1">int<br><span style="color: rgb(153, 0, 0);">kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs)</span><br style="color: rgb(153, 0, 0);"><span style="color: rgb(153, 0, 0);">{</span><br style="color: rgb(153, 0, 0);">
<br style="color: rgb(153, 0, 0);"><span style="color: rgb(153, 0, 0);">printk(&quot;1------------------------&gt;%s\n&quot;,__FUNCTION__);</span><br style="color: rgb(153, 0, 0);"><span style="color: rgb(153, 0, 0);">        if (kgdb_reenter_check(ks)) {</span></font><br>
-----------------------------<br><br><b><span style="color: rgb(255, 0, 0);">Does the PowerPC uses PowerPC64 hooks ??</span></b><br style="color: rgb(255, 0, 0);"><br>as seen below from arch/powerpc/kernel/kgdb.c<br><br><span style="color: rgb(153, 0, 0);">/* KGDB functions to use existing PowerPC64 hooks. */</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">static int kgdb_debugger(struct pt_regs *regs)</span><br style="color: rgb(153, 0, 0);"><span style="color: rgb(153, 0, 0);">{</span><br style="color: rgb(153, 0, 0);"><span style="color: rgb(153, 0, 0);">        printk(&quot;1------------------------&gt;%s\n&quot;,__FUNCTION__);</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">        return <b><span style="color: rgb(0, 0, 0);">kgdb_handle_exception</span></b>(0, computeSignal(TRAP(regs)), 0, regs);</span><br><br>-------------------------------<br><br><br>Thanks For your co-operation, patience and help.<br>
<br><br>Regards<br>Srikanth <br>**********<br>