求助:gdb调试问题
求助:gdb调试问题
源代码中有一源文件为:program.c
makefile文件中,有一编译项为:gcc -g -o program program.c
然后,用gdb调试:
[root@linux program]# gdb program
GNU gdb Red Hat Linux (5.2.1-4)......
(gdb) b main
Break point 1 at Ox80489d2
(gdb) r
Start program:/usr/program
Break point 1 at Ox080489d2 in main()
(gdb) n
Single stepping until exit from function main,
which has no line number information.....
.....
(gdb) n
Single stepping until exit from _libc_start _main,
whicl has no line number information...
Program exited normally
为什么会这样呢?编译时有 “-g”选项啊,为什么gdb调试没有信息呢?
求助,谢谢!