免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3131 | 回复: 7
打印 上一主题 下一主题

gdbserver远程调试ctrl+c [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-10 11:41 |只看该作者 |倒序浏览
用gdbserver远程调试ctrl+c出现的segment fault
但是在PC上运行ppc_85xx-gdb,设置target remote,c,出现:

  1. Remote debugging using 192.168.2.206:2345
  2. 0x30010564 in ?? ()
  3. (gdb) c
  4. Continuing.

  5. Program received signal SIG32, Real-time event 32.
  6. 0x0fef2aa0 in ?? ()
  7. (gdb) c
  8. Continuing.

  9. Program received signal SIG32, Real-time event 32.
  10. 0x0fef2aa0 in ?? ()
  11. (gdb) c
  12. Continuing.
  13. c
  14. c
  15. c

  16. Program received signal SIGINT, Interrupt.
  17. 0x0fef6714 in ?? ()
  18. (gdb) c
  19. Continuing.

复制代码

??太多了,我想知道段错误的具体位置,请问怎么调试,谢谢

[ 本帖最后由 ruger 于 2008-12-10 13:15 编辑 ]

论坛徽章:
5
摩羯座
日期:2014-07-22 09:03:552015元宵节徽章
日期:2015-03-06 15:50:392015亚冠之大阪钢巴
日期:2015-06-12 16:01:352015年中国系统架构师大会
日期:2015-06-29 16:11:2815-16赛季CBA联赛之四川
日期:2018-12-17 14:10:21
2 [报告]
发表于 2008-12-10 12:01 |只看该作者
确实挺痛苦的,期待高手的答案

[ 本帖最后由 T-bagwell 于 2008-12-10 12:02 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2008-12-10 12:52 |只看该作者
我以前调试的时候一个好方法是
首先得busybox得是高点的版本,好像得1.0以上吧,
反正得支持ulimit。
然后开打ulimit记录,具体怎么弄你慢一下。
反正让他段错误的时候产生core文件。
然后你把这个core文件传到pc机,用ppc_gdb -c ./core  filename
加载后,用bt查看一下堆栈就知道断在哪了

论坛徽章:
0
4 [报告]
发表于 2008-12-10 13:16 |只看该作者
原帖由 emmoblin 于 2008-12-10 12:52 发表
我以前调试的时候一个好方法是
首先得busybox得是高点的版本,好像得1.0以上吧,
反正得支持ulimit。
然后开打ulimit记录,具体怎么弄你慢一下。
反正让他段错误的时候产生core文件。
然后你把这个core文件 ...

试试~~
ulimit支持,ulimit -c 10244
./server后ctrl+c
产生了core文件,core.524
但是ppc_85xx-gdb --core=core.524还是看不到具体错误的位置:

  1. [root@localhost order]# ppc_85xx-gdb --core=core.524
  2. GNU gdb Red Hat Linux (6.3.0.0-1.21_1rh)
  3. Copyright 2004 Free Software Foundation, Inc.
  4. GDB is free software, covered by the GNU General Public License, and you are
  5. welcome to change it and/or distribute copies of it under certain conditions.
  6. Type "show copying" to see the conditions.
  7. There is absolutely no warranty for GDB.  Type "show warranty" for details.
  8. This GDB was configured as "--host=i386-redhat-linux --target=ppc-linux".
  9. Core was generated by `./server'.
  10. Program terminated with signal 11, Segmentation fault.
  11. #0  0x0fdf5644 in ?? ()
  12. (gdb) bt
  13. #0  0x0fdf5644 in ?? ()
  14. #1  0x0fed4b3c in ?? ()
  15. Previous frame identical to this frame (corrupt stack?)
  16. (gdb) file ./server
  17. Reading symbols from /root/workspace/code/order/server...done.
  18. (gdb) bt
  19. #0  0x0fdf5644 in ?? ()
  20. #1  0x0fed4b3c in ?? ()
  21. Previous frame identical to this frame (corrupt stack?)
复制代码

我的libthread_db.so是stripped的,是否stripped后的libthread_db不支持具体的错误信息?

[ 本帖最后由 ruger 于 2008-12-10 13:38 编辑 ]

论坛徽章:
5
摩羯座
日期:2014-07-22 09:03:552015元宵节徽章
日期:2015-03-06 15:50:392015亚冠之大阪钢巴
日期:2015-06-12 16:01:352015年中国系统架构师大会
日期:2015-06-29 16:11:2815-16赛季CBA联赛之四川
日期:2018-12-17 14:10:21
5 [报告]
发表于 2008-12-10 13:20 |只看该作者
得给分,提供的思路很好

论坛徽章:
0
6 [报告]
发表于 2008-12-10 13:28 |只看该作者
试试吧,以前我就是这么干的

论坛徽章:
0
7 [报告]
发表于 2008-12-10 13:39 |只看该作者
ulimit支持,ulimit -c 10244
./server后ctrl+c
产生了core文件,core.524
但是ppc_85xx-gdb --core=core.524还是看不到具体错误的位置:



  1. [root@localhost order]# ppc_85xx-gdb --core=core.524
  2. GNU gdb Red Hat Linux (6.3.0.0-1.21_1rh)
  3. Copyright 2004 Free Software Foundation, Inc.
  4. GDB is free software, covered by the GNU General Public License, and you are
  5. welcome to change it and/or distribute copies of it under certain conditions.
  6. Type "show copying" to see the conditions.
  7. There is absolutely no warranty for GDB.  Type "show warranty" for details.
  8. This GDB was configured as "--host=i386-redhat-linux --target=ppc-linux".
  9. Core was generated by `./server'.
  10. Program terminated with signal 11, Segmentation fault.
  11. #0  0x0fdf5644 in ?? ()
  12. (gdb) bt
  13. #0  0x0fdf5644 in ?? ()
  14. #1  0x0fed4b3c in ?? ()
  15. Previous frame identical to this frame (corrupt stack?)
  16. (gdb) file ./server
  17. Reading symbols from /root/workspace/code/order/server...done.
  18. (gdb) bt
  19. #0  0x0fdf5644 in ?? ()
  20. #1  0x0fed4b3c in ?? ()
  21. Previous frame identical to this frame (corrupt stack?)
复制代码

我的libthread_db.so是stripped的,是否stripped后的libthread_db不支持具体的错误信息?

论坛徽章:
0
8 [报告]
发表于 2008-12-10 14:50 |只看该作者
我查源代码找到一个明显的错误。。。,寒~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP