gdb调试带参数的程序

来自http://tunps.com/gdb-debug-program-with-args

方法一:
gdb --args program arg1 arg2 arg3 ....
方法二:
gdb program
(gdb)break xx //下个断点
(gdb)r arg1 arg2 arg3.....
方法三:
gdb program
(gdb)break xx //下个断点
(gdb)set args arg1 arg2 arg3.....
(注:gdb中next和n,step和s,break和b,list和l等是等价的,只是为了简写)

About tunpishuang

just 4 fun·····
This entry was posted in 未分类 and tagged . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>