Invoke gdb to automatically pass arguments to the program being debugged

The easiest way to do this given a program X and list of parameters a b c:

X a b c

Is to use gdb‘s --args option, as follows:

gdb --args X a b c

gdb --help has this to say about --args:

--args Arguments after executable-file are passed to inferior

Which means that the first argument after --args is the executable to debug, and all the arguments after that are passed as is to that executable.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)