Please check this in.
-Amit
On Monday 28 Nov 2005 3:20 pm, Milind Dumbare wrote:
> Hi,
> Here is the patch with respect to current cvs tree.
>
> On Fri, 2005-11-25 at 11:32 +0530, Amit Kale wrote:
> > Hi,
> >
> > Following condition in arch/i386/kernel/kgdb.c causes kgdb to set
> > cpu_doing_single_step only when kgdb_contthread is non-null.
> > kgdb_contthread is non-null only when gdb asks for all other threads to
> > be stopped while doing a single step.
> >
> > debugger_step = 1;
> > if (kgdb_contthread)
> > atomic_set(&cpu_doing_single_step,
> > smp_processor_id());
> > }
> >
> > If another processor gets into kgdb before a master processor has a
> > chance to reenter after doing a single step. If we remove above if
> > condition, things work fine.
> >
> > I don't want to touch following condition in kernel/kgdb.c since, the
> > single step may expect other processor to continue (such as spinlocks).
> > If we prevent other processor from running completely, it might result in
> > a deadlock with gdb trying to continue single-step forever.
> >
> > if (!debugger_step || !kgdb_contthread) {
> > for (i = 0; i < NR_CPUS; i++)
> > spin_unlock(&slavecpulocks[i]);
> > By keeping this condition as it is, we let the other processor run during
> > a single step, but not let him become a master.
> >
> > See the log below for more info.
> > -Amit
> >
> >
> >
> > Sending packet: $Z0,c014ede0,1#69...Ack
> > Packet received: OK
> > Sending packet: $Z0,c0172d20,1#06...Ack
> > Packet received: OK
> > Sending packet: $s#73...Ack
> > Packet received: T05thread:0000000000000234;
> > Sending packet: $g#67...Ack
> > Packet received:
> > 0101000020145af768ef53f790221bc084ee53f720145af70000000000e053f7302d17c08
> >603000060000000680000007b0000007b0011c0ffff0000ffff0000 Sending packet:
> > $s#73...Ack
> > Packet received: T05thread:0000000000000001;
> > Sending packet: $g#67...Ack
> > Packet received:
> > 6098dcf7000000000400000004000000700f16c3a8f9ffbf000000007498dcf7e1ed14c04
> >602000060000000680000007b0000007b000000ffff0000ffff0000
> >
> > Program received signal SIGTRAP, Trace/breakpoint trap.
> > [Switching to Thread 1]
> > Sending packet: $z0,c014ede0,1#89...Ack
> > Packet received: OK
> > Sending packet: $z0,c0172d20,1#26...Ack
> > Packet received: OK
> > 0xc014ede1 in kfree (objp=0x0) at
> > /root/kgdb-dev/linux-2.6.9/mm/slab.c:2527 2527 {
> > (gdb) c
> > Continuing.
> > Sending packet: $Z0,c014ede0,1#69...Ack
> > Packet received: OK
> > Sending packet: $Z0,c0172d20,1#06...Ack
> > Packet received: OK
> > Sending packet: $c#63...Ack
> > Packet received: T05thread:0000000000000234;
> > Sending packet: $g#67...Ack
> > Packet received:
> > 0101000020145af768ef53f790221bc084ee53f720145af70000000000e053f7342d17c08
> >603000060000000680000007b0000007b0011c0ffff0000ffff0000 Sending packet:
> > $mf753eec8,4#37...Ack
> > Packet received: 2c3517c0
> > [Switching to Thread 564]
> > Sending packet: $z0,c014ede0,1#89...Ack
> > Packet received: OK
> > Sending packet: $z0,c0172d20,1#26...Ack
> > Packet received: OK
> > 665 name++;
> > (gdb) s
> > Sending packet: $Z0,c014ede0,1#69...Ack
> > Packet received: OK
> > Sending packet: $Z0,c0172d20,1#06...Ack
> > Packet received: OK
> > Sending packet: $s#73...Ack
> > Packet received: T0bthread:0000000000000001;
> > Sending packet: $g#67...Ack
> > Packet received:
> > 8598dcf7000000000400000004000000700f16c3a8f9ffbf000000007498dcf7e4ed14c08
> >202010060000000680000007b0000007b000000ffff0000ffff0000
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 1]
> > Sending packet: $z0,c014ede0,1#89...Ack
> > Packet received: OK
> > Sending packet: $z0,c0172d20,1#26...Ack
> > Packet received: OK
> > 0xc014ede4 in kfree (objp=0x0) at
> > /root/kgdb-dev/linux-2.6.9/mm/slab.c:2531 2531 if (!objp)
> > (gdb)
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > files for problems? Stop! Download the new AJAX search engine that
> > makes searching your log files as easy as surfing the web. DOWNLOAD
> > SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > _______________________________________________
> > Kgdb-bugreport mailing list
> > Kgdb-bugreport@...
> > https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport
|