使用 gdb 命令提供的 --args 选项可以调试需要命令行参数的程序,如下: gdb --args a.out arg1 arg2 arg3 转载于:https://www.cnblogs.com/asvblog/p/10462532.html