[原]Linux下的c/c++ GDB调试
Posted by bianbian on 2007-09-18 10:13
还是比较厉害的,比较准。
编译的时候加入 -g -rdynamic 选项,之后就可以跑调试了:
linux $ gcc -g -rdynamic -o error error.c
linux $ gdb error
GNU gdb 6.5
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”…Using host libthread_db library “/lib/libthread_db.so.1″.
(gdb) run
Starting program: /home/linux/error
Program received signal SIGSEGV, Segmentation fault.
错误内容
行数 源码;
(gdb) kill
(gdb) q
linux $
标签: C#, GDB, Linux, 调试遵守创作共用协议,转载请链接形式注明来自http://bianbian.org 做人要厚道
相关日志
Posted in C/C++, Linux, Technology | 1 Comment »