No symbol table is loaded. Use the "file" command.

No symbol table is loaded.  Use the "file" command.

 

gdb 

 

1. 首先使用gcc   -g    .c文件   -o  可执行文件名  进行编译,再使用gdb + 可执行文件名进入gdb环境,进行调试。

命令如下如:

(1)   gcc -g test.c -o test 

(2)   gdb  test

(3)  list等gdb命令;

2.出现问题的可能性:

(1)当编译时,未加 - g 选项,则进入gdb环境中执行命令会出现No symbol table is loaded.  Use the "file" command.提示;

(2)当进入gdb环境时,未加可执行文件名,也会出现No symbol table is loaded.  Use the "file" command.提示;

3.补充说明一下-g选项的作用:

在linux C中gcc编译器一章有说,-g选项的意义是“生成调试信息,该程序可以被调试器调试”
 
原文链接:https://blog.csdn.net/u010176547/article/details/12623939

posted on 2019-08-19 20:19  lydstory  阅读(2615)  评论(0)    收藏  举报

导航