全部博文(41)
分类: LINUX
2008-05-01 19:52:58
|
-c 只编译并生成目标文件。
-o FILE 生成制定名称的可执行文件。
-I目录 头文件先到指定目录寻找
-l库名 指定编译的时候使用的库
-L目录 指定库的路径
-Wall 生成所有警告信息。
-g 生成调试信息。
#gdb hello
(gdb)b main
(gdb)r
(gdb)n
(gdb)p argv[0]
$1 = 0xbffffc67 “/root/hello”
(gdb)q
gdb progname Start GDB is with an executable program.
r Start your program under GDB.
b LINENUM Set a breakpoint at line LINENUM in current source file.
b FUNCTION Set a breakpoint at entry to function FUNCTION.
s [COUNT] Continue running your program until control reaches a different source line
n [COUNT] Continue to the next source line in current stack frame.
p [EXP] By default value of EXP is printed in a format appropriate to its data type.