When running a program on GDB, usually, the arguments for the program are given at the run command. Is there a way to run the program using GDB and as well as g
Much too late, but here is a method that works during gdb session.
gdb
then
(gdb) apropos argument
This will return lots of matches, the useful one is set args.
set args -- Set argument list to give program being debugged when it is started.
set args arg1 arg2 ...
then
r
This will run the program, passing to main(argc, argv) the arguments and the argument count.