当前位置: 技术问答>linux和unix
gdb调试入门级问题
来源: 互联网 发布时间:2015-07-29
本文导语: 我首先打 #gdb a 然后 (gdb)run 能出现正确结果了,但是接着打 (gdb)list 却不能显示源代码 有以下提示: ../sysdeps/i386/elf/start.S 没有哪个文件或目录. in ../sysdeps/i386/elf/start.S 不知如何解决? | ...
我首先打
#gdb a
然后
(gdb)run
能出现正确结果了,但是接着打
(gdb)list
却不能显示源代码
有以下提示: ../sysdeps/i386/elf/start.S 没有哪个文件或目录. in ../sysdeps/i386/elf/start.S
不知如何解决?
#gdb a
然后
(gdb)run
能出现正确结果了,但是接着打
(gdb)list
却不能显示源代码
有以下提示: ../sysdeps/i386/elf/start.S 没有哪个文件或目录. in ../sysdeps/i386/elf/start.S
不知如何解决?
|
gcc -g a.c
你肯定没有加上参数-g
你肯定没有加上参数-g
|
you must make sense of the theory of the debug.
in every OS, there must be the debug part for the program developer.
so if you develop the application, you can only use the OS debugger, that is OK.
just like the GDB or the debug of DOS.
but you maybe see every IDE has its own debugger.
you must make clear of which level the debugger is in.
if the debuger can watch the register of the CPU, maybe it just derict call the debuger of the OS, or it can call the OS interface to develop the Debugger in the level which you want. for example, source code level, hardware level, side effect,as so on.
in every OS, there must be the debug part for the program developer.
so if you develop the application, you can only use the OS debugger, that is OK.
just like the GDB or the debug of DOS.
but you maybe see every IDE has its own debugger.
you must make clear of which level the debugger is in.
if the debuger can watch the register of the CPU, maybe it just derict call the debuger of the OS, or it can call the OS interface to develop the Debugger in the level which you want. for example, source code level, hardware level, side effect,as so on.
|
Right!
|
要有 -g 编译选项的
|
加-g 选项
|
同意楼上
|
>> 有以下提示: ../sysdeps/i386/elf/start.S 没有哪个文件或目录.
这里是你跟踪到系统(库)中去了吧。需要设置 GDB 的源码搜索路径
这里是你跟踪到系统(库)中去了吧。需要设置 GDB 的源码搜索路径
|
嗯,gcc 的时候没有加 -g