I would li开发者_StackOverflow中文版ke to run a program (that requires arguments) repetitively in gdb under linux. It takes about a minute to run and it fails once every 30 or so times through. Any ideas would be appreciated.
gdb --eval-command=run --args executable-file [inferior-arguments ...] where executable-file is your executable and [inferior-arguments ...] is the list of arguments it takes will run your program once under gdb.
Unfortunately, I don't see an easy way to get gdb to quit when the program exits successfully. You could use --batch, but that doesn't let you do interactive debugging. It will at least give you a backtrace though. And you could use a --command file to dump everything you care about in --batch mode.
加载中,请稍侯......
精彩评论