I have to debug a program that has errors in it as part of my assignment. However, I must first pass command line arguments in order to solve this problem.
I do:
gdb -tui InsertionSortWithErrors
which works but after that I don't know how to pass arguments. I used gdb -help
and it says something about --args
which I also tried and it didn't work.
I want to be able to get the debugger+the gui and pass command line arguments.
I'm using gdb 7.1.1, as
--help
show:IMHO the order is a bit unintuitive at first.
Try
Another option, once inside gdb shell, before running the program, you can do
and inspect it with
Once
gdb
starts, you can run the program using "r args".So if you are running your code by:
Debug it on
gdb
by: