sunworld 发表于 2010-09-08 07:52

gdb cannot break

第一次打开“ddd 我的程序”,会显示:... ... /bin-linux<<C++ namespace>> : No such file or directory.
我编译用 “-gdward-2". 这时,我还有机会打开源程序文件。可是对”main.cpp",显示:Line number 1 is out of range for "main.cpp" .

在main中设断点,总说”No line 40 in file main.cpp"

请问应该怎么办?

谢谢

EricFisher 发表于 2010-09-09 13:23

不用ddd,先用gdb试试?

sunworld 发表于 2010-09-09 14:39

$ gdb cduicc
GNU gdb Red Hat Linux (6.3.0.0-1.159.el4rh)
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) list
1       <<C++-namespaces>>: No such file or directory.
      in <<C++-namespaces>>
(gdb)


觉得就是奇怪,我已经用“-ggdb"选项,gcc用422版本。

谢谢!

bluesea666 发表于 2010-09-09 15:14

学习了.

EricFisher 发表于 2010-09-09 16:35

没写过,也没调过c++
页: [1]
查看完整版本: gdb cannot break