Re: KGDBOC testing on linux-2.6.30-rc4

2009-05-04 Thread Bruce Ashfield
On Mon, May 4, 2009 at 9:13 AM, srikanth krishnakar
 wrote:
>
>
> Hi all,
>
> I need help in kgdboc  testing on PowerPC target.

Have you tried contacting the maintainer ? (I noticed that Jason
wasn't cc'd), just in case it isn't simply a use case problem and
might be related to KGDB internals.

KGDB
P:  Jason Wessel
M:  jason.wes...@windriver.com

I've tested KGDBOC up to the 2.6.29 kernel and it worked fine
on a series of 85xx boards. I haven't had a chance on 2.6.30-rcX
yet, so something may have changed.

>
> Linux Kernel: 2.6.30-rc4
> KGDB method : KGDBOC
> Arch: PowerPC
>
> Note: Attached is the kernel config  used.
>
> Has anyone tested KGDBOC for Serial 8250, and the serial port has dependency
> on OF_PLATFORM driver ?
>
> Here are the kernel config options:
>
> Device Drivers  --->
>    Character devices  --->
>                           Serial drivers  --->
>                                                      <*> 8250/16550 and
> compatible serial support
>                                                      [*]   Console on
> 8250/16550 and compatible serial port
>                                          (4) Number of
> 8250/16550 serial ports to register at runtime
>                              [ ] Extended 8250/16550
> serial driver options
>                          *** Non-8250 serial
> port support ***
>                              <*> Xilinx uartlite
> serial port support
>                              [*]   Support for
> console on Xilinx uartlite serial port
>  < > Digi International
> NEO PCI Support
>                                          <*> Serial port on Open
> Firmware platform bus
>                  < > NWP serial port
> driver
>
> Kernel hacking  --->
>    -*- Magic SysRq key
>                     [*] Kernel debugging
>     [*] KGDB: kernel debugging with remote gdb  --->
>     --- KGDB: kernel debugging with remote
> gdb
>        <*> KGDB: use kgdb over the serial console
>
>
> --
> In the process :
>
>     On the target side :
>
>  ...
>  Serial: 8250/16550 driver, 4 ports, IRQ sharing
> disabled
>  83e0.serial: ttyS0 at MMIO 0x83e01003 (irq
> = 16) is a
> 16550A
>  console [ttyS0]
> enabled
>  kgdb: Registered I/O driver kgdboc.
>  .
>
>     r...@10.161.2.35:~# echo g > /proc/sysrq-trigger
>     SysRq : GDB
>     Entering KGDB
>
>
>   On host side :
>
>    [r...@srikant linux-2.6]# powerpc-linux-gnu-gdb
> vmlinux-puru
>    GNU gdb G++ 4.3-150) 6.8.50.20081022-cvs
>    Copyright (C) 2008 Free Software Foundation, Inc.
>    License GPLv3+: GNU GPL version 3 or later
> 
>    This is free software: you are free to change and
> redistribute it.
>    There is NO WARRANTY, to the extent permitted by
> law.  Type "show copying"
>    and "show warranty" for details.
>    This GDB was configured as
> "--host=i686-pc-linux-gnu --target=powerpc-linux-gnu".
>    For bug reporting instructions, please see:
>   (gdb) set remotebaud 9600
>   (gdb) target remote /dev/ttyS0
>    Remote debugging using /dev/ttyS0
>   Ignoring packet error, continuing...
>   warning: unrecognized item "timeout" in
> "qSupported" response
>   Ignoring packet error, continuing...
>   Ignoring packet error, continuing...
>   Ignoring packet error, continuing...
>   Ignoring packet error, continuing...
>   Ignoring packet error, continuing...
>   Malformed response to offset query, timeout

I'm wondering if there is a GDB protocol mismatch and your
version of GDB is sending packets that KGDB can't handle.
I'm no where near an expert on GDB's protocol and won't know
if I'm seeing the same thing until I try 2.6.30-rc

Bruce

