2011/6/15 Hui Zhu <teawater@xxxxxxxxx>: > 多谢DONGDONG的介绍. > > Li Yu 我会看一下是否能在GDB中修复一小下的可能 如果不会产生什么负面的影响 我会作一个小PATCH 当然加入MAIN > trunk的可能性是很小的 不过加入我维护的PPA应该是没问题的 > > 所以选择我维护的PPA是没错的 一切以用户方便为前提 不带这样夸自己的哈, 嘿嘿。。 > > Thanks, > Hui > > 2011/6/15 Li Yu <raise.sail@xxxxxxxxx>: >> >> 杯具,RHEL6u1内核里没有这个补丁。 >> >> 非常感谢,Dongdong,我拜读过你的KGDB文章~ >> >> Yu >> >> 于 2011年06月15日 15:18, Dongdong Deng 写道: >>> 印象中是在2.6.38以后的版本中是没这个问题,其中有些稳定版内核(2.6.32/35)也打上了那个patch. >>> >>> LiYu 可以检查下你的内核是否有这个patch. >>> >>> >>> Dongdong >>> >>> >>> >>> 我给个2.6.27内核的patch: >>> >>> 2.6.27.59-stable review patch. If anyone has any objections, please >>> let us know. >>> >>> ------------------ >>> >>> From: Jason Wessel <jason.wessel@xxxxxxxxxxxxx> >>> >>> commit fb82c0ff27b2c40c6f7a3d1a94cafb154591fa80 upstream. >>> >>> The gdbserial protocol handler should return an empty packet instead >>> of an error string when ever it responds to a command it does not >>> implement. >>> >>> The problem cases come from a debugger client sending >>> qTBuffer, qTStatus, qSearch, qSupported. >>> >>> The incorrect response from the gdbstub leads the debugger clients to >>> not function correctly. Recent versions of gdb will not detach >>> correctly as a result of this behavior. >>> >>> Backport-request-by: Frank Pan <frankpzh@xxxxxxxxx> >>> Signed-off-by: Jason Wessel <jason.wessel@xxxxxxxxxxxxx> >>> Signed-off-by: Dongdong Deng <dongdong.deng@xxxxxxxxxxxxx> >>> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx> >>> >>> >>> --- >>> kernel/kgdb.c | 9 +++------ >>> 1 file changed, 3 insertions(+), 6 deletions(-) >>> >>> --- a/kernel/kgdb.c >>> +++ b/kernel/kgdb.c >>> @@ -1001,10 +1001,8 @@ static void gdb_cmd_query(struct kgdb_st >>> switch (remcom_in_buffer[1]) { >>> case 's': >>> case 'f': >>> - if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) { >>> - error_packet(remcom_out_buffer, -EINVAL); >>> + if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) >>> break; >>> - } >>> >>> i = 0; >>> remcom_out_buffer[0] = 'm'; >>> @@ -1045,10 +1043,9 @@ static void gdb_cmd_query(struct kgdb_st >>> pack_threadid(remcom_out_buffer + 2, thref); >>> break; >>> case 'T': >>> - if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) { >>> - error_packet(remcom_out_buffer, -EINVAL); >>> + if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) >>> break; >>> - } >>> + >>> ks->threadid = 0; >>> ptr = remcom_in_buffer + 17; >>> kgdb_hex2long(&ptr, &ks->threadid); >>> >>> >>> >>> 2011/6/15 Li Yu <raise.sail@xxxxxxxxx>: >>>> >>>> 呵呵,谢谢~ >>>> >>>> 2.6.32-131.2.1.x86_64 >>>> >>>> Yu >>>> >>>> 于 2011年06月15日 14:10, Hui Zhu 写道: >>>>> 貌似是个互相不兼容造成的诡异BUG KGDB在遇到自己不支持的包的时候 没有按照标准回空啊 >>>>> >>>>> 能不能告诉一下我 "uname -r" 后的版本号 >>>>> >>>>> Dongdong, 能帮我看下kgdb是否现在还有这个问题么? >>>>> >>>>> 不过不管是哪边的问题,回头我会专门为这个问题发的PATCH并且集成到PPA里。多谢汇报。 >>>>> >>>>> Hui >>>>> >>>>> 2011/6/15 Li Yu <raise.sail@xxxxxxxxx>: >>>>>> $ sudo gdb-7.3 vmlinux >>>>>> GNU gdb (GDB) 7.2.90.20110607-cvs-ubuntu >>>>>> Copyright (C) 2011 Free Software Foundation, Inc. >>>>>> License GPLv3+: GNU GPL version 3 or later >>>>>> <http://gnu.org/licenses/gpl.html> >>>>>> 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 "x86_64-linux-gnu". >>>>>> For bug reporting instructions, please see: >>>>>> <http://www.gnu.org/software/gdb/bugs/>... >>>>>> Reading symbols from >>>>>> /tmp/1/home/sailor/src/linux-2.6.32-131.2.1.el6.x86_64.orig/vmlinux...done. >>>>>> (gdb) set remotebaud 115200 >>>>>> (gdb) set debug remote 1 >>>>>> (gdb) target remote /dev/ttyUSB0 >>>>>> Remote debugging using /dev/ttyUSB0 >>>>>> Sending packet: $qSupported:xmlRegisters=i386;qRelocInsn+#25...Ack >>>>>> Packet received: >>>>>> Packet qSupported (supported-packets) is NOT supported >>>>>> Sending packet: $Hg0#df...Ack >>>>>> Packet received: OK >>>>>> Sending packet: $?#3f...Ack >>>>>> Packet received: S05 >>>>>> Sending packet: $Hc-1#09...Ack >>>>>> Packet received: OK >>>>>> Sending packet: $qC#b4...Ack >>>>>> Packet received: QC0000000000002309 >>>>>> Sending packet: $qAttached#8f...Ack >>>>>> Packet received: >>>>>> Packet qAttached (query-attached) is NOT supported >>>>>> Sending packet: $qOffsets#4b...Ack >>>>>> Packet received: >>>>>> Sending packet: $g#67...Ack >>>>>> Packet received: >>>>>> 2300000000000000e08e7381ffffffff0353000000000000000000000000000046000000000000004600000000000000585e9c6b0088ffff585e9c6b0088ffff0000000000000000c0e98881ffffffff000000000000000001000000000000000000000000000000670000000000000000000000000000000600000000000000f7cc0c81ffffffff960000001000000018000000 >>>>>> Sending packet: $mffffffff810cccf7,1#59...Ack >>>>>> Packet received: 0f >>>>>> Sending packet: $mffffffff810cccf7,1#59...Ack >>>>>> Packet received: 0f >>>>>> kgdb_breakpoint () at kernel/kgdb.c:1721 >>>>>> 1721 wmb(); /* Sync point after breakpoint */ >>>>>> Sending packet: $qSymbol::#5b...Ack >>>>>> Packet received: >>>>>> Packet qSymbol (symbol-lookup) is NOT supported >>>>>> Sending packet: $qTStatus#49...Ack >>>>>> Packet received: E22 >>>>>> trace API error 0x2. >>>>>> (gdb) bt >>>>>> No stack. >>>>>> (gdb) >>>>>> >>>>>> 内核是RHEL6u1的内核(可以从redhat的FTP下载到源码包),在RHEL5u4上编译的,加了一些补丁,但这些补丁没有改内核的核心部分,多是一些驱动的,都与kgdb无关。 >>>>>> >>>>>> Yu >>>>>> >>>>>> 于 2011年06月15日 13:20, Hui Zhu 写道: >>>>>>> 能贴出点详细信息么 >>>>>>> >>>>>>> 比如你用什么kernel >>>>>>> >>>>>>> 在连以前 先用一下 set debug remote 1 >>>>>>> >>>>>>> 然后再连一下 把输出的信息贴一下 多谢 >>>>>>> >>>>>>> 2011/6/15 Li Yu <raise.sail@xxxxxxxxx>: >>>>>>>> >>>>>>>> 应该是没有的,它只是一个gdbserver in kernel吧,我看代码里也没有什么处理tracepoint的地方。 >>>>>>>> 我用target remote /dev/ttyUSB0,之后就出了这么个提示,这时gdb并没有attach上remote target。 >>>>>>>> >>>>>>>> 但ubuntu 10.04自己带的gdb是OK的。 >>>>>>>> >>>>>>>> Yu >>>>>>>> >>>>>>>> 于 2011年06月15日 11:44, Hui Zhu 写道: >>>>>>>>> KGDB有trace功能? >>>>>>>>> >>>>>>>>> 2011/6/15 Li Yu <raise.sail@xxxxxxxxx>: >>>>>>>>>> >>>>>>>>>> 试了试用gdb-7.3/ubuntu-10.04,对RHEL6u1的内核做KGDB,不工作。。。。。。 >>>>>>>>>> >>>>>>>>>> 提示:trace API error 0x2. >>>>>>>>>> >>>>>>>>>> Yu >>>>>>>>>> >>>>>>>>>> 于 2011年06月05日 07:04, Hui Zhu 写道: >>>>>>>>>>> 我倒是不介意同样也弄个fc的 不过不知道FC有没有类似ubuntu ppa这种东西 >>>>>>>>>>> >>>>>>>>>>> 2011/6/4 PcX <xunxun1982@xxxxxxxxx>: >>>>>>>>>>>> 于 2011/6/4 22:35, Hui Zhu 写道: >>>>>>>>>>>> >>>>>>>>>>>> GDB和UBUNTU用户们你们好, >>>>>>>>>>>> >>>>>>>>>>>> 也许你还在用7.2或者更老版本的GDB,这里面BUG成堆压根没人管了,或者很好用的GDB新功能你也用不上. >>>>>>>>>>>> 或者你要同时在好几个体系结构上工作例如ARM和MIPS,而你要针对每个体系结构编译一个GDB. >>>>>>>>>>>> >>>>>>>>>>>> 我开始在launchpad PPA上发布UBUNTU 10.04, 10.10, 11.04, >>>>>>>>>>>> 11.10(8.04还有点问题)可用的最新版本的GDB(7.3 和 7.3.5). >>>>>>>>>>>> 这些GDB的特点是: >>>>>>>>>>>> 1. GDB maintainer天天更新他们,他们有最新的功能和更快的BUG修复速度. >>>>>>>>>>>> 2. 他们都用"--enable-targets=all >>>>>>>>>>>> --enable-64-bit-bfd"选项编译,所以他们支持GDB支持的所有体系结构,你可以本地调试也可以随时用他们调试远程的其他体系结构的程序. >>>>>>>>>>>> 3. 包名是"gdb-7.3" 和 "gdb-trunk"而 GDB程序的名称是"gdb-7.3"和 "gdb-7.3.5". >>>>>>>>>>>> 所以其不会影响你原来安装的GDB, 如果你在使用新版GDB的时候出现问题,随时可以换回老版本的GDB. >>>>>>>>>>>> >>>>>>>>>>>> 取得他们请访问下面的URL: >>>>>>>>>>>> https://launchpad.net/~teawater/+archive/gdb-10.04 >>>>>>>>>>>> https://launchpad.net/~teawater/+archive/gdb-10.10 >>>>>>>>>>>> https://launchpad.net/~teawater/+archive/gdb-11.04 >>>>>>>>>>>> https://launchpad.net/~teawater/+archive/gdb-11.10 >>>>>>>>>>>> >>>>>>>>>>>> 谢谢, >>>>>>>>>>>> teawater >>>>>>>>>>>> >>>>>>>>>>>> 支持 >>>>>>>>>>>> 可惜我在用Fedora...... >>>>>>>>>>>> >>>>>>>>>> >>>>>>>> >>>>>> >>>> >> >