今天为调试一段代码,使用gcc将程序用-g选项重新编译。但是使用gdb进行debug时,仍然出现“no debug symbols found”的错误。仔细检查了一下Makefile,原来后面定义的连接选项中指定了-s。gcc的文档中说明如下: -sRemove all symbol table and relocation information from the executable. 去掉-s后,可以用gdb进行调试了...
-al : 打印出汇编文件(.s)-an : 关闭所以表格处理 -as : 打印符号表(symbols)上述命令可组合使...
o> -pnn Page listing with 'nn' lines/page (10-150) -r Enable debugger output in object -S Silent operation of assembler -s{ +|-} Set case sensitivity for user symbols -s and -s+ enables sensitivity, -s- disables it. -tn Set tab spacing between 2 and 9 (default 8) -USYMB ...
Application compiled with GCC As per the documentation "debug symbols" added to OMP shared library. vTune Threading analysis done. OMP data
符后面输入下面的命令加载程序a.debug。 file a.debug 命令的运行结果如下所示,显示已经加载了这个文件,并且使用了系统库文件。 Reading symbols from/root/c/a.debug...done. Using host libthread_db library"/lib/libthread_db.so.1". 1.5.5在gdb中查看代码 ...
enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --...
在GCC中,可以将优化和debug选项-g结合使用,其它的编译器可能不允许这样。当一起使用优化和debug时,编译器通过优化执行的内部重排可能导致调试器很难指导当前正在执行什么。比如,临时变量经常被消除,语句的顺序可能改变。但是,当一个程序异常崩溃,有调试信息总比没有好,因此调试程序建议使用-g选项。默认的GNU发行版本,...
-a或--debug-syms:显示所有的符号,包括debugger-only symbols。 -B:等同于--format=bsd,用来兼容MIPS的nm。 -C或--demangle:将低级符号名解析(demangle)成用户级名字。这样可以使得C++函数名具有可读性。 --no-demangle:默认的选项,不需要将低级符号名解析成用户级名。
if (debug) fprintf (stderr, "\t%s\n", buf); } if (debug) fprintf (stderr, "\n"); do_wait (ldd_file_name, pex); signal (SIGINT, int_handler); #ifdef SIGQUIT signal (SIGQUIT, quit_handler); #endif /* Now iterate through the library list adding their symbols to the list....
答案是不行,因为Core文件中没有符号表信息,无法进行调试,可以使用如下命令来验证:Objdump x core_file | tail我们看到如下两行信息:SYMBOL TABLE:no symbols表明当前的ELF格式文件中没有符号表信息。为了解释如何看Core中信息,我们来举一个简单的例子:#include “stdio.h”int main()int stack_of100000000;in 34...