免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2102 | 回复: 2

急,帮忙,段错误 [复制链接]

论坛徽章:
0
发表于 2007-10-26 10:34 |显示全部楼层
程序还没有执行main函数就 段错误了,下面是调试信息,
$ gdb ./pcpos
GNU gdb Red Hat Linux (6.3.0.0-1.62rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) r
Starting program: /home/symsun/poss/pcpos

Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
(gdb) backtrace
#0  0x00000001 in ?? ()
(gdb)

不知道是哪里出错了,请指点,为什么出错的函数名称为2个问号?无从下手啊。

论坛徽章:
0
发表于 2007-10-26 14:03 |显示全部楼层
原帖由 xxyyy 于 2007-10-26 10:34 发表
程序还没有执行main函数就 段错误了,下面是调试信息,
$ gdb ./pcpos
GNU gdb Red Hat Linux (6.3.0.0-1.62rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU ...

试试 b main 再 r

论坛徽章:
0
发表于 2007-10-26 14:24 |显示全部楼层

错误依旧啊,难道还没有开始就错误了?

gdb ./pcpos
GNU gdb Red Hat Linux (6.3.0.0-1.62rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) b main
Breakpoint 1 at 0x69c56: file main.cpp, line 187.
(gdb) r
Starting program: /home/symsun/poss/pcpos
Breakpoint 1 at 0xbecc56: file main.cpp, line 187.

Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
(gdb)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP