This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debugging programme with parameters


Use the "set args" command inside gdb:

  (gdb) set args "3+(2-4)*5"
  (gdb) run

"set args" is sticky; it stays from run to run.

With gdb 5.2, you can also set the arguments on the gdb command line:

  % gdb --args calc "3+(2-4)*5"

Cheers,

Michael C


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]