>
> Can anybody comment on the steps followed in the process of testing or
> something is missing with respect to of_serial.c for powerpc architecture.
> Seems the target has never responded for gdb requests !!!
>
>
> Regards
> Srikanth
>
>
>
>
> ___

Re: KGDBOC testing on linux-2.6.30-rc4

2009-05-05 Thread srikanth krishnakar
Hi all,

Target : PowerPC, Virtex-440 Generic
Serial port : Xilinx 16550 Uart ( depends on OF_PLATFORM)

Further investigation of KGDBOC on PowerPC shows that kgdboc hangs at :

In file : arch/powerpc/include/asm/kgdb.h

*static inline void* arch_kgdb_breakpoint(*void*)
{
*asm*(*".long 0x7d821008"*); /* *twge r2, r2 **/ * << 
KGDBOC Hangs here* * << ---*


-
Debug Log:

r...@10.1.2.55:~# echo g >
/proc/sysrq-trigger
SysRq :
GDB

1>sysrq_handle_gdb

Entering KGDB
1-1--->kgdb_breakpoint
1-2--->kgdb_breakpoint
1-3--->kgdb_breakpoint
1-1--->arch_kgdb_breakpoint

-


Any comments or suggestions 

-Srikanth
--

On Mon, May 4, 2009 at 8:12 PM, Bruce Ashfield wrote:

> On Mon, May 4, 2009 at 9:13 AM, srikanth krishnakar
>  wrote:
> >
> >
> > Hi all,
> >
> > I need help in kgdboc  testing on PowerPC target.
>
> Have you tried contacting the maintainer ? (I noticed that Jason
> wasn't cc'd), just in case it isn't simply a use case problem and
> might be related to KGDB internals.
>
> KGDB
> P:  Jason Wessel
> M:  jason.wes...@windriver.com
>
> I've tested KGDBOC up to the 2.6.29 kernel and it worked fine
> on a series of 85xx boards. I haven't had a chance on 2.6.30-rcX
> yet, so something may have changed.
>
> >
> > Linux Kernel: 2.6.30-rc4
> > KGDB method : KGDBOC
> > Arch: PowerPC
> >
> > Note: Attached is the kernel config  used.
> >
> > Has anyone tested KGDBOC for Serial 8250, and the serial port has
> dependency
> > on OF_PLATFORM driver ?
> >
> > Here are the kernel config options:
> >
> > Device Drivers  --->
> >Character devices  --->
> >   Serial drivers  --->
> >  <*> 8250/16550 and
> > compatible serial support
> >  [*]   Console on
> > 8250/16550 and compatible serial port
> >  (4) Number of
> > 8250/16550 serial ports to register at runtime
> >  [ ] Extended
> 8250/16550
> > serial driver options
> >  *** Non-8250 serial
> > port support ***
> >  <*> Xilinx uartlite
> > serial port support
> >  [*]   Support for
> > console on Xilinx uartlite serial port
> >  < > Digi
> International
> > NEO PCI Support
> >  <*> Serial port on
> Open
> > Firmware platform bus
> >  < > NWP serial port
> > driver
> >
> > Kernel hacking  --->
> >-*- Magic SysRq key
> > [*] Kernel debugging
> > [*] KGDB: kernel debugging with remote gdb
> --->
> > --- KGDB: kernel debugging with remote
> > gdb
> ><*> KGDB: use kgdb over the serial console
> >
> >
> > --
> > In the process :
> >
> > On the target side :
> >
> >  ...
> >  Serial: 8250/16550 driver, 4 ports, IRQ
> sharing
> > disabled
> >  83e0.serial: ttyS0 at MMIO 0x83e01003
> (irq
> > = 16) is a
> > 16550A
> >  console [ttyS0]
> > enabled
> >  kgdb: Registered I/O driver kgdboc.
> >  .
> >
> > r...@10.161.2.35:~# echo g >
> /proc/sysrq-trigger
> > SysRq : GDB
> > Entering KGDB
> >
> >
> >   On host side :
> >
> >[r...@srikant linux-2.6]#
> powerpc-linux-gnu-gdb
> > vmlinux-puru
> >GNU gdb G++ 4.3-150) 6.8.50.20081022-cvs
> >Copyright (C) 2008 Free Software Foundation,
> Inc.
> >License GPLv3+: GNU GPL version 3 or later
> > 
> >This is free software: you are free to change
> and
> > redistribute it.
> >There is NO WARRANTY, to the extent permitted
> by
> > law.  Type "show copying"
> >and "show warranty" for details.
> >This GDB was configured as
> > "--host=i686-pc-linux-gnu --target=powerpc-linux-gnu".
> >For bug reporting instructions, please see:
> >   (gdb) set remotebaud 9600
> >   (gdb) target remote /dev/ttyS0
> >   

