[hellogcc] Re: more debug info about kgtp on loongson

  • From: Hui Zhu <teawater@xxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Sat, 18 Dec 2010 08:30:16 +0800

http://code.google.com/p/kgtp/issues/detail?id=12

貌似还没 不过我回头作个PATCH或者沟通一下吧

2010/12/17 乔崇 <qiaochong@xxxxxxxxxxx>:
> 我发现你以前提交的bug,现在解决了吗?
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=12013
>
>
> Hui Zhu 写道:
>
> 2010/12/17 乔崇 <qiaochong@xxxxxxxxxxx>:
>
>
> 是的,是没有action的原因。
>
> 1.发现一个错误,mips has reg 31,which is ra.
>
> diff --git a/lib/gtp.c b/lib/gtp.c
> index 07fea25..978ecf2 100644
> --- a/lib/gtp.c
> +++ b/lib/gtp.c
> @@ -582,7 +582,7 @@ gtp_action_reg_read(struct pt_regs *regs, struct
> gtp_entry *tpe, int num)
>                 num -= 90;
>         }
>
> -       if (num >= 0 && num < 31) {
> +       if (num >= 0 && num <= 31) {
>                 ret = regs->regs[num];
>         } else {
>                 switch (num) {
>
>
> 多谢 一会我改掉
>
>
>
> 2.
> sudo gdb72 vmlinux
> GNU gdb (GDB) 7.2.50.20101216-cvs
> Copyright (C) 2010 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 "--host=mipsel-unknown-linux-gnu
> --target=mipsel-linux".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /work/rt4ls/vmlinux...done.
> (gdb) target remote /proc/gtp
> Remote debugging using /proc/gtp
> 0x0000000000000000 in ?? ()
> (gdb) trace ext3_lookup
> Tracepoint 1 at 0xffffffff80382654: file fs/ext3/namei.c, line 1036.
> (gdb) actions
> Enter actions for tracepoint 1, one per line.
> End with a line saying just "end".
>
>
> collect *(unsigned char *)$rsp@512
>
>
> $rsp is not a trace state variable; GDB agent expressions cannot use
> convenience variables.
>
> 是我gdb版本的问题吗?
> 为什么$rsp用不了,另外怎么查看都有那些trace state variable.
>
>
> $rsp是amd64的sp寄存器 你换成mips 29 寄存器 $29 也许$sp就可以
>
>
>
> 还有commands和action对于高版本的gdb来说有区别吗?
>
>
> 里面是一样的 其实commands更好 可以对单个或者多个tracepoint 设置action 其实再作个action我都不知道有哈用
>
>
>
> Hui Zhu 写道:
>
> 这个LOG清晰一点了 看起来貌似是因为你没设置任何ACTION 而KGTP处理没有ACTION的tracepoint的时候有点问题
>
> 一会我编完新KERNEL就测试一下这个问题
>
> 多谢你报这个BUG
>
> Thanks,
> Hui
>
> 2010/12/17 乔崇 <qiaochong@xxxxxxxxxxx>:
>
>
> 1.gdb infomation
>
> GNU gdb (GDB) 7.2.50.20101216-cvs
> Copyright (C) 2010 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 "--host=mipsel-unknown-linux-gnu
> --target=mipsel-linux".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /work/rt4ls/vmlinux...done.
> (gdb)target remote /pro/gtp
> Remote debugging using /proc/gtp
> sending:
> "qSupported:qRelocInsn+"
> received:
> "ConditionalTracepoints+;TracepointSource+;DisconnectedTracing+"
> sending:
> "Hg0"
> received:
> ""
> sending:
> "?"
> received:
> "S05"
> sending:
> "Hc-1"
> received:
> ""
> sending:
> "qC"
> received:
> ""
> sending:
> "qAttached"
> received:
> ""
> sending:
> "qOffsets"
> received:
> ""
> sending:
> "Hg0"
> received:
> ""
> sending:
> "g"
> received:
> "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
> sending:
> "g"
> received:
> "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
> sending:
> "m0,4"
> received:
> "E0e"
> sending:
> "mfffffffffffffffc,4"
> received:
> "E0e"
> sending:
> "m0,4"
> received:
> "E0e"
> 0x0000000000000000 in ?? ()
> sending:
> "qSymbol::"
> received:
> ""
> sending:
> "qTStatus"
> received:
> "T0;tnotrun:0;tframes:0;tcreated:0;tsize:500000;tfree:500000;circular:0;disconn:0"
> remote_get_noisy_reply():
> T0;tnotrun:0;tframes:0;tcreated:0;tsize:500000;tfree:500000;circular:0;disconn:0
> sending:
> "qTfV"
> received:
> "1:0:1:63757272656e745f7461736b"
> sending:
> "qTsV"
> received:
> "l"
> sending:
> "qTfP"
> received:
> "l"
> (gdb) trace ext3_lookup
> sending:
> "mffffffff80382654,4"
> received:
> "3400a28c"
> Tracepoint 1 at 0xffffffff80382654: file fs/ext3/namei.c, line 1036.
> (gdb) tstart
> sending:
> "QTinit"
> received:
> "OK"
> remote_get_noisy_reply():
> OK
> sending:
> "QTDP:1:ffffffff80382654:E:0:0"
> received:
> "E16"
> remote_get_noisy_reply():
> E16
> remote.c: error in outgoing packet at field #6.
> (gdb) quit
> A debugging session is active.
>
>        Inferior 1 [Remote target] will be killed.
>
> Quit anyway? (y or n) sending:
> "qTStatus"
> received:
> "T0;tnotrun:0;tframes:0;tcreated:0;tsize:500000;tfree:500000;circular:0;disconn:0"
> remote_get_noisy_reply():
> T0;tnotrun:0;tframes:0;tcreated:0;tsize:500000;tfree:500000;circular:0;disconn:0
> sending:
> "k"
>
> 2.gtp printk msg
>
> [25845.244000] gtp_open
> [25845.244000] gtp_ioctl: 540d
> [25845.244000] gtp_ioctl: 540d
> [25845.244000] gtp_ioctl: 540e
> [25845.244000] gtp_ioctl: 540d
> [25845.244000] gtp_ioctl: 5407
> [25845.244000] gtp_write: qSupported:qRelocInsn+
> [25845.244000] gtp_ioctl: 540d
> [25845.244000] gtp_ioctl: 540d
> [25845.244000] gtp_ioctl: 540e
> [25845.244000] gtp_ioctl: 540d
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: Hg0
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: ?
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: Hc-1
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: qC
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: qAttached
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: qOffsets
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: Hg0
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.244000] gtp_write: g
> [25845.244000] gtp_read
> [25845.244000] gtp_read
> [25845.260000] gtp_write: g
> [25845.260000] gtp_read
> [25845.260000] gtp_read
> [25845.272000] gtp_write: m0,4
> [25845.272000] gtp_gdbrsp_m: addr = 0x0 len = 4
> [25845.272000] gtp_read
> [25845.272000] gtp_read
> [25845.272000] gtp_write: mfffffffffffffffc,4
> [25845.272000] gtp_gdbrsp_m: addr = 0xfffffffffffffffc len = 4
> [25845.272000] gtp_read
> [25845.272000] gtp_read
> [25845.336000] gtp_write: m0,4
> [25845.336000] gtp_gdbrsp_m: addr = 0x0 len = 4
> [25845.336000] gtp_read
> [25845.336000] gtp_read
> [25845.348000] gtp_write: qSymbol::
> [25845.348000] gtp_read
> [25845.348000] gtp_read
> [25845.348000] gtp_write: qTStatus
> [25845.348000] gtp_gdbrsp_qT: Status
> [25845.348000] gtp_read
> [25845.348000] gtp_read
> [25845.348000] gtp_write: qTfV
> [25845.348000] gtp_gdbrsp_qT: fV
> [25845.348000] gtp_read
> [25845.348000] gtp_read
> [25845.352000] gtp_write: qTsV
> [25845.352000] gtp_gdbrsp_qT: sV
> [25845.352000] gtp_read
> [25845.352000] gtp_read
> [25845.352000] gtp_write: qTfP
> [25845.352000] gtp_gdbrsp_qT: fP
> [25845.352000] gtp_read
> [25845.352000] gtp_read
> [25856.372000] gtp_write: mffffffff80382654,4
> [25856.372000] gtp_gdbrsp_m: addr = 0xffffffff80382654 len = 4
> [25856.372000] gtp_gdbrsp_m: 0 34
> [25856.372000] gtp_gdbrsp_m: 1 00
> [25856.372000] gtp_gdbrsp_m: 2 a2
> [25856.372000] gtp_gdbrsp_m: 3 8c
> [25856.372000] gtp_read
> [25856.372000] gtp_read
> [25859.272000] gtp_write: QTinit
> [25859.272000] gtp_gdbrsp_QT: init
> [25859.272000] gtp_gdbrsp_qtinit
> [25859.272000] gtp_gdbrsp_QT: return 0
> [25859.272000] gtp_read
> [25859.272000] gtp_read
> [25859.272000] gtp_write: QTDP:1:ffffffff80382654:E:0:0
> [25859.272000] gtp_gdbrsp_QT: DP:1:ffffffff80382654:E:0:0
> [25859.272000] gtp_gdbrsp_qtdp: 1:ffffffff80382654:E:0:0
> [25859.272000] gtp_gdbrsp_QT: return -22
> [25859.272000] gtp_read
> [25859.272000] gtp_read
> [25863.180000] gtp_write: qTStatus
> [25863.180000] gtp_gdbrsp_qT: Status
> [25863.180000] gtp_read
> [25863.180000] gtp_read
> [25863.180000] gtp_write: k
> [25863.180000] gtp_read
> [25863.180000] gtp_release
> [25863.180000] gtp_gdbrsp_qtstop
> [25863.180000] gtp_gdbrsp_qtinit
>
>
>
>
>
>
>
> --
>
> 乔崇 qiaochong@xxxxxxxxxxx
> 龙芯中科技术服务中心有限公司
> office:010-62600855-615
> mobile:13521990614
>
> 2010年 12月 17日 星期五 13:33:55 CST
>
>
>
>
> --
>
> 乔崇 qiaochong@xxxxxxxxxxx
> 龙芯中科技术服务中心有限公司
> office:010-62600855-615
> mobile:13521990614
>
> 2010年 12月 17日 星期五 14:41:09 CST

Other related posts: