gdb问题求助
-
- 帖子: 7
- 注册时间: 2007-04-01 0:07
gdb问题求助
我装的是7.04的系统,装好以后,好像gdb是装好的。小弟也是新手,刚用gdb.在命令行下输入gdb后,显示如下:
GNU gdb 6.6
Copyright (C) 2006 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 "i686-pc-linux-gnu".
(gdb)
然后输入file 和要调试的文件,输入 run 命令,运行正常。但当我输入list 命令的时候,报错如下 ;
list
1 init.c: No such file or directory.
in init.c
输入 list
No line 3 in file "init.c".
真的搞不明白,希望各位高手能给小弟详细介绍一下,小弟感激不尽。
GNU gdb 6.6
Copyright (C) 2006 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 "i686-pc-linux-gnu".
(gdb)
然后输入file 和要调试的文件,输入 run 命令,运行正常。但当我输入list 命令的时候,报错如下 ;
list
1 init.c: No such file or directory.
in init.c
输入 list
No line 3 in file "init.c".
真的搞不明白,希望各位高手能给小弟详细介绍一下,小弟感激不尽。
- boydd
- 帖子: 255
- 注册时间: 2007-05-10 19:42
- 来自: 南京, Deutschland, Karlsruhe
- 联系:
- boydd
- 帖子: 255
- 注册时间: 2007-05-10 19:42
- 来自: 南京, Deutschland, Karlsruhe
- 联系:
http://www.cygwin.com/ml/gdb/2003-06/msg00112.html
this guy has same problem as u have.
That suggests that the init.c is coming from gcc/glibc, and has debug
information. It's not associated with your application.
1. make sure that, if u install the "glibc"
2. g++ -c -g -W -Wall testgdb.c
by using -W -Wall u can get more warning information
good luck
this guy has same problem as u have.
That suggests that the init.c is coming from gcc/glibc, and has debug
information. It's not associated with your application.
1. make sure that, if u install the "glibc"
2. g++ -c -g -W -Wall testgdb.c
by using -W -Wall u can get more warning information
good luck
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
- boydd
- 帖子: 255
- 注册时间: 2007-05-10 19:42
- 来自: 南京, Deutschland, Karlsruhe
- 联系:
-
- 帖子: 7
- 注册时间: 2007-04-01 0:07
首先对你的帮助表示感谢。因为看到有跟帖说要配置gcc,而我的gcc是在系统装好以后就装好了的,我不知道是不是还要配置,此前我的gdb不能调试,我下载了一个准备再装一下,在gdb的README里,我看到有这样一段話:If you have more than one compiler on your system, it is often best to explicitly set CC in the environment before running configure, and to also set CC when running make. 所以不知道到底问题出在哪里,也不知道该怎样做。
- boydd
- 帖子: 255
- 注册时间: 2007-05-10 19:42
- 来自: 南京, Deutschland, Karlsruhe
- 联系: