On Fri, 2006-12-29 at 13:02 -0500, [EMAIL PROTECTED] wrote: > Hi, there, > > I have applied the 2.6.13 kgdb patch into my 2.6.12 kernel in Intel X86_64 > Xeon > motherboard. kgdb can start well and accept gdb commands and reply. For > example, it can stop at kgdb.c after gdb is connected, allow me issue "info > regi", "info thr", "next", "step", "continue", and ctrl-C to stop the running > kernel etc. > > All seem good except the major step: I cannot switch thread. After seeing all > threads, I issue "thr 20" to switch to another thread. The command returns OK, > and the registers seem to have been changed correctly. But when I issue "next" > or "bt", I found it is still in the old thread. What am I missing?
I'm using the ddd gui interface to kgdb and switching threads works fine. I think/thought ddd just uses the thread command to switch to another thread. I'm also developing on a 2.6.12 kernel but I don't think I used the 2.6.13 patch. I'm also developing on the 2.6.13 kernel. As I recall I applied the 2.6.13 patch to the 2.6.13 kernel and the thread switching is also working fine. I wonder if your problem involves your using the 2.6.13 patch with a 2.6.12 kernel. At UNM I used George's kgdb patch on a 2.4 kernel and recall having a problem with the thread switching do to task list changing. As I recall it also worked with ddd and thread switching. On SunOS 4.1.4 I use to context switch between processes by changing $sp and $pc. I had to exit gdb and restart each time because of the caching being done by gdb for memory accesses. In no implementation that I'm aware of has it ever been possible to single step in a different thread than the one that entered kgdb. That would require much more cooperation between the kernel. I doubt that's worth while while the patch isn't a standard kernel component. I agree that it would be nice. With ddd I'd just switch to the thread your interested in, place a break point just after the current pc and hit continue; it's very easy. -piet > > Here is the register infor befor issuing thread switch command. > > (gdb) info regi > rax 0xffffffff 4294967295 > rbx 0xffffffff8047f860 -2142767008 > rcx 0x20 32 > rdx 0x0 0 > rsi 0xffffffff80689280 -2140630400 > rdi 0x0 0 > rbp 0xffffffff80636f50 0xffffffff80636f50 > rsp 0xffffffff80525038 0xffffffff80525038 > r8 0x0 0 > r9 0x0 0 > r10 0xffff810128021980 -139633010534016 > r11 0xe4 228 > r12 0xa 10 > r13 0x2aaaaacdd360 46912498422624 > r14 0x0 0 > r15 0x2aaaaacdd360 46912498422624 > rip 0xffffffff80155d4b 0xffffffff80155d4b <breakpoint+123> > eflags 0x246 582 > cs 0x0 0 > ss 0x0 0 > ds 0x0 0 > es 0x0 0 > fs 0x0 0 > ---Type <return> to continue, or q <return> to quit--- > gs 0x0 0 > (gdb) > > Here is the thread I want to switch to: > > 19 thread 8365 (tom_ext3_1) 0xffffffff803803d0 in thread_return () > at kernel/sched.c:1481 > Sending packet: $qThreadExtraInfo,20ab#aa...Ack > Packet received: 64645f7070617274006c6f636b000000 > Sending packet: $Hg20ab#d4...Ack > Packet received: OK > Sending packet: $g#67...Ack > Packet received: > 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c89d85270181ffff489d85270181ffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0033880ffffffff4600000000000000 > > Here is the register info after I issued thread > > (gdb) info regi > rax 0x0 0 > rbx 0x0 0 > rcx 0x0 0 > rdx 0x0 0 > rsi 0x0 0 > rdi 0x0 0 > rbp 0xffff810127923dc8 0xffff810127923dc8 > rsp 0xffff810127923d48 0xffff810127923d48 > r8 0x0 0 > r9 0x0 0 > r10 0x0 0 > r11 0x0 0 > r12 0x0 0 > r13 0x0 0 > r14 0x0 0 > r15 0x0 0 > rip 0xffffffff803803d0 0xffffffff803803d0 <thread_return> > eflags 0x46 70 > cs 0x0 0 > ss 0x0 0 > ds 0x0 0 > es 0x0 0 > fs 0x0 0 > ---Type <return> to continue, or q <return> to quit--- > gs 0x0 0 > (gdb) > > > Here is the gdb packet exchange information when I issue "next" command after > thread switching: > > (gdb) n > Sending packet: $Hg34b5#ad...Ack > Packet received: OK > Sending packet: $g#67...Ack > Packet received: > ffffffff0000000060f84780ffffffff2000000000000000000000000000000080926880ffffffff0000000000000000506f6380ffffffff38505280ffffffff00000000000000000000000000000000801902280181ffffe4000000000000000a0000000000000060d3cdaaaa2a0000000000000000000060d3cdaaaa2a00004b5d1580ffffffff4602000000000000 > Sending packet: $Hg20ad#d6...Ack > Packet received: OK > Sending packet: $g#67...Ack > Packet received: > 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c83d92270181ffff483d92270181ffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0033880ffffffff4600000000000000 > Sending packet: $Hg34b5#ad...Ack > Packet received: OK > Sending packet: $g#67...Ack > Packet received: > ffffffff0000000060f84780ffffffff2000000000000000000000000000000080926880ffffffff0000000000000000506f6380ffffffff38505280ffffffff00000000000000000000000000000000801902280181ffffe4000000000000000a0000000000000060d3cdaaaa2a0000000000000000000060d3cdaaaa2a00004b5d1580ffffffff4602000000000000 > Sending packet: $vCont?#49...Ack > Packet received: > Packet vCont (verbose-resume) is NOT supported > Sending packet: $Hc0#db...Ack > Packet received: OK > Sending packet: $s#73...Ack > Packet received: T05thread:00000000000034b5; > Sending packet: $g#67...Ack > Packet received: > ffffffff0000000060f84780ffffffff2000000000000000000000000000000080926880ffffffff44fd3a80ffffffff506f6380ffffffff38505280ffffffff00000000000000000000000000000000801902280181ffffe4000000000000000a0000000000000060d3cdaaaa2a0000000000000000000060d3cdaaaa2a0000525d1580ffffffff4603000000000000 > Sending packet: $mffffffff80525040,8#99...Ack > Packet received: 795d1580ffffffff > Sending packet: $s#73...Ack > Packet received: T05thread:00000000000034b5; > Sending packet: $g#67...Ack > Packet received: > 000000000000000060f84780ffffffff2000000000000000000000000000000080926880ffffffff44fd3a80ffffffff506f6380ffffffff38505280ffffffff00000000000000000000000000000000801902280181ffffe4000000000000000a0000000000000060d3cdaaaa2a0000000000000000000060d3cdaaaa2a0000545d1580ffffffff4603000000000000 > Sending packet: $s#73...Ack > Packet received: T05thread:00000000000034b5; > Sending packet: $g#67...Ack > Packet received: > 000000000000000060f84780ffffffff2000000000000000000000000000000080926880ffffffff44fd3a80ffffffff506f6380ffffffff30505280ffffffff00000000000000000000000000000000801902280181ffffe4000000000000000a0000000000000060d3cdaaaa2a0000000000000000000060d3cdaaaa2a0000602d1380ffffffff4603000000000000 > Sending packet: $mffffffff80525030,8#98...Ack > Packet received: 595d1580ffffffff > Sending packet: $Z0,ffffffff80155d59,1#18...Ack > Packet received: OK > Packet Z0 (software-breakpoint) is supported > Sending packet: $c#63...Ack > Packet received: T05thread:00000000000034b5; > Sending packet: $g#67...Ack > Packet received: > 05000000000000000400000000000000406e5f80ffffffff0000000000000000c7b300000000000040c14780ffffffff506f6380ffffffff38505280ffffffff00000000000000000000000000000000000000000000000000000000000000000a0000000000000060d3cdaaaa2a0000000000000000000060d3cdaaaa2a00005a5d1580ffffffff9602000000000000 > Sending packet: $P10=595d1580ffffffff#f3...Ack > Packet received: > Sending packet: > $G05000000000000000400000000000000406e5f80ffffffff0000000000000000c7b300000000000040c14780ffffffff506f6380ffffffff38505280ffffffff00000000000000000000000000000000000000000000000000000000000000000a0000000000000060d3cdaaaa2a0000000000000000000060d3cdaaaa2a0000595d1580ffffffff9602000000000000#3a...Ack > Packet received: OK > Sending packet: $z0,ffffffff80155d59,1#38...Ack > Packet received: OK > Sending packet: $mffffffff80525040,8#99...Ack > Packet received: 795d1580ffffffff > breakpoint () at kernel/kgdb.c:1823 > 1823 ; > > The issue is it is still in kgdb.c, not switch to my tom_ext3_1 thread. > > Thanks! > > Jinggang > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Kgdb-bugreport mailing list > Kgdb-bugreport@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport -- Piet Delaney Phone: (408) 200-5256 Blue Lane Technologies Fax: (408) 200-5299 10450 Bubb Rd. Cupertino, Ca. 95014 Email: [EMAIL PROTECTED]
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Kgdb-bugreport mailing list Kgdb-bugreport@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport