cedric libre wrote:
> Hello,
>  I have a pb using kgdb on a 2.6.30 kernel over a serial line .
>
>  I have given this kernel command line to the test machine :
>   ro kgdb=/dev/ttyS0,115200 kgdboc=ttyS0,115200 
>
>  On the test machine, from the root directory of 2.6.30 sources I launch ddd 
> vmlinux.
> Then within ddd, I type: set remotebaud 115200,
>  set debug remote 1
>
> Then back to the test machine, within a terminal , I type as root :
>  echo g > /proc/sysrq-trigger that freezes the test machine .
>  
> Finally back in the development machine, within ddd I type :
>  target remote /dev/ttyS0  and here is what ddd displays :
>
>   

It certainly looks like it never connected or perhaps there was a
terminal program or something running there?  It is certainly the case
that only one high level program can use the serial port at a time.

> (gdb) target remote /dev/ttyS0
> Sending packet: $qSupported#37...Sending packet: $qSupported#37...Sending 
> packet: $qSupported#37...Sending packet: $qSupported#37...Timed out.
> Timed out.
> Timed out.
> Ignoring packet error, continuing...
>
>
> If I add 'kgdbwait' option in the test machine kernel command line options
> the kernel stops on the test machine, and I succeed to attach gdb from the 
> dev machine to the kernel test machine.
> Breaking on printk function works for the first times first or second 
> hundreds, but if I ask to ignore 500 printk's before the kernel stops, it 
> actually doesn't stop and stays stalled . 
> Do you have an idea of the way to fix that ?
>   

I am not exactly sure of the second problem you mention here.

Out of curiosity, I elected to try what I thought you were describing,
and it seemed to work just fine. 

## I am connecting to a proxy to a terminal server...
(gdb) tar re localhost:2222
Remote debugging using localhost:2222
kgdb_breakpoint () at kernel/kgdb.c:1866
1866            wmb(); /* Sync point after breakpoint */
(gdb) break printk
Breakpoint 1 at 0xc052f1e6: file kernel/printk.c, line 577.
(gdb) c
Continuing.
[New Thread 1]

Breakpoint 1, printk (fmt=0xc060a186 "<6>brd: module loaded\n")
    at kernel/printk.c:577
577     {
(gdb) c 10
Will ignore next 9 crossings of breakpoint 1.  Continuing.

Breakpoint 1, printk (fmt=0xc060bd80 "<6>e100: %s\n") at kernel/printk.c:577
577     {
(gdb) c 100
Will ignore next 99 crossings of breakpoint 1.  Continuing.
[New Thread 152]
[New Thread -2]
[New Thread 921]
[New Thread 923]
[Switching to Thread 923]

Breakpoint 1, printk (fmt=0xc060f7e1 "%s ") at kernel/printk.c:577
577     {
(gdb)

I'll admit that is an interesting way to zero in on a piece of code that
is emitting a printk.  :-)

Jason.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to