Re: [Kgdb-bugreport] KGDBOC testing on linux-2.6.30-rc4

2009-05-05 Thread srikanth krishnakar
On Tue, May 5, 2009 at 5:28 PM, Jason Wessel wrote:

> srikanth krishnakar wrote:
> > Hi all,
> >
> > Target : PowerPC, Virtex-440 Generic
> > Serial port : Xilinx 16550 Uart ( depends on OF_PLATFORM)
> >
> > Further investigation of KGDBOC on PowerPC shows that kgdboc hangs at :
> >
> > In file : arch/powerpc/include/asm/kgdb.h
> >
> > *static inline void* arch_kgdb_breakpoint(*void*)
> > {
> > *asm*(*".long 0x7d821008"*); /* *twge r2, r2 **/ * << 
> > KGDBOC Hangs here* * << ---*
> >
> >
> > -
> > Debug Log:
> >
> > r...@10.1.2.55:~# echo g >
> > /proc/sysrq-trigger
> > SysRq :
> > GDB
> >
> > 1>sysrq_handle_gdb
> >
> > Entering KGDB
> > 1-1--->kgdb_breakpoint
> > 1-2--->kgdb_breakpoint
> > 1-3--->kgdb_breakpoint
> > 1-1--->arch_kgdb_breakpoint
> >
> > -
> >
> >
> > Any comments or suggestions 
> >
>
> I had used the 2.6.30-rc3 kernel with the PowerPC 604 system I have and
> it was working fine, but the 4xx archs are a bit different.
>
> What happens next after you execute the inline assembly is that an
> exception occurs, and that is the point that the kgdb entry will
> actually execute.  IE:
>
> arch/powerpc/kernel/traps.c
>
> program_check_exception()
>
> From there kgdb should be entered and the I/O driver gets activated.
> You could put another printk in kgdb_handle_exception() in kernel/kgdb.c
> to make sure it actually gets there.
>
> Generally when the system hangs hard on an initial entry to kgdb it
> means there is a problem with the I/O polling driver or there is
> something else eating the kgdb exception and the kgdb exception handler
> was never fired in the first place.
>
> Jason.
>

Hi Jason,

Re attempted with inserting a printk in kernel/kgdb.c
kgdb_handle_exception() function but seems the kgdb exception has never
occurred !!

--
Debug Log:

r...@10.1.2.55:~# echo g > /proc/sysrq-trigger
SysRq : GDB
1>sysrq_handle_gdb
Entering KGDB
1-1--->kgdb_breakpoint
1-2--->kgdb_breakpoint
1-3--->kgdb_breakpoint
1-1--->arch_kgdb_breakpoint


(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...

---

Inserted printk's in kernel kgdb.c  :
int
kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs
*regs)
{

printk("1>%s\n",__FUNCTION__);
if (kgdb_reenter_check(ks)) {
-

*Does the PowerPC uses PowerPC64 hooks ??*

as seen below from arch/powerpc/kernel/kgdb.c

/* KGDB functions to use existing PowerPC64 hooks. */
static int kgdb_debugger(struct pt_regs *regs)
{
printk("1>%s\n",__FUNCTION__);
return *kgdb_handle_exception*(0, computeSignal(TRAP(regs)), 0,
regs);

---


Thanks For your co-operation, patience and help.


Regards
Srikanth
**
